AWS System Manager

Get command

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください。

Get commands requested by users of the Amazon Web Services account.

Inputs

フィールド

種類

説明

region [required]

enum

default: us-east-1

commandId

string

The unique identifier for an existing command.

Outputs

Expand All

フィールド

種類

説明

command [required]

object

CommandId

string

A unique identifier for this command.

DocumentName

string

The name of the document requested for execution.

DocumentVersion

string

The Systems Manager document (SSM document) version.

Comment

string

User-specified information about the command, such as a brief description of what the command should do.

ExpiresAfter

date-time

If a command expires, it changes status to DeliveryTimedOut for all invocations that have the status InProgress, Pending, or Delayed. ExpiresAfter is calculated based on the total timeout for the overall command. For more information, see Understanding command timeout values in the Amazon Web Services Systems Manager User Guide.

Parameters

object

The parameter values to be inserted in the document when running the command.

InstanceIds

[string]

The managed node IDs against which this command was requested.

Targets

[object]

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

Key

string

User-defined criteria for sending commands that target managed nodes that meet the criteria.

Values

[string]

User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer. Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

RequestedDateTime

date-time

The date and time the command was requested.

Status

string

The status of the command.

StatusDetails

string

A detailed status of the command execution. StatusDetails includes more information than Status because it includes states resulting from error and concurrency control parameters. StatusDetails can show different results than Status. For more information about these statuses, see Understanding command statuses in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one of the following values:

  • Pending: The command hasn't been sent to any managed nodes.
  • In Progress: The command has been sent to at least one managed node but hasn't reached a final state on all managed nodes.
  • Success: The command successfully ran on all invocations. This is a terminal state.
  • Delivery Timed Out: The value of MaxErrors or more command invocations shows a status of Delivery Timed Out. This is a terminal state.
  • Execution Timed Out: The value of MaxErrors or more command invocations shows a status of Execution Timed Out. This is a terminal state.
  • Failed: The value of MaxErrors or more command invocations shows a status of Failed. This is a terminal state.
  • Incomplete: The command was attempted on all managed nodes and one or more invocations doesn't have a value of Success but not enough invocations failed for the status to be Failed. This is a terminal state.
  • Cancelled: The command was terminated before it was completed. This is a terminal state.
  • Rate Exceeded: The number of managed nodes targeted by the command exceeded the account limit for pending invocations. The system has canceled the command before running it on any managed node. This is a terminal state.

OutputS3Region

string

(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

OutputS3BucketName

string

The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.

OutputS3KeyPrefix

string

The S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.

MaxConcurrency

string

The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number of managed nodes, such as 10, or a percentage of nodes, such as 10%. The default value is 50. For more information about how to use MaxConcurrency, see Amazon Web Services Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide.

MaxErrors

string

The maximum number of errors allowed before the system stops sending the command to additional targets. You can specify a number of errors, such as 10, or a percentage or errors, such as 10%. The default value is 0. For more information about how to use MaxErrors, see Amazon Web Services Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide.

TargetCount

number

The number of targets for the command.

CompletedCount

number

The number of targets for which the command invocation reached a terminal state. Terminal states include the following: Success, Failed, Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or Undeliverable.

ErrorCount

number

The number of targets for which the status is Failed or Execution Timed Out.

DeliveryTimedOutCount

number

The number of targets for which the status is Delivery Timed Out.

ServiceRole

string

The Identity and Access Management (IAM) service role that Run Command, a capability of Amazon Web Services Systems Manager, uses to act on your behalf when sending notifications about command status changes.

NotificationConfig

object

Configurations for sending notifications about command status changes.

NotificationArn

string

An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

NotificationEvents

[string]

The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.

NotificationType

string

The type of notification.

  • Command: Receive notification when the status of a command changes.
  • Invocation: For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

CloudWatchOutputConfig

object

Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.

CloudWatchLogGroupName

string

The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format: aws/ssm/SystemsManagerDocumentName

CloudWatchOutputEnabled

boolean

Enables Systems Manager to send command output to CloudWatch Logs.

TimeoutSeconds

number

The TimeoutSeconds value specified for a command.

AlarmConfiguration

object

The details for the CloudWatch alarm applied to your command.

IgnorePollAlarmFailure

boolean

When this value is true, your automation or command continues to run in cases where we can’t retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.

Alarms [required]

[object]

The name of the CloudWatch alarm specified in the configuration.

Name [required]

string

The name of your CloudWatch alarm.

TriggeredAlarms

[object]

The CloudWatch alarm that was invoked by the command.

Name [required]

string

The name of your CloudWatch alarm.

State [required]

string

The state of your CloudWatch alarm.

amzRequestId [required]

string