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

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

Instance Attribute Summary collapse

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
# File '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"
        }
      ]
    )
  }.merge(options))
end

Instance Attribute Details

#waiterObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


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

def waiter
  @waiter
end

Instance Method Details

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

Returns a response object which responds to the following methods:

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 instance targeted by the command. A managed instance can be an Amazon Elastic Compute Cloud (Amazon EC2) instance or an instance in your hybrid environment that is configured for Amazon Web Services Systems Manager.

  • :plugin_name (String)

    The name of the plugin for which you want detailed results. If the document contains only one plugin, you can omit the name and details for that plugin. If the document contains more than one plugin, you must specify the name of the plugin for which you want to view details.

    Plugin names are also referred to as *step names* in Systems Manager documents (SSM documents). For example, `aws:RunShellScript` is a plugin.

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

Returns:


147
148
149
# File 'lib/aws-sdk-ssm/waiters.rb', line 147

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