You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

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

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

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 'gems/aws-sdk-ec2/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 Method Details

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

Returns a response object which responds to the following methods:

Parameters:

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

    a customizable set of options

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 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/waiters.rb', line 48

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