Class: Aws::Imagebuilder::Waiters::ImageAvailable

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

Overview

Wait until an image build version reaches the AVAILABLE state, meaning the build completed, including distribution and integration of output resources. The waiter fails if the image reaches the FAILED or CANCELLED state. Specify the full image build version ARN; wildcard version ARNs only resolve to images that are already available.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ImageAvailable

Returns a new instance of ImageAvailable.

Parameters:

  • options (Hash)

Options Hash (options):

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


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
# File 'gems/aws-sdk-imagebuilder/lib/aws-sdk-imagebuilder/waiters.rb', line 85

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 360,
    delay: 60,
    poller: Aws::Waiters::Poller.new(
      operation_name: :get_image,
      acceptors: [
        {
          "state" => "success",
          "matcher" => "path",
          "argument" => "image.state.status",
          "expected" => "AVAILABLE"
        },
        {
          "state" => "failure",
          "matcher" => "path",
          "argument" => "image.state.status",
          "expected" => "FAILED"
        },
        {
          "state" => "failure",
          "matcher" => "path",
          "argument" => "image.state.status",
          "expected" => "CANCELLED"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

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

Returns a response object which responds to the following methods:

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :image_build_version_arn (required, String) —

    The Amazon Resource Name (ARN) of the image that you want to get. You can specify a full build version ARN, or a version ARN with or without wildcards (x.x.x, 1.x.x, or 1.0.x). A version or wildcard ARN resolves to the latest matching build version that has reached AVAILABLE status. Builds that were later deprecated, disabled, or deleted don't resolve. To get an image in any other state, such as a failed or in-progress build, specify the full build version ARN.

Returns:



118
119
120
# File 'gems/aws-sdk-imagebuilder/lib/aws-sdk-imagebuilder/waiters.rb', line 118

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