UpdatePipeline - CodePipeline

UpdatePipeline

Updates a specified pipeline with edits or changes to its structure. Use a JSON file with the pipeline structure and 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" }, "artifactStores": { "string" : { "encryptionKey": { "id": "string", "type": "string" }, "location": "string", "type": "string" } }, "executionMode": "string", "name": "string", "pipelineType": "string", "roleArn": "string", "stages": [ { "actions": [ { "actionTypeId": { "category": "string", "owner": "string", "provider": "string", "version": "string" }, "configuration": { "string" : "string" }, "inputArtifacts": [ { "name": "string" } ], "name": "string", "namespace": "string", "outputArtifacts": [ { "name": "string" } ], "region": "string", "roleArn": "string", "runOrder": number, "timeoutInMinutes": number } ], "blockers": [ { "name": "string", "type": "string" } ], "name": "string" } ], "triggers": [ { "gitConfiguration": { "pullRequest": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "events": [ "string" ], "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "push": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] }, "tags": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "sourceActionName": "string" }, "providerType": "string" } ], "variables": [ { "defaultValue": "string", "description": "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" }, "artifactStores": { "string" : { "encryptionKey": { "id": "string", "type": "string" }, "location": "string", "type": "string" } }, "executionMode": "string", "name": "string", "pipelineType": "string", "roleArn": "string", "stages": [ { "actions": [ { "actionTypeId": { "category": "string", "owner": "string", "provider": "string", "version": "string" }, "configuration": { "string" : "string" }, "inputArtifacts": [ { "name": "string" } ], "name": "string", "namespace": "string", "outputArtifacts": [ { "name": "string" } ], "region": "string", "roleArn": "string", "runOrder": number, "timeoutInMinutes": number } ], "blockers": [ { "name": "string", "type": "string" } ], "name": "string" } ], "triggers": [ { "gitConfiguration": { "pullRequest": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "events": [ "string" ], "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "push": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] }, "tags": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "sourceActionName": "string" }, "providerType": "string" } ], "variables": [ { "defaultValue": "string", "description": "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 action declaration was specified in an invalid format.

HTTP Status Code: 400

InvalidBlockerDeclarationException

Reserved for future use.

HTTP Status Code: 400

InvalidStageDeclarationException

The stage declaration was specified in an invalid format.

HTTP Status Code: 400

InvalidStructureException

The structure was specified in an invalid format.

HTTP Status Code: 400

LimitExceededException

The number of pipelines associated with the AWS account has exceeded the limit allowed for the account.

HTTP Status Code: 400

ValidationException

The validation was specified in an invalid format.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of UpdatePipeline.

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: