Menu
AWS CodePipeline
API Reference (API Version 2015-07-09)

UpdatePipeline

Updates a specified pipeline with edits or changes to its structure. Use a JSON file with the pipeline structure in conjunction with UpdatePipeline to provide the full structure of the pipeline. Updating the pipeline increases the version number of the pipeline by 1.

Request Syntax

{
   "pipeline": { 
      "artifactStore": { 
         "encryptionKey": { 
            "id": "string",
            "type": "string"
         },
         "location": "string",
         "type": "string"
      },
      "name": "string",
      "roleArn": "string",
      "stages": [ 
         { 
            "actions": [ 
               { 
                  "actionTypeId": { 
                     "category": "string",
                     "owner": "string",
                     "provider": "string",
                     "version": "string"
                  },
                  "configuration": { 
                     "string" : "string" 
                  },
                  "inputArtifacts": [ 
                     { 
                        "name": "string"
                     }
                  ],
                  "name": "string",
                  "outputArtifacts": [ 
                     { 
                        "name": "string"
                     }
                  ],
                  "roleArn": "string",
                  "runOrder": number
               }
            ],
            "blockers": [ 
               { 
                  "name": "string",
                  "type": "string"
               }
            ],
            "name": "string"
         }
      ],
      "version": number
   }
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

pipeline

The name of the pipeline to be updated.

Type: PipelineDeclaration object

Required: Yes

Response Syntax

{
   "pipeline": { 
      "artifactStore": { 
         "encryptionKey": { 
            "id": "string",
            "type": "string"
         },
         "location": "string",
         "type": "string"
      },
      "name": "string",
      "roleArn": "string",
      "stages": [ 
         { 
            "actions": [ 
               { 
                  "actionTypeId": { 
                     "category": "string",
                     "owner": "string",
                     "provider": "string",
                     "version": "string"
                  },
                  "configuration": { 
                     "string" : "string" 
                  },
                  "inputArtifacts": [ 
                     { 
                        "name": "string"
                     }
                  ],
                  "name": "string",
                  "outputArtifacts": [ 
                     { 
                        "name": "string"
                     }
                  ],
                  "roleArn": "string",
                  "runOrder": number
               }
            ],
            "blockers": [ 
               { 
                  "name": "string",
                  "type": "string"
               }
            ],
            "name": "string"
         }
      ],
      "version": number
   }
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

pipeline

The structure of the updated pipeline.

Type: PipelineDeclaration object

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidActionDeclarationException

The specified action declaration was specified in an invalid format.

HTTP Status Code: 400

InvalidBlockerDeclarationException

Reserved for future use.

HTTP Status Code: 400

InvalidStageDeclarationException

The specified stage declaration was specified in an invalid format.

HTTP Status Code: 400

InvalidStructureException

The specified structure was specified in an invalid format.

HTTP Status Code: 400

ValidationException

The validation was specified in an invalid format.

HTTP Status Code: 400

Example

Sample Request

POST / HTTP/1.1
Host: codepipeline.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 914
X-Amz-Target: CodePipeline_20150709.UpdatePipeline
X-Amz-Date: 20160707T174930Z
User-Agent: aws-cli/1.7.38 Python/2.7.9 Windows/7
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20160707/us-east-1/codepipeline/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=8d9b5998EXAMPLE

{
  "pipeline": {
    "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service",
    "stages": [
      {
        "name": "Source",
        "actions": [
          {
            "inputArtifacts": [],
            "name": "Source",
            "actionTypeId": {
              "category": "Source",
              "owner": "AWS",
              "version": "1",
              "provider": "S3"
            },
            "outputArtifacts": [
              {
                "name": "MyApp"
              }
            ],
            "configuration": {
              "S3Bucket": "awscodepipeline-demo-bucket2",
              "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip"
            },
            "runOrder": 1
          }
        ]
      },
      {
        "name": "Staging",
        "actions": [
          {
            "inputArtifacts": [
              {
                "name": "MyApp"
              }
            ],
            "name": "CodePipelineDemoFleet",
            "actionTypeId": {
              "category": "Deploy",
              "owner": "AWS",
              "version": "1",
              "provider": "CodeDeploy"
            },
            "outputArtifacts": [],
            "configuration": {
              "ApplicationName": "CodePipelineDemoApplication",
              "DeploymentGroupName": "CodePipelineDemoFleet"
            },
            "runOrder": 1
          }
        ]
      }
    ],
    "artifactStore": {
      "type": "S3",
      "location": "codepipeline-us-east-1-11EXAMPLE11"
    },
    "name": "MyFirstPipeline",
    "version": 1
  }
}

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: 620484b7-88cb-11e5-b497-75c49EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 898

{
  "pipeline": {
    "artifactStore": {
      "location": "codepipeline-us-east-1-11EXAMPLE11",
      "type": "S3"
    },
    "name": "MyFirstPipeline",
    "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service",
    "stages": [
      {
        "actions": [
          {
            "actionTypeId": {
              "__type": "ActionTypeId",
              "category": "Source",
              "owner": "AWS",
              "provider": "S3",
              "version": "1"
            },
            "configuration": {
              "S3Bucket": "awscodepipeline-demo-bucket2",
              "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip"
            },
            "inputArtifacts": [],
            "name": "Source",
            "outputArtifacts": [
              {
                "name": "MyApp"
              }
            ],
            "runOrder": 1
          }
        ],
        "name": "Source"
      },
      {
        "actions": [
          {
            "actionTypeId": {
              "__type": "ActionTypeId",
              "category": "Deploy",
              "owner": "AWS",
              "provider": "CodeDeploy",
              "version": "1"
            },
            "configuration": {
              "ApplicationName": "CodePipelineDemoApplication",
              "DeploymentGroupName": "CodePipelineDemoFleet"
            },
            "inputArtifacts": [
              {
                "name": "MyApp"
              }
            ],
            "name": "CodePipelineDemoFleet",
            "outputArtifacts": [],
            "runOrder": 1
          }
        ],
        "name": "Staging"
      }
    ],
    "version": 3
  }
}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: