AWS CodePipeline

2020/01/21 - AWS CodePipeline - 1 new 4 updated api methods

Changes  AWS CodePipeline enables an ability to stop pipeline executions.

StopPipelineExecution (new) Link ¶

Stops the specified pipeline execution. You choose to either stop the pipeline execution by completing in-progress actions without starting subsequent actions, or by abandoning in-progress actions. While completing or abandoning in-progress actions, the pipeline execution is in a Stopping state. After all in-progress actions are completed or abandoned, the pipeline execution is in a Stopped state.

See also: AWS API Documentation

Request Syntax

client.stop_pipeline_execution(
    pipelineName='string',
    pipelineExecutionId='string',
    abandon=True|False,
    reason='string'
)
type pipelineName

string

param pipelineName

[REQUIRED]

The name of the pipeline to stop.

type pipelineExecutionId

string

param pipelineExecutionId

[REQUIRED]

The ID of the pipeline execution to be stopped in the current stage. Use the GetPipelineState action to retrieve the current pipelineExecutionId.

type abandon

boolean

param abandon

Use this option to stop the pipeline execution by abandoning, rather than finishing, in-progress actions.

Note

This option can lead to failed or out-of-sequence tasks.

type reason

string

param reason

Use this option to enter comments, such as the reason the pipeline was stopped.

rtype

dict

returns

Response Syntax

{
    'pipelineExecutionId': 'string'
}

Response Structure

  • (dict) --

    • pipelineExecutionId (string) --

      The unique system-generated ID of the pipeline execution that was stopped.

GetPipelineExecution (updated) Link ¶
Changes (response)
{'pipelineExecution': {'status': {'Stopping', 'Stopped'}}}

Returns information about an execution of a pipeline, including details about artifacts, the pipeline execution ID, and the name, version, and status of the pipeline.

See also: AWS API Documentation

Request Syntax

client.get_pipeline_execution(
    pipelineName='string',
    pipelineExecutionId='string'
)
type pipelineName

string

param pipelineName

[REQUIRED]

The name of the pipeline about which you want to get execution details.

type pipelineExecutionId

string

param pipelineExecutionId

[REQUIRED]

The ID of the pipeline execution about which you want to get execution details.

rtype

dict

returns

Response Syntax

{
    'pipelineExecution': {
        'pipelineName': 'string',
        'pipelineVersion': 123,
        'pipelineExecutionId': 'string',
        'status': 'InProgress'|'Stopped'|'Stopping'|'Succeeded'|'Superseded'|'Failed',
        'artifactRevisions': [
            {
                'name': 'string',
                'revisionId': 'string',
                'revisionChangeIdentifier': 'string',
                'revisionSummary': 'string',
                'created': datetime(2015, 1, 1),
                'revisionUrl': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Represents the output of a GetPipelineExecution action.

    • pipelineExecution (dict) --

      Represents information about the execution of a pipeline.

      • pipelineName (string) --

        The name of the pipeline with the specified pipeline execution.

      • pipelineVersion (integer) --

        The version number of the pipeline with the specified pipeline execution.

      • pipelineExecutionId (string) --

        The ID of the pipeline execution.

      • status (string) --

        The status of the pipeline execution.

        • InProgress: The pipeline execution is currently running.

        • Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions .

        • Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected stop mode, the execution is either completing or abandoning in-progress actions. For more information, see Stopped Executions .

        • Succeeded: The pipeline execution was completed successfully.

        • Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline execution advanced and continued through the pipeline instead. For more information, see Superseded Executions .

        • Failed: The pipeline execution was not completed successfully.

      • artifactRevisions (list) --

        A list of ArtifactRevision objects included in a pipeline execution.

        • (dict) --

          Represents revision details of an artifact.

          • name (string) --

            The name of an artifact. This name might be system-generated, such as "MyApp", or defined by the user when an action is created.

          • revisionId (string) --

            The revision ID of the artifact.

          • revisionChangeIdentifier (string) --

            An additional identifier for a revision, such as a commit date or, for artifacts stored in Amazon S3 buckets, the ETag value.

          • revisionSummary (string) --

            Summary information about the most recent revision of the artifact. For GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3 buckets or actions, the user-provided content of a codepipeline-artifact-revision-summary key specified in the object metadata.

          • created (datetime) --

            The date and time when the most recent revision of the artifact was created, in timestamp format.

          • revisionUrl (string) --

            The commit ID for the artifact revision. For artifacts stored in GitHub or AWS CodeCommit repositories, the commit ID is linked to a commit details page.

GetPipelineState (updated) Link ¶
Changes (response)
{'stageStates': {'actionStates': {'latestExecution': {'status': {'Abandoned'}}},
                 'latestExecution': {'status': {'Stopping', 'Stopped'}}}}

Returns information about the state of a pipeline, including the stages and actions.

Note

Values returned in the revisionId and revisionUrl fields indicate the source revision information, such as the commit ID, for the current state.

See also: AWS API Documentation

Request Syntax

client.get_pipeline_state(
    name='string'
)
type name

string

param name

[REQUIRED]

The name of the pipeline about which you want to get information.

rtype

dict

returns

Response Syntax

{
    'pipelineName': 'string',
    'pipelineVersion': 123,
    'stageStates': [
        {
            'stageName': 'string',
            'inboundTransitionState': {
                'enabled': True|False,
                'lastChangedBy': 'string',
                'lastChangedAt': datetime(2015, 1, 1),
                'disabledReason': 'string'
            },
            'actionStates': [
                {
                    'actionName': 'string',
                    'currentRevision': {
                        'revisionId': 'string',
                        'revisionChangeId': 'string',
                        'created': datetime(2015, 1, 1)
                    },
                    'latestExecution': {
                        'status': 'InProgress'|'Abandoned'|'Succeeded'|'Failed',
                        'summary': 'string',
                        'lastStatusChange': datetime(2015, 1, 1),
                        'token': 'string',
                        'lastUpdatedBy': 'string',
                        'externalExecutionId': 'string',
                        'externalExecutionUrl': 'string',
                        'percentComplete': 123,
                        'errorDetails': {
                            'code': 'string',
                            'message': 'string'
                        }
                    },
                    'entityUrl': 'string',
                    'revisionUrl': 'string'
                },
            ],
            'latestExecution': {
                'pipelineExecutionId': 'string',
                'status': 'InProgress'|'Failed'|'Stopped'|'Stopping'|'Succeeded'
            }
        },
    ],
    'created': datetime(2015, 1, 1),
    'updated': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    Represents the output of a GetPipelineState action.

    • pipelineName (string) --

      The name of the pipeline for which you want to get the state.

    • pipelineVersion (integer) --

      The version number of the pipeline.

      Note

      A newly created pipeline is always assigned a version number of 1 .

    • stageStates (list) --

      A list of the pipeline stage output information, including stage name, state, most recent run details, whether the stage is disabled, and other data.

      • (dict) --

        Represents information about the state of the stage.

        • stageName (string) --

          The name of the stage.

        • inboundTransitionState (dict) --

          The state of the inbound transition, which is either enabled or disabled.

          • enabled (boolean) --

            Whether the transition between stages is enabled (true) or disabled (false).

          • lastChangedBy (string) --

            The ID of the user who last changed the transition state.

          • lastChangedAt (datetime) --

            The timestamp when the transition state was last changed.

          • disabledReason (string) --

            The user-specified reason why the transition between two stages of a pipeline was disabled.

        • actionStates (list) --

          The state of the stage.

          • (dict) --

            Represents information about the state of an action.

            • actionName (string) --

              The name of the action.

            • currentRevision (dict) --

              Represents information about the version (or revision) of an action.

              • revisionId (string) --

                The system-generated unique ID that identifies the revision number of the action.

              • revisionChangeId (string) --

                The unique identifier of the change that set the state to this revision (for example, a deployment ID or timestamp).

              • created (datetime) --

                The date and time when the most recent version of the action was created, in timestamp format.

            • latestExecution (dict) --

              Represents information about the run of an action.

              • status (string) --

                The status of the action, or for a completed action, the last status of the action.

              • summary (string) --

                A summary of the run of the action.

              • lastStatusChange (datetime) --

                The last status change of the action.

              • token (string) --

                The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the GetPipelineState command. It is used to validate that the approval request corresponding to this token is still valid.

              • lastUpdatedBy (string) --

                The ARN of the user who last changed the pipeline.

              • externalExecutionId (string) --

                The external ID of the run of the action.

              • externalExecutionUrl (string) --

                The URL of a resource external to AWS that is used when running the action (for example, an external repository URL).

              • percentComplete (integer) --

                A percentage of completeness of the action as it runs.

              • errorDetails (dict) --

                The details of an error returned by a URL external to AWS.

                • code (string) --

                  The system ID or number code of the error.

                • message (string) --

                  The text of the error message.

            • entityUrl (string) --

              A URL link for more information about the state of the action, such as a deployment group details page.

            • revisionUrl (string) --

              A URL link for more information about the revision, such as a commit details page.

        • latestExecution (dict) --

          Information about the latest execution in the stage, including its ID and status.

          • pipelineExecutionId (string) --

            The ID of the pipeline execution associated with the stage.

          • status (string) --

            The status of the stage, or for a completed stage, the last status of the stage.

    • created (datetime) --

      The date and time the pipeline was created, in timestamp format.

    • updated (datetime) --

      The date and time the pipeline was last updated, in timestamp format.

ListActionExecutions (updated) Link ¶
Changes (response)
{'actionExecutionDetails': {'status': {'Abandoned'}}}

Lists the action executions that have occurred in a pipeline.

See also: AWS API Documentation

Request Syntax

client.list_action_executions(
    pipelineName='string',
    filter={
        'pipelineExecutionId': 'string'
    },
    maxResults=123,
    nextToken='string'
)
type pipelineName

string

param pipelineName

[REQUIRED]

The name of the pipeline for which you want to list action execution history.

type filter

dict

param filter

Input information used to filter action execution history.

  • pipelineExecutionId (string) --

    The pipeline execution ID used to filter action execution history.

type maxResults

integer

param maxResults

The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value. Action execution history is retained for up to 12 months, based on action execution start times. Default value is 100.

Note

Detailed execution history is available for executions run on or after February 21, 2019.

type nextToken

string

param nextToken

The token that was returned from the previous ListActionExecutions call, which can be used to return the next set of action executions in the list.

rtype

dict

returns

Response Syntax

{
    'actionExecutionDetails': [
        {
            'pipelineExecutionId': 'string',
            'actionExecutionId': 'string',
            'pipelineVersion': 123,
            'stageName': 'string',
            'actionName': 'string',
            'startTime': datetime(2015, 1, 1),
            'lastUpdateTime': datetime(2015, 1, 1),
            'status': 'InProgress'|'Abandoned'|'Succeeded'|'Failed',
            'input': {
                'actionTypeId': {
                    'category': 'Source'|'Build'|'Deploy'|'Test'|'Invoke'|'Approval',
                    'owner': 'AWS'|'ThirdParty'|'Custom',
                    'provider': 'string',
                    'version': 'string'
                },
                'configuration': {
                    'string': 'string'
                },
                'resolvedConfiguration': {
                    'string': 'string'
                },
                'roleArn': 'string',
                'region': 'string',
                'inputArtifacts': [
                    {
                        'name': 'string',
                        's3location': {
                            'bucket': 'string',
                            'key': 'string'
                        }
                    },
                ],
                'namespace': 'string'
            },
            'output': {
                'outputArtifacts': [
                    {
                        'name': 'string',
                        's3location': {
                            'bucket': 'string',
                            'key': 'string'
                        }
                    },
                ],
                'executionResult': {
                    'externalExecutionId': 'string',
                    'externalExecutionSummary': 'string',
                    'externalExecutionUrl': 'string'
                },
                'outputVariables': {
                    'string': 'string'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • actionExecutionDetails (list) --

      The details for a list of recent executions, such as action execution ID.

      • (dict) --

        Returns information about an execution of an action, including the action execution ID, and the name, version, and timing of the action.

        • pipelineExecutionId (string) --

          The pipeline execution ID for the action execution.

        • actionExecutionId (string) --

          The action execution ID.

        • pipelineVersion (integer) --

          The version of the pipeline where the action was run.

        • stageName (string) --

          The name of the stage that contains the action.

        • actionName (string) --

          The name of the action.

        • startTime (datetime) --

          The start time of the action execution.

        • lastUpdateTime (datetime) --

          The last update time of the action execution.

        • status (string) --

          The status of the action execution. Status categories are InProgress , Succeeded , and Failed .

        • input (dict) --

          Input details for the action execution, such as role ARN, Region, and input artifacts.

          • actionTypeId (dict) --

            Represents information about an action type.

            • category (string) --

              A category defines what kind of action can be taken in the stage, and constrains the provider type for the action. Valid categories are limited to one of the following values.

            • owner (string) --

              The creator of the action being called.

            • provider (string) --

              The provider of the service being called by the action. Valid providers are determined by the action category. For example, an action in the Deploy category type might have a provider of AWS CodeDeploy, which would be specified as CodeDeploy. For more information, see Valid Action Types and Providers in CodePipeline .

            • version (string) --

              A string that describes the action version.

          • configuration (dict) --

            Configuration data for an action execution.

            • (string) --

              • (string) --

          • resolvedConfiguration (dict) --

            Configuration data for an action execution with all variable references replaced with their real values for the execution.

            • (string) --

              • (string) --

          • roleArn (string) --

            The ARN of the IAM service role that performs the declared action. This is assumed through the roleArn for the pipeline.

          • region (string) --

            The AWS Region for the action, such as us-east-1.

          • inputArtifacts (list) --

            Details of input artifacts of the action that correspond to the action execution.

            • (dict) --

              Artifact details for the action execution, such as the artifact location.

              • name (string) --

                The artifact object name for the action execution.

              • s3location (dict) --

                The Amazon S3 artifact location for the action execution.

                • bucket (string) --

                  The Amazon S3 artifact bucket for an action's artifacts.

                • key (string) --

                  The artifact name.

          • namespace (string) --

            The variable namespace associated with the action. All variables produced as output by this action fall under this namespace.

        • output (dict) --

          Output details for the action execution, such as the action execution result.

          • outputArtifacts (list) --

            Details of output artifacts of the action that correspond to the action execution.

            • (dict) --

              Artifact details for the action execution, such as the artifact location.

              • name (string) --

                The artifact object name for the action execution.

              • s3location (dict) --

                The Amazon S3 artifact location for the action execution.

                • bucket (string) --

                  The Amazon S3 artifact bucket for an action's artifacts.

                • key (string) --

                  The artifact name.

          • executionResult (dict) --

            Execution result information listed in the output details for an action execution.

            • externalExecutionId (string) --

              The action provider's external ID for the action execution.

            • externalExecutionSummary (string) --

              The action provider's summary for the action execution.

            • externalExecutionUrl (string) --

              The deepest external link to the external resource (for example, a repository URL or deployment endpoint) that is used when running the action.

          • outputVariables (dict) --

            The outputVariables field shows the key-value pairs that were output as part of that execution.

            • (string) --

              • (string) --

    • nextToken (string) --

      If the amount of returned information is significantly large, an identifier is also returned and can be used in a subsequent ListActionExecutions call to return the next set of action executions in the list.

ListPipelineExecutions (updated) Link ¶
Changes (response)
{'pipelineExecutionSummaries': {'status': {'Stopping', 'Stopped'},
                                'stopTrigger': {'reason': 'string'}}}

Gets a summary of the most recent executions for a pipeline.

See also: AWS API Documentation

Request Syntax

client.list_pipeline_executions(
    pipelineName='string',
    maxResults=123,
    nextToken='string'
)
type pipelineName

string

param pipelineName

[REQUIRED]

The name of the pipeline for which you want to get execution summary information.

type maxResults

integer

param maxResults

The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value. Pipeline history is limited to the most recent 12 months, based on pipeline execution start times. Default value is 100.

type nextToken

string

param nextToken

The token that was returned from the previous ListPipelineExecutions call, which can be used to return the next set of pipeline executions in the list.

rtype

dict

returns

Response Syntax

{
    'pipelineExecutionSummaries': [
        {
            'pipelineExecutionId': 'string',
            'status': 'InProgress'|'Stopped'|'Stopping'|'Succeeded'|'Superseded'|'Failed',
            'startTime': datetime(2015, 1, 1),
            'lastUpdateTime': datetime(2015, 1, 1),
            'sourceRevisions': [
                {
                    'actionName': 'string',
                    'revisionId': 'string',
                    'revisionSummary': 'string',
                    'revisionUrl': 'string'
                },
            ],
            'trigger': {
                'triggerType': 'CreatePipeline'|'StartPipelineExecution'|'PollForSourceChanges'|'Webhook'|'CloudWatchEvent'|'PutActionRevision',
                'triggerDetail': 'string'
            },
            'stopTrigger': {
                'reason': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a ListPipelineExecutions action.

    • pipelineExecutionSummaries (list) --

      A list of executions in the history of a pipeline.

      • (dict) --

        Summary information about a pipeline execution.

        • pipelineExecutionId (string) --

          The ID of the pipeline execution.

        • status (string) --

          The status of the pipeline execution.

          • InProgress: The pipeline execution is currently running.

          • Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions .

          • Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected stop mode, the execution is either completing or abandoning in-progress actions. For more information, see Stopped Executions .

          • Succeeded: The pipeline execution was completed successfully.

          • Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline execution advanced and continued through the pipeline instead. For more information, see Superseded Executions .

          • Failed: The pipeline execution was not completed successfully.

        • startTime (datetime) --

          The date and time when the pipeline execution began, in timestamp format.

        • lastUpdateTime (datetime) --

          The date and time of the last change to the pipeline execution, in timestamp format.

        • sourceRevisions (list) --

          A list of the source artifact revisions that initiated a pipeline execution.

          • (dict) --

            Information about the version (or revision) of a source artifact that initiated a pipeline execution.

            • actionName (string) --

              The name of the action that processed the revision to the source artifact.

            • revisionId (string) --

              The system-generated unique ID that identifies the revision number of the artifact.

            • revisionSummary (string) --

              Summary information about the most recent revision of the artifact. For GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3 buckets or actions, the user-provided content of a codepipeline-artifact-revision-summary key specified in the object metadata.

            • revisionUrl (string) --

              The commit ID for the artifact revision. For artifacts stored in GitHub or AWS CodeCommit repositories, the commit ID is linked to a commit details page.

        • trigger (dict) --

          The interaction or event that started a pipeline execution, such as automated change detection or a StartPipelineExecution API call.

          • triggerType (string) --

            The type of change-detection method, command, or user interaction that started a pipeline execution.

          • triggerDetail (string) --

            Detail related to the event that started a pipeline execution, such as the webhook ARN of the webhook that triggered the pipeline execution or the user ARN for a user-initiated start-pipeline-execution CLI command.

        • stopTrigger (dict) --

          The interaction that stopped a pipeline execution.

          • reason (string) --

            The user-specified reason the pipeline was stopped.

    • nextToken (string) --

      A token that can be used in the next ListPipelineExecutions call. To view all items in the list, continue to call this operation with each subsequent token until no more nextToken values are returned.