GetPipeline - CodePipeline

GetPipeline

Returns the metadata, structure, stages, and actions of a pipeline. Can be used to return the entire structure of a pipeline in JSON format, which can then be modified and used to update the pipeline structure with UpdatePipeline.

Request Syntax

{ "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.

name

The name of the pipeline for which you want to get information. Pipeline names must be unique in an AWS account.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [A-Za-z0-9.@\-_]+

Required: Yes

version

The version number of the pipeline. If you do not specify a version, defaults to the current version.

Type: Integer

Valid Range: Minimum value of 1.

Required: No

Response Syntax

{ "metadata": { "created": number, "pipelineArn": "string", "pollingDisabledAt": number, "updated": number }, "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.

metadata

Represents the pipeline metadata information returned as part of the output of a GetPipeline action.

Type: PipelineMetadata object

pipeline

Represents the structure of actions and stages to be performed in the pipeline.

Type: PipelineDeclaration object

Errors

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

PipelineNotFoundException

The pipeline was specified in an invalid format or cannot be found.

HTTP Status Code: 400

PipelineVersionNotFoundException

The pipeline version was specified in an invalid format or cannot be found.

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 GetPipeline.

Sample Request

POST / HTTP/1.1 Host: codepipeline.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: 27 X-Amz-Target: CodePipeline_20150709.GetPipeline X-Amz-Date: 20160707T171559Z 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 { "name": "MyFirstPipeline" }

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": { "roleArn": "arn:aws:iam::11111EXAMPLE:role/AWS-CodePipeline-Service", "stages": [ { "name": "Source", "actions": [ { "actionTypeId": { "category": "Source", "owner": "AWS", "provider": "S3", "version": "1" }, "configuration": { "PollForSourceChanges": "true", "S3Bucket": "awscodepipeline-demo-bucket", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "inputArtifacts": [], "name": "Source", "outputArtifacts": [ { "name": "MyApp" } ], "runOrder": 1 } ] }, { "name": "Build", "actions": [ { "actionTypeId": { "category": "Build", "owner": "AWS", "provider": "CodeBuild", "version": "1" }, "configuration": { "ProjectName": "BuildProject" }, "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodeBuild", "outputArtifacts": [ { "name": "MyAppBuild" } ], "runOrder": 1 } ] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-2-250656481468" }, "name": "MyFirstPipeline", "version": 1 }, "metadata": { "pipelineArn": "arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline", "updated": 1501626591.112, "created": 1501626591.112 } }

See Also

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