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:
  • Method Details

    • 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 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.

      Returns:
      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.
    • 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 the isEmpty() 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 the isEmpty() 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 the isEmpty() 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 return CommandStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The status of the command.
      See Also:
    • 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 return CommandStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The status of the command.
      See Also:
    • statusDetails

      public final String statusDetails()

      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.

      • 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 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.

      • 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 use MaxErrors, 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 use MaxErrors, 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 the isEmpty() 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()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<Command.Builder,Command>
      Returns:
      a builder for type T
    • builder

      public static Command.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Command.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • 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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.