Class CommandInvocation

java.lang.Object
software.amazon.awssdk.services.ssm.model.CommandInvocation
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<CommandInvocation.Builder,CommandInvocation>

@Generated("software.amazon.awssdk:codegen") public final class CommandInvocation extends Object implements SdkPojo, Serializable, ToCopyableBuilder<CommandInvocation.Builder,CommandInvocation>

An invocation is a copy of a command sent to a specific managed node. A command can apply to one or more managed nodes. A command invocation applies to one managed node. For example, if a user runs SendCommand against three managed nodes, then a command invocation is created for each requested managed node ID. A command invocation returns status and detail information about a command you ran.

See Also:
  • Method Details

    • commandId

      public final String commandId()

      The command against which this invocation was requested.

      Returns:
      The command against which this invocation was requested.
    • instanceId

      public final String instanceId()

      The managed node ID in which this invocation was requested.

      Returns:
      The managed node ID in which this invocation was requested.
    • instanceName

      public final String instanceName()

      The fully qualified host name of the managed node.

      Returns:
      The fully qualified host name of the managed node.
    • 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.
    • documentName

      public final String documentName()

      The document name that was requested for execution.

      Returns:
      The document name that was requested for execution.
    • documentVersion

      public final String documentVersion()

      The Systems Manager document (SSM document) version.

      Returns:
      The Systems Manager document (SSM document) version.
    • requestedDateTime

      public final Instant requestedDateTime()

      The time and date the request was sent to this managed node.

      Returns:
      The time and date the request was sent to this managed node.
    • status

      public final CommandInvocationStatus status()

      Whether or not the invocation succeeded, failed, or is pending.

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

      Returns:
      Whether or not the invocation succeeded, failed, or is pending.
      See Also:
    • statusAsString

      public final String statusAsString()

      Whether or not the invocation succeeded, failed, or is pending.

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

      Returns:
      Whether or not the invocation succeeded, failed, or is pending.
      See Also:
    • statusDetails

      public final String statusDetails()

      A detailed status of the command execution for each invocation (each managed node targeted by the command). 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 the managed node.

      • In Progress: The command has been sent to the managed node but hasn't reached a terminal state.

      • Success: The execution of the command or plugin was successfully completed. This is a terminal state.

      • Delivery Timed Out: The command wasn't delivered to the managed node before the delivery timeout expired. Delivery timeouts don't count against the parent command's MaxErrors limit, but they do contribute to whether the parent command status is Success or Incomplete. This is a terminal state.

      • Execution Timed Out: Command execution started on the managed node, but the execution wasn't complete before the execution timeout expired. Execution timeouts count against the MaxErrors limit of the parent command. This is a terminal state.

      • Failed: The command wasn't successful on the managed node. For a plugin, this indicates that the result code wasn't zero. For a command invocation, this indicates that the result code for one or more plugins wasn't zero. Invocation failures count against the MaxErrors limit of the parent command. This is a terminal state.

      • Cancelled: The command was terminated before it was completed. This is a terminal state.

      • Undeliverable: The command can't be delivered to the managed node. The managed node might not exist or might not be responding. Undeliverable invocations don't count against the parent command's MaxErrors limit and don't contribute to whether the parent command status is Success or Incomplete. This is a terminal state.

      • Terminated: The parent command exceeded its MaxErrors limit and subsequent command invocations were canceled by the system. 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 for each invocation (each managed node targeted by the command). 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 the managed node.

      • In Progress: The command has been sent to the managed node but hasn't reached a terminal state.

      • Success: The execution of the command or plugin was successfully completed. This is a terminal state.

      • Delivery Timed Out: The command wasn't delivered to the managed node before the delivery timeout expired. Delivery timeouts don't count against the parent command's MaxErrors limit, but they do contribute to whether the parent command status is Success or Incomplete. This is a terminal state.

      • Execution Timed Out: Command execution started on the managed node, but the execution wasn't complete before the execution timeout expired. Execution timeouts count against the MaxErrors limit of the parent command. This is a terminal state.

      • Failed: The command wasn't successful on the managed node. For a plugin, this indicates that the result code wasn't zero. For a command invocation, this indicates that the result code for one or more plugins wasn't zero. Invocation failures count against the MaxErrors limit of the parent command. This is a terminal state.

      • Cancelled: The command was terminated before it was completed. This is a terminal state.

      • Undeliverable: The command can't be delivered to the managed node. The managed node might not exist or might not be responding. Undeliverable invocations don't count against the parent command's MaxErrors limit and don't contribute to whether the parent command status is Success or Incomplete. This is a terminal state.

      • Terminated: The parent command exceeded its MaxErrors limit and subsequent command invocations were canceled by the system. 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.

    • traceOutput

      public final String traceOutput()

      Gets the trace output sent by the agent.

      Returns:
      Gets the trace output sent by the agent.
    • standardOutputUrl

      public final String standardOutputUrl()

      The URL to the plugin's StdOut file in Amazon Simple Storage Service (Amazon S3), if the S3 bucket was defined for the parent command. For an invocation, StandardOutputUrl is populated if there is just one plugin defined for the command, and the S3 bucket was defined for the command.

      Returns:
      The URL to the plugin's StdOut file in Amazon Simple Storage Service (Amazon S3), if the S3 bucket was defined for the parent command. For an invocation, StandardOutputUrl is populated if there is just one plugin defined for the command, and the S3 bucket was defined for the command.
    • standardErrorUrl

      public final String standardErrorUrl()

      The URL to the plugin's StdErr file in Amazon Simple Storage Service (Amazon S3), if the S3 bucket was defined for the parent command. For an invocation, StandardErrorUrl is populated if there is just one plugin defined for the command, and the S3 bucket was defined for the command.

      Returns:
      The URL to the plugin's StdErr file in Amazon Simple Storage Service (Amazon S3), if the S3 bucket was defined for the parent command. For an invocation, StandardErrorUrl is populated if there is just one plugin defined for the command, and the S3 bucket was defined for the command.
    • hasCommandPlugins

      public final boolean hasCommandPlugins()
      For responses, this returns true if the service returned a value for the CommandPlugins 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.
    • commandPlugins

      public final List<CommandPlugin> commandPlugins()

      Plugins processed 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 hasCommandPlugins() method.

      Returns:
      Plugins processed by the command.
    • 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 on a per managed node basis.

      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 on a per managed node basis.
    • notificationConfig

      public final NotificationConfig notificationConfig()

      Configurations for sending notifications about command status changes on a per managed node basis.

      Returns:
      Configurations for sending notifications about command status changes on a per managed node basis.
    • 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.
    • toBuilder

      public CommandInvocation.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<CommandInvocation.Builder,CommandInvocation>
      Returns:
      a builder for type T
    • builder

      public static CommandInvocation.Builder builder()
    • serializableBuilderClass

      public static Class<? extends CommandInvocation.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.