Class: Aws::EC2::Waiters::BundleTaskComplete

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BundleTaskComplete

Returns a new instance of BundleTaskComplete.

Parameters:

  • options (Hash)

Options Hash (options):

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


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/aws-sdk-ec2/waiters.rb', line 21

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 40,
    delay: 15,
    poller: Aws::Waiters::Poller.new(
      operation_name: :describe_bundle_tasks,
      acceptors: [
        {
          "expected" => "complete",
          "matcher" => "pathAll",
          "state" => "success",
          "argument" => "bundle_tasks[].state"
        },
        {
          "expected" => "failed",
          "matcher" => "pathAny",
          "state" => "failure",
          "argument" => "bundle_tasks[].state"
        }
      ]
    )
  }.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.



53
54
55
# File 'lib/aws-sdk-ec2/waiters.rb', line 53

def waiter
  @waiter
end

Instance Method Details

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

Returns a response object which responds to the following methods:

Options Hash (params):

  • :bundle_ids (Array<String>)

    One or more bundle task IDs.

    Default: Describes all your bundle tasks.

  • :filters (Array<Types::Filter>)

    One or more filters.

    • ‘bundle-id` - The ID of the bundle task.

    • ‘error-code` - If the task failed, the error code returned.

    • ‘error-message` - If the task failed, the error message returned.

    • ‘instance-id` - The ID of the instance.

    • ‘progress` - The level of task completion, as a percentage (for example, 20%).

    • ‘s3-bucket` - The Amazon S3 bucket to store the AMI.

    • ‘s3-prefix` - The beginning of the AMI name.

    • ‘start-time` - The time the task started (for example, 2013-09-15T17:15:20.000Z).

    • ‘state` - The state of the task (`pending` | `waiting-for-shutdown` | `bundling` | `storing` | `cancelling` | `complete` | `failed`).

    • ‘update-time` - The time of the most recent update for the task.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ‘DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.

Returns:



48
49
50
# File 'lib/aws-sdk-ec2/waiters.rb', line 48

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