Amazon Simple Systems Manager (SSM)

2018/07/11 - Amazon Simple Systems Manager (SSM) - 2 updated api methods

Changes  Support Conditional Branching OnFailure for SSM Automation

DescribeAutomationStepExecutions (updated) Link ¶
Changes (response)
{'StepExecutions': {'IsCritical': 'boolean',
                    'IsEnd': 'boolean',
                    'NextStep': 'string',
                    'ValidNextSteps': ['string']}}

Information about all active and terminated step executions in an Automation workflow.

See also: AWS API Documentation

Request Syntax

client.describe_automation_step_executions(
    AutomationExecutionId='string',
    Filters=[
        {
            'Key': 'StartTimeBefore'|'StartTimeAfter'|'StepExecutionStatus'|'StepExecutionId'|'StepName'|'Action',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123,
    ReverseOrder=True|False
)
type AutomationExecutionId

string

param AutomationExecutionId

[REQUIRED]

The Automation execution ID for which you want step execution descriptions.

type Filters

list

param Filters

One or more filters to limit the number of step executions returned by the request.

  • (dict) --

    A filter to limit the amount of step execution information returned by the call.

    • Key (string) -- [REQUIRED]

      One or more keys to limit the results. Valid filter keys include the following: StepName, Action, StepExecutionId, StepExecutionStatus, StartTimeBefore, StartTimeAfter.

    • Values (list) -- [REQUIRED]

      The values of the filter key.

      • (string) --

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type ReverseOrder

boolean

param ReverseOrder

A boolean that indicates whether to list step executions in reverse order by start time. The default value is false.

rtype

dict

returns

Response Syntax

{
    'StepExecutions': [
        {
            'StepName': 'string',
            'Action': 'string',
            'TimeoutSeconds': 123,
            'OnFailure': 'string',
            'MaxAttempts': 123,
            'ExecutionStartTime': datetime(2015, 1, 1),
            'ExecutionEndTime': datetime(2015, 1, 1),
            'StepStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed',
            'ResponseCode': 'string',
            'Inputs': {
                'string': 'string'
            },
            'Outputs': {
                'string': [
                    'string',
                ]
            },
            'Response': 'string',
            'FailureMessage': 'string',
            'FailureDetails': {
                'FailureStage': 'string',
                'FailureType': 'string',
                'Details': {
                    'string': [
                        'string',
                    ]
                }
            },
            'StepExecutionId': 'string',
            'OverriddenParameters': {
                'string': [
                    'string',
                ]
            },
            'IsEnd': True|False,
            'NextStep': 'string',
            'IsCritical': True|False,
            'ValidNextSteps': [
                'string',
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • StepExecutions (list) --

      A list of details about the current state of all steps that make up an execution.

      • (dict) --

        Detailed information about an the execution state of an Automation step.

        • StepName (string) --

          The name of this execution step.

        • Action (string) --

          The action this step performs. The action determines the behavior of the step.

        • TimeoutSeconds (integer) --

          The timeout seconds of the step.

        • OnFailure (string) --

          The action to take if the step fails. The default value is Abort.

        • MaxAttempts (integer) --

          The maximum number of tries to run the action of the step. The default value is 1.

        • ExecutionStartTime (datetime) --

          If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field is not populated.

        • ExecutionEndTime (datetime) --

          If a step has finished execution, this contains the time the execution ended. If the step has not yet concluded, this field is not populated.

        • StepStatus (string) --

          The execution status for this step. Valid values include: Pending, InProgress, Success, Cancelled, Failed, and TimedOut.

        • ResponseCode (string) --

          The response code returned by the execution of the step.

        • Inputs (dict) --

          Fully-resolved values passed into the step before execution.

          • (string) --

            • (string) --

        • Outputs (dict) --

          Returned values from the execution of the step.

          • (string) --

            • (list) --

              • (string) --

        • Response (string) --

          A message associated with the response code for an execution.

        • FailureMessage (string) --

          If a step failed, this message explains why the execution failed.

        • FailureDetails (dict) --

          Information about the Automation failure.

          • FailureStage (string) --

            The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.

          • FailureType (string) --

            The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.

          • Details (dict) --

            Detailed information about the Automation step failure.

            • (string) --

              • (list) --

                • (string) --

        • StepExecutionId (string) --

          The unique ID of a step execution.

        • OverriddenParameters (dict) --

          A user-specified list of parameters to override when executing a step.

          • (string) --

            • (list) --

              • (string) --

        • IsEnd (boolean) --

          Enable this option to stop an Automation execution at the end of a specific step. The Automation execution stops if the step execution failed or succeeded.

        • NextStep (string) --

          Specifies which step in an Automation to process next after successfully completing a step.

        • IsCritical (boolean) --

          Enable this option to designate a step as critical for the successful completion of the Automation. If a step with this designation fails, then Automation reports the final status of the Automation as Failed.

        • ValidNextSteps (list) --

          ValidNextSteps offer different strategies for managing an Automation workflow when a step finishes. Automation dynamically processes ValidNextSteps when a step is completed. For example, you can specify Abort to stop the Automation when a step fails or Continue to ignore the failure of the current step and allow Automation to continue processing the next step. You can also specify ``step:step_name `` to jump to a designated step after a step succeeds. The result of the current step dynamically determines the ValidNextSteps. If a step finishes and no ValidNextStep is designated, then the Automation stops.

          • (string) --

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

GetAutomationExecution (updated) Link ¶
Changes (response)
{'AutomationExecution': {'StepExecutions': {'IsCritical': 'boolean',
                                            'IsEnd': 'boolean',
                                            'NextStep': 'string',
                                            'ValidNextSteps': ['string']}}}

Get detailed information about a particular Automation execution.

See also: AWS API Documentation

Request Syntax

client.get_automation_execution(
    AutomationExecutionId='string'
)
type AutomationExecutionId

string

param AutomationExecutionId

[REQUIRED]

The unique identifier for an existing automation execution to examine. The execution ID is returned by StartAutomationExecution when the execution of an Automation document is initiated.

rtype

dict

returns

Response Syntax

{
    'AutomationExecution': {
        'AutomationExecutionId': 'string',
        'DocumentName': 'string',
        'DocumentVersion': 'string',
        'ExecutionStartTime': datetime(2015, 1, 1),
        'ExecutionEndTime': datetime(2015, 1, 1),
        'AutomationExecutionStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed',
        'StepExecutions': [
            {
                'StepName': 'string',
                'Action': 'string',
                'TimeoutSeconds': 123,
                'OnFailure': 'string',
                'MaxAttempts': 123,
                'ExecutionStartTime': datetime(2015, 1, 1),
                'ExecutionEndTime': datetime(2015, 1, 1),
                'StepStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed',
                'ResponseCode': 'string',
                'Inputs': {
                    'string': 'string'
                },
                'Outputs': {
                    'string': [
                        'string',
                    ]
                },
                'Response': 'string',
                'FailureMessage': 'string',
                'FailureDetails': {
                    'FailureStage': 'string',
                    'FailureType': 'string',
                    'Details': {
                        'string': [
                            'string',
                        ]
                    }
                },
                'StepExecutionId': 'string',
                'OverriddenParameters': {
                    'string': [
                        'string',
                    ]
                },
                'IsEnd': True|False,
                'NextStep': 'string',
                'IsCritical': True|False,
                'ValidNextSteps': [
                    'string',
                ]
            },
        ],
        'StepExecutionsTruncated': True|False,
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'Outputs': {
            'string': [
                'string',
            ]
        },
        'FailureMessage': 'string',
        'Mode': 'Auto'|'Interactive',
        'ParentAutomationExecutionId': 'string',
        'ExecutedBy': 'string',
        'CurrentStepName': 'string',
        'CurrentAction': 'string',
        'TargetParameterName': 'string',
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'ResolvedTargets': {
            'ParameterValues': [
                'string',
            ],
            'Truncated': True|False
        },
        'MaxConcurrency': 'string',
        'MaxErrors': 'string',
        'Target': 'string'
    }
}

Response Structure

  • (dict) --

    • AutomationExecution (dict) --

      Detailed information about the current state of an automation execution.

      • AutomationExecutionId (string) --

        The execution ID.

      • DocumentName (string) --

        The name of the Automation document used during the execution.

      • DocumentVersion (string) --

        The version of the document to use during execution.

      • ExecutionStartTime (datetime) --

        The time the execution started.

      • ExecutionEndTime (datetime) --

        The time the execution finished.

      • AutomationExecutionStatus (string) --

        The execution status of the Automation.

      • StepExecutions (list) --

        A list of details about the current state of all steps that comprise an execution. An Automation document contains a list of steps that are executed in order.

        • (dict) --

          Detailed information about an the execution state of an Automation step.

          • StepName (string) --

            The name of this execution step.

          • Action (string) --

            The action this step performs. The action determines the behavior of the step.

          • TimeoutSeconds (integer) --

            The timeout seconds of the step.

          • OnFailure (string) --

            The action to take if the step fails. The default value is Abort.

          • MaxAttempts (integer) --

            The maximum number of tries to run the action of the step. The default value is 1.

          • ExecutionStartTime (datetime) --

            If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field is not populated.

          • ExecutionEndTime (datetime) --

            If a step has finished execution, this contains the time the execution ended. If the step has not yet concluded, this field is not populated.

          • StepStatus (string) --

            The execution status for this step. Valid values include: Pending, InProgress, Success, Cancelled, Failed, and TimedOut.

          • ResponseCode (string) --

            The response code returned by the execution of the step.

          • Inputs (dict) --

            Fully-resolved values passed into the step before execution.

            • (string) --

              • (string) --

          • Outputs (dict) --

            Returned values from the execution of the step.

            • (string) --

              • (list) --

                • (string) --

          • Response (string) --

            A message associated with the response code for an execution.

          • FailureMessage (string) --

            If a step failed, this message explains why the execution failed.

          • FailureDetails (dict) --

            Information about the Automation failure.

            • FailureStage (string) --

              The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.

            • FailureType (string) --

              The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.

            • Details (dict) --

              Detailed information about the Automation step failure.

              • (string) --

                • (list) --

                  • (string) --

          • StepExecutionId (string) --

            The unique ID of a step execution.

          • OverriddenParameters (dict) --

            A user-specified list of parameters to override when executing a step.

            • (string) --

              • (list) --

                • (string) --

          • IsEnd (boolean) --

            Enable this option to stop an Automation execution at the end of a specific step. The Automation execution stops if the step execution failed or succeeded.

          • NextStep (string) --

            Specifies which step in an Automation to process next after successfully completing a step.

          • IsCritical (boolean) --

            Enable this option to designate a step as critical for the successful completion of the Automation. If a step with this designation fails, then Automation reports the final status of the Automation as Failed.

          • ValidNextSteps (list) --

            ValidNextSteps offer different strategies for managing an Automation workflow when a step finishes. Automation dynamically processes ValidNextSteps when a step is completed. For example, you can specify Abort to stop the Automation when a step fails or Continue to ignore the failure of the current step and allow Automation to continue processing the next step. You can also specify ``step:step_name `` to jump to a designated step after a step succeeds. The result of the current step dynamically determines the ValidNextSteps. If a step finishes and no ValidNextStep is designated, then the Automation stops.

            • (string) --

      • StepExecutionsTruncated (boolean) --

        A boolean value that indicates if the response contains the full list of the Automation step executions. If true, use the DescribeAutomationStepExecutions API action to get the full list of step executions.

      • Parameters (dict) --

        The key-value map of execution parameters, which were supplied when calling StartAutomationExecution.

        • (string) --

          • (list) --

            • (string) --

      • Outputs (dict) --

        The list of execution outputs as defined in the automation document.

        • (string) --

          • (list) --

            • (string) --

      • FailureMessage (string) --

        A message describing why an execution has failed, if the status is set to Failed.

      • Mode (string) --

        The automation execution mode.

      • ParentAutomationExecutionId (string) --

        The AutomationExecutionId of the parent automation.

      • ExecutedBy (string) --

        The Amazon Resource Name (ARN) of the user who executed the automation.

      • CurrentStepName (string) --

        The name of the currently executing step.

      • CurrentAction (string) --

        The action of the currently executing step.

      • TargetParameterName (string) --

        The parameter name.

      • Targets (list) --

        The specified targets.

        • (dict) --

          An array of search criteria that targets instances using a Key,Value combination that you specify. Targets is required if you don't provide one or more instance IDs in the call.

          • Key (string) --

            User-defined criteria for sending commands that target instances that meet the criteria. Key can be tag:<Amazon EC2 tag> or InstanceIds. For more information about how to send commands that target instances using Key,Value parameters, see Targeting Multiple Instances in the AWS Systems Manager User Guide .

          • Values (list) --

            User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to execute a command on instances that include Amazon EC2 tags of ServerRole,WebServer. For more information about how to send commands that target instances using Key,Value parameters, see Sending Commands to a Fleet in the AWS Systems Manager User Guide .

            • (string) --

      • ResolvedTargets (dict) --

        A list of resolved targets in the rate control execution.

        • ParameterValues (list) --

          A list of parameter values sent to targets that resolved during the Automation execution.

          • (string) --

        • Truncated (boolean) --

          A boolean value indicating whether the resolved target list is truncated.

      • MaxConcurrency (string) --

        The MaxConcurrency value specified by the user when the execution started.

      • MaxErrors (string) --

        The MaxErrors value specified by the user when the execution started.

      • Target (string) --

        The target of the execution.