Class Command
- java.lang.Object
-
- software.amazon.awssdk.services.ssm.model.Command
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<Command.Builder,Command>
@Generated("software.amazon.awssdk:codegen") public final class Command extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Command.Builder,Command>
Describes a command request.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Command.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AlarmConfiguration
alarmConfiguration()
The details for the CloudWatch alarm applied to your command.static Command.Builder
builder()
CloudWatchOutputConfig
cloudWatchOutputConfig()
Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.String
commandId()
A unique identifier for this command.String
comment()
User-specified information about the command, such as a brief description of what the command should do.Integer
completedCount()
The number of targets for which the command invocation reached a terminal state.Integer
deliveryTimedOutCount()
The number of targets for which the status is Delivery Timed Out.String
documentName()
The name of the document requested for execution.String
documentVersion()
The Systems Manager document (SSM document) version.boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
Integer
errorCount()
The number of targets for which the status is Failed or Execution Timed Out.Instant
expiresAfter()
If a command expires, it changes status toDeliveryTimedOut
for all invocations that have the statusInProgress
,Pending
, orDelayed
.<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
int
hashCode()
boolean
hasInstanceIds()
For responses, this returns true if the service returned a value for the InstanceIds property.boolean
hasParameters()
For responses, this returns true if the service returned a value for the Parameters property.boolean
hasTargets()
For responses, this returns true if the service returned a value for the Targets property.boolean
hasTriggeredAlarms()
For responses, this returns true if the service returned a value for the TriggeredAlarms property.List<String>
instanceIds()
The managed node IDs against which this command was requested.String
maxConcurrency()
The maximum number of managed nodes that are allowed to run the command at the same time.String
maxErrors()
The maximum number of errors allowed before the system stops sending the command to additional targets.NotificationConfig
notificationConfig()
Configurations for sending notifications about command status changes.String
outputS3BucketName()
The S3 bucket where the responses to the command executions should be stored.String
outputS3KeyPrefix()
The S3 directory path inside the bucket where the responses to the command executions should be stored.String
outputS3Region()
(Deprecated) You can no longer specify this parameter.Map<String,List<String>>
parameters()
The parameter values to be inserted in the document when running the command.Instant
requestedDateTime()
The date and time the command was requested.List<SdkField<?>>
sdkFields()
static Class<? extends Command.Builder>
serializableBuilderClass()
String
serviceRole()
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.CommandStatus
status()
The status of the command.String
statusAsString()
The status of the command.String
statusDetails()
A detailed status of the command execution.Integer
targetCount()
The number of targets for the command.List<Target>
targets()
An array of search criteria that targets managed nodes using a Key,Value combination that you specify.Integer
timeoutSeconds()
TheTimeoutSeconds
value specified for a command.Command.Builder
toBuilder()
String
toString()
Returns a string representation of this object.List<AlarmStateInformation>
triggeredAlarms()
The CloudWatch alarm that was invoked by the command.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
commandId
public final String commandId()
A unique identifier for this command.
- Returns:
- A unique identifier for this command.
-
documentName
public final String documentName()
The name of the document requested for execution.
- Returns:
- The name of the document requested for execution.
-
documentVersion
public final String documentVersion()
The Systems Manager document (SSM document) version.
- Returns:
- The Systems Manager document (SSM document) version.
-
comment
public final String comment()
User-specified information about the command, such as a brief description of what the command should do.
- Returns:
- User-specified information about the command, such as a brief description of what the command should do.
-
expiresAfter
public final Instant expiresAfter()
If a command expires, it changes status to
DeliveryTimedOut
for all invocations that have the statusInProgress
,Pending
, orDelayed
.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.- Returns:
- If a command expires, it changes status to
DeliveryTimedOut
for all invocations that have the statusInProgress
,Pending
, orDelayed
.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.
-
hasParameters
public final boolean hasParameters()
For responses, this returns true if the service returned a value for the Parameters property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
parameters
public final Map<String,List<String>> parameters()
The parameter values to be inserted in the document when running the command.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasParameters()
method.- Returns:
- The parameter values to be inserted in the document when running the command.
-
hasInstanceIds
public final boolean hasInstanceIds()
For responses, this returns true if the service returned a value for the InstanceIds property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
instanceIds
public final List<String> instanceIds()
The managed node IDs against which this command was requested.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasInstanceIds()
method.- Returns:
- The managed node IDs against which this command was requested.
-
hasTargets
public final boolean hasTargets()
For responses, this returns true if the service returned a value for the Targets property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
targets
public final List<Target> targets()
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.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTargets()
method.- Returns:
- 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.
-
requestedDateTime
public final Instant requestedDateTime()
The date and time the command was requested.
- Returns:
- The date and time the command was requested.
-
status
public final CommandStatus status()
The status of the command.
If the service returns an enum value that is not available in the current SDK version,
status
will returnCommandStatus.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstatusAsString()
.- Returns:
- The status of the command.
- See Also:
CommandStatus
-
statusAsString
public final String statusAsString()
The status of the command.
If the service returns an enum value that is not available in the current SDK version,
status
will returnCommandStatus.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstatusAsString()
.- Returns:
- The status of the command.
- See Also:
CommandStatus
-
statusDetails
public final String statusDetails()
A detailed status of the command execution.
StatusDetails
includes more information thanStatus
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.
-
Delayed: The system attempted to send the command to the managed node but wasn't successful. The system retries again.
- Returns:
- A detailed status of the command execution.
StatusDetails
includes more information thanStatus
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.
-
Delayed: The system attempted to send the command to the managed node but wasn't successful. The system retries again.
-
-
-
outputS3Region
public final String outputS3Region()
(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.
- Returns:
- (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
public final String outputS3BucketName()
The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.
- Returns:
- The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.
-
outputS3KeyPrefix
public final String outputS3KeyPrefix()
The S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.
- Returns:
- 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
public final String maxConcurrency()
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.- Returns:
- 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
public final String maxErrors()
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 useMaxErrors
, see Amazon Web Services Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide.- Returns:
- 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 useMaxErrors
, see Amazon Web Services Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide.
-
targetCount
public final Integer targetCount()
The number of targets for the command.
- Returns:
- The number of targets for the command.
-
completedCount
public final Integer completedCount()
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.
- Returns:
- 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
public final Integer errorCount()
The number of targets for which the status is Failed or Execution Timed Out.
- Returns:
- The number of targets for which the status is Failed or Execution Timed Out.
-
deliveryTimedOutCount
public final Integer deliveryTimedOutCount()
The number of targets for which the status is Delivery Timed Out.
- Returns:
- The number of targets for which the status is Delivery Timed Out.
-
serviceRole
public final String serviceRole()
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.
- Returns:
- 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
public final NotificationConfig notificationConfig()
Configurations for sending notifications about command status changes.
- Returns:
- Configurations for sending notifications about command status changes.
-
cloudWatchOutputConfig
public final CloudWatchOutputConfig cloudWatchOutputConfig()
Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.
- Returns:
- Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.
-
timeoutSeconds
public final Integer timeoutSeconds()
The
TimeoutSeconds
value specified for a command.- Returns:
- The
TimeoutSeconds
value specified for a command.
-
alarmConfiguration
public final AlarmConfiguration alarmConfiguration()
The details for the CloudWatch alarm applied to your command.
- Returns:
- The details for the CloudWatch alarm applied to your command.
-
hasTriggeredAlarms
public final boolean hasTriggeredAlarms()
For responses, this returns true if the service returned a value for the TriggeredAlarms property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
triggeredAlarms
public final List<AlarmStateInformation> triggeredAlarms()
The CloudWatch alarm that was invoked by the command.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTriggeredAlarms()
method.- Returns:
- The CloudWatch alarm that was invoked by the command.
-
toBuilder
public Command.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<Command.Builder,Command>
-
builder
public static Command.Builder builder()
-
serializableBuilderClass
public static Class<? extends Command.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
-