Verwendung von DescribeAutomationStepExecutions mit einer CLI - AWS-SDK-Codebeispiele

Weitere AWS-SDK-Beispiele sind im GitHub-Repository Beispiele für AWS Doc SDKs verfügbar.

Verwendung von DescribeAutomationStepExecutions mit einer CLI

Die folgenden Code-Beispiele zeigen, wie DescribeAutomationStepExecutions verwendet wird.

CLI
AWS CLI

Beispiel 1: So können Sie alle Schritte für eine Automatisierungsausführung beschreiben

Im folgenden describe-automation-step-executions-Beispiel werden Details zu den Schritten einer Automation-Ausführung gezeigt.

aws ssm describe-automation-step-executions \ --automation-execution-id 73c8eef8-f4ee-4a05-820c-e354fEXAMPLE

Ausgabe:

{ "StepExecutions": [ { "StepName": "startInstances", "Action": "aws:changeInstanceState", "ExecutionStartTime": 1583737234.134, "ExecutionEndTime": 1583737234.672, "StepStatus": "Success", "Inputs": { "DesiredState": "\"running\"", "InstanceIds": "[\"i-0cb99161f6EXAMPLE\"]" }, "Outputs": { "InstanceStates": [ "running" ] }, "StepExecutionId": "95e70479-cf20-4d80-8018-7e4e2EXAMPLE", "OverriddenParameters": {} } ] }

Beispiel 2: So können Sie einen bestimmten Schritt für eine Automatisierungsausführung beschreiben

Im folgenden describe-automation-step-executions-Beispiel werden Details zu einem bestimmten Schritt einer Automation-Ausführung gezeigt.

aws ssm describe-automation-step-executions \ --automation-execution-id 73c8eef8-f4ee-4a05-820c-e354fEXAMPLE \ --filters Key=StepExecutionId,Values=95e70479-cf20-4d80-8018-7e4e2EXAMPLE

Weitere Informationen finden Sie unter Schrittweises Ausführen eines Automation-Workflows (Befehlszeile) im AWS-Systems-Manager-Benutzerhandbuch.

PowerShell
Tools für PowerShell V4

Beispiel 1: In diesem Beispiel werden Informationen über alle aktiven und beendeten Schrittausführungen in einem Automation-Workflow angezeigt.

Get-SSMAutomationStepExecution -AutomationExecutionId e1d2bad3-4567-8901-ae23-456c7c8901be | Select-Object StepName, Action, StepStatus

Ausgabe:

StepName Action StepStatus -------- ------ ---------- LaunchInstance aws:runInstances Success OSCompatibilityCheck aws:runCommand Success RunPreUpdateScript aws:runCommand Success UpdateEC2Config aws:runCommand Cancelled UpdateSSMAgent aws:runCommand Pending UpdateAWSPVDriver aws:runCommand Pending UpdateAWSEnaNetworkDriver aws:runCommand Pending UpdateAWSNVMe aws:runCommand Pending InstallWindowsUpdates aws:runCommand Pending RunPostUpdateScript aws:runCommand Pending RunSysprepGeneralize aws:runCommand Pending StopInstance aws:changeInstanceState Pending CreateImage aws:createImage Pending TerminateInstance aws:changeInstanceState Pending
Tools für PowerShell V5

Beispiel 1: In diesem Beispiel werden Informationen über alle aktiven und beendeten Schrittausführungen in einem Automation-Workflow angezeigt.

Get-SSMAutomationStepExecution -AutomationExecutionId e1d2bad3-4567-8901-ae23-456c7c8901be | Select-Object StepName, Action, StepStatus

Ausgabe:

StepName Action StepStatus -------- ------ ---------- LaunchInstance aws:runInstances Success OSCompatibilityCheck aws:runCommand Success RunPreUpdateScript aws:runCommand Success UpdateEC2Config aws:runCommand Cancelled UpdateSSMAgent aws:runCommand Pending UpdateAWSPVDriver aws:runCommand Pending UpdateAWSEnaNetworkDriver aws:runCommand Pending UpdateAWSNVMe aws:runCommand Pending InstallWindowsUpdates aws:runCommand Pending RunPostUpdateScript aws:runCommand Pending RunSysprepGeneralize aws:runCommand Pending StopInstance aws:changeInstanceState Pending CreateImage aws:createImage Pending TerminateInstance aws:changeInstanceState Pending