Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

ListCommandInvocations

An invocation is copy of a command sent to a specific instance. A command can apply to one or more instances. A command invocation applies to one instance. For example, if a user executes SendCommand against three instances, then a command invocation is created for each requested instance ID. ListCommandInvocations provide status about command execution.

Request Syntax

{
   "CommandId": "string",
   "Details": boolean,
   "Filters": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "InstanceId": "string",
   "MaxResults": number,
   "NextToken": "string"
}

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.

CommandId

(Optional) The invocations for a specific command ID.

Type: String

Length Constraints: Fixed length of 36.

Required: No

Details

(Optional) If set this returns the response of the command executions and any command output. By default this is set to False.

Type: Boolean

Required: No

Filters

(Optional) One or more filters. Use a filter to return a more specific list of results.

Type: Array of CommandFilter objects

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Required: No

InstanceId

(Optional) The command execution details for a specific instance ID.

Type: String

Pattern: (^i-(\w{8}|\w{17})$)|(^mi-\w{17}$)

Required: No

MaxResults

(Optional) 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: Integer

Valid Range: Minimum value of 1. Maximum value of 50.

Required: No

NextToken

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

Type: String

Required: No

Response Syntax

{
   "CommandInvocations": [ 
      { 
         "CommandId": "string",
         "CommandPlugins": [ 
            { 
               "Name": "string",
               "Output": "string",
               "OutputS3BucketName": "string",
               "OutputS3KeyPrefix": "string",
               "OutputS3Region": "string",
               "ResponseCode": number,
               "ResponseFinishDateTime": number,
               "ResponseStartDateTime": number,
               "StandardErrorUrl": "string",
               "StandardOutputUrl": "string",
               "Status": "string",
               "StatusDetails": "string"
            }
         ],
         "Comment": "string",
         "DocumentName": "string",
         "InstanceId": "string",
         "InstanceName": "string",
         "NotificationConfig": { 
            "NotificationArn": "string",
            "NotificationEvents": [ "string" ],
            "NotificationType": "string"
         },
         "RequestedDateTime": number,
         "ServiceRole": "string",
         "StandardErrorUrl": "string",
         "StandardOutputUrl": "string",
         "Status": "string",
         "StatusDetails": "string",
         "TraceOutput": "string"
      }
   ],
   "NextToken": "string"
}

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.

CommandInvocations

(Optional) A list of all invocations.

Type: Array of CommandInvocation objects

NextToken

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

Type: String

Errors

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

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

InvalidCommandId

HTTP Status Code: 400

InvalidFilterKey

The specified key is not valid.

HTTP Status Code: 400

InvalidInstanceId

The following problems can cause this exception:

You do not have permission to access the instance.

The SSM Agent is not running. On managed instances and Linux instances, verify that the SSM Agent is running. On EC2 Windows instances, verify that the EC2Config service is running.

The SSM Agent or EC2Config service is not registered to the SSM endpoint. Try reinstalling the SSM Agent or EC2Config service.

The instance is not in valid state. Valid states are: Running, Pending, Stopped, Stopping. Invalid states are: Shutting-down and Terminated.

HTTP Status Code: 400

InvalidNextToken

The specified token is not valid.

HTTP Status Code: 400

See Also

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