Class: Aws::SSM::Waiters::CommandExecuted

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-ssm/lib/aws-sdk-ssm/waiters.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CommandExecuted

Returns a new instance of CommandExecuted.

Parameters:

  • options (Hash)

Options Hash (options):

  • :client (required, Client)
  • :max_attempts (Integer) — default: 20
  • :delay (Integer) — default: 5
  • :before_attempt (Proc)
  • :before_wait (Proc)


84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'gems/aws-sdk-ssm/lib/aws-sdk-ssm/waiters.rb', line 84

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 20,
    delay: 5,
    poller: Aws::Waiters::Poller.new(
      operation_name: :get_command_invocation,
      acceptors: [
        {
          "expected" => "Pending",
          "matcher" => "path",
          "state" => "retry",
          "argument" => "status"
        },
        {
          "expected" => "InProgress",
          "matcher" => "path",
          "state" => "retry",
          "argument" => "status"
        },
        {
          "expected" => "Delayed",
          "matcher" => "path",
          "state" => "retry",
          "argument" => "status"
        },
        {
          "expected" => "Success",
          "matcher" => "path",
          "state" => "success",
          "argument" => "status"
        },
        {
          "expected" => "Cancelled",
          "matcher" => "path",
          "state" => "failure",
          "argument" => "status"
        },
        {
          "expected" => "TimedOut",
          "matcher" => "path",
          "state" => "failure",
          "argument" => "status"
        },
        {
          "expected" => "Failed",
          "matcher" => "path",
          "state" => "failure",
          "argument" => "status"
        },
        {
          "expected" => "Cancelling",
          "matcher" => "path",
          "state" => "failure",
          "argument" => "status"
        },
        {
          "state" => "retry",
          "matcher" => "error",
          "expected" => "InvocationDoesNotExist"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

#wait(params = {}) ⇒ Types::GetCommandInvocationResult

Returns a response object which responds to the following methods:

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :command_id (required, String) — default: Required

    The parent command ID of the invocation plugin.

  • :instance_id (required, String) — default: Required

    The ID of the managed node targeted by the command. A managed node can be an Amazon Elastic Compute Cloud (Amazon EC2) instance, edge device, and on-premises server or VM in your hybrid environment that is configured for Amazon Web Services Systems Manager.

  • :plugin_name (String)

    The name of the step for which you want detailed results. If the document contains only one step, you can omit the name and details for that step. If the document contains more than one step, you must specify the name of the step for which you want to view details. Be sure to specify the name of the step, not the name of a plugin like aws:RunShellScript.

    To find the PluginName, check the document content and find the name of the step you want details for. Alternatively, use ListCommandInvocations with the CommandId and Details parameters. The PluginName is the Name attribute of the CommandPlugin object in the CommandPlugins list.

Returns:



152
153
154
# File 'gems/aws-sdk-ssm/lib/aws-sdk-ssm/waiters.rb', line 152

def wait(params = {})
  @waiter.wait(client: @client, params: params)
end