Class: Aws::Deadline::Waiters::JobSucceeded

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

Overview

Wait until a job has succeeded. Fails if the job reaches a non-successful terminal status. Waits up to 1 hour by default.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ JobSucceeded

Returns a new instance of JobSucceeded.

Parameters:

  • options (Hash)

Options Hash (options):

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


283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'gems/aws-sdk-deadline/lib/aws-sdk-deadline/waiters.rb', line 283

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 240,
    delay: 15,
    poller: Aws::Waiters::Poller.new(
      operation_name: :get_job,
      acceptors: [
        {
          "matcher" => "path",
          "argument" => "task_run_status",
          "state" => "success",
          "expected" => "SUCCEEDED"
        },
        {
          "matcher" => "path",
          "argument" => "task_run_status",
          "state" => "failure",
          "expected" => "FAILED"
        },
        {
          "matcher" => "path",
          "argument" => "task_run_status",
          "state" => "failure",
          "expected" => "CANCELED"
        },
        {
          "matcher" => "path",
          "argument" => "task_run_status",
          "state" => "failure",
          "expected" => "SUSPENDED"
        },
        {
          "matcher" => "path",
          "argument" => "task_run_status",
          "state" => "failure",
          "expected" => "NOT_COMPATIBLE"
        },
        {
          "matcher" => "path",
          "argument" => "lifecycle_status",
          "state" => "failure",
          "expected" => "ARCHIVED"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

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

Returns a response object which responds to the following methods:

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :farm_id (required, String)

    The farm ID of the farm in the job.

  • :queue_id (required, String)

    The queue ID associated with the job.

  • :job_id (required, String)

    The job ID.

Returns:



334
335
336
# File 'gems/aws-sdk-deadline/lib/aws-sdk-deadline/waiters.rb', line 334

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