Class SendCommandRequest

All Implemented Interfaces:
SdkPojo, ToCopyableBuilder<SendCommandRequest.Builder,SendCommandRequest>

@Generated("software.amazon.awssdk:codegen") public final class SendCommandRequest extends SsmRequest implements ToCopyableBuilder<SendCommandRequest.Builder,SendCommandRequest>
  • Method Details

    • 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 IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs.

      To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once.

      For more information about how to use targets, see Run commands at scale in the Amazon Web Services Systems Manager User Guide.

      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 IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs.

      To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once.

      For more information about how to use targets, see Run commands at scale in the Amazon Web Services Systems Manager User Guide.

    • 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. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets, which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once.

      To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead.

      For more information about how to use targets, see Run commands at scale in the Amazon Web Services Systems Manager User Guide.

      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. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets, which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once.

      To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead.

      For more information about how to use targets, see Run commands at scale in the Amazon Web Services Systems Manager User Guide.

    • documentName

      public final String documentName()

      The name of the Amazon Web Services Systems Manager document (SSM document) to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document Amazon Resource Name (ARN). For more information about how to use shared documents, see Sharing SSM documents in the Amazon Web Services Systems Manager User Guide.

      If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error.

      Returns:
      The name of the Amazon Web Services Systems Manager document (SSM document) to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document Amazon Resource Name (ARN). For more information about how to use shared documents, see Sharing SSM documents in the Amazon Web Services Systems Manager User Guide.

      If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error.

    • documentVersion

      public final String documentVersion()

      The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

      --document-version "\$DEFAULT"

      --document-version "\$LATEST"

      --document-version "3"

      Returns:
      The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

      --document-version "\$DEFAULT"

      --document-version "\$LATEST"

      --document-version "3"

    • documentHash

      public final String documentHash()

      The Sha256 or Sha1 hash created by the system when the document was created.

      Sha1 hashes have been deprecated.

      Returns:
      The Sha256 or Sha1 hash created by the system when the document was created.

      Sha1 hashes have been deprecated.

    • documentHashType

      public final DocumentHashType documentHashType()

      Sha256 or Sha1.

      Sha1 hashes have been deprecated.

      If the service returns an enum value that is not available in the current SDK version, documentHashType will return DocumentHashType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from documentHashTypeAsString().

      Returns:
      Sha256 or Sha1.

      Sha1 hashes have been deprecated.

      See Also:
    • documentHashTypeAsString

      public final String documentHashTypeAsString()

      Sha256 or Sha1.

      Sha1 hashes have been deprecated.

      If the service returns an enum value that is not available in the current SDK version, documentHashType will return DocumentHashType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from documentHashTypeAsString().

      Returns:
      Sha256 or Sha1.

      Sha1 hashes have been deprecated.

      See Also:
    • timeoutSeconds

      public final Integer timeoutSeconds()

      If this time is reached and the command hasn't already started running, it won't run.

      Returns:
      If this time is reached and the command hasn't already started running, it won't run.
    • 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.
    • 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 required and optional parameters specified in the document being run.

      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 required and optional parameters specified in the document being run.
    • 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 name of the S3 bucket where command execution responses should be stored.

      Returns:
      The name of the S3 bucket where command execution responses should be stored.
    • outputS3KeyPrefix

      public final String outputS3KeyPrefix()

      The directory structure within the S3 bucket where the responses should be stored.

      Returns:
      The directory structure within the S3 bucket where the responses should be stored.
    • maxConcurrency

      public final String maxConcurrency()

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

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

      public final String maxErrors()

      The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors, the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0. For more information about how to use MaxErrors, see Using error controls in the Amazon Web Services Systems Manager User Guide.

      Returns:
      The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors, the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0. For more information about how to use MaxErrors, see Using error controls in the Amazon Web Services Systems Manager User Guide.
    • serviceRoleArn

      public final String serviceRoleArn()

      The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands.

      This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.

      Returns:
      The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands.

      This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.

    • notificationConfig

      public final NotificationConfig notificationConfig()

      Configurations for sending notifications.

      Returns:
      Configurations for sending notifications.
    • cloudWatchOutputConfig

      public final CloudWatchOutputConfig cloudWatchOutputConfig()

      Enables Amazon Web Services Systems Manager to send Run Command output to Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services Systems Manager.

      Returns:
      Enables Amazon Web Services Systems Manager to send Run Command output to Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services Systems Manager.
    • alarmConfiguration

      public final AlarmConfiguration alarmConfiguration()

      The CloudWatch alarm you want to apply to your command.

      Returns:
      The CloudWatch alarm you want to apply to your command.
    • toBuilder

      public SendCommandRequest.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<SendCommandRequest.Builder,SendCommandRequest>
      Specified by:
      toBuilder in class SsmRequest
      Returns:
      a builder for type T
    • builder

      public static SendCommandRequest.Builder builder()
    • serializableBuilderClass

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

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

      public final boolean equals(Object obj)
      Overrides:
      equals in class AwsRequest
    • 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)
      Description copied from class: SdkRequest
      Used to retrieve the value of a field from any class that extends SdkRequest. The field name specified should match the member name from the corresponding service-2.json model specified in the codegen-resources folder for a given service. The class specifies what class to cast the returned value to. If the returned value is also a modeled class, the SdkRequest.getValueForField(String, Class) method will again be available.
      Overrides:
      getValueForField in class SdkRequest
      Parameters:
      fieldName - The name of the member to be retrieved.
      clazz - The class to cast the returned object to.
      Returns:
      Optional containing the casted return value
    • 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.