Class: Aws::BedrockAgentCoreControl::Waiters::PolicyActive

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

Overview

Wait until a Policy is active

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PolicyActive

Returns a new instance of PolicyActive.

Parameters:

  • options (Hash)

Options Hash (options):

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


140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'gems/aws-sdk-bedrockagentcorecontrol/lib/aws-sdk-bedrockagentcorecontrol/waiters.rb', line 140

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 60,
    delay: 2,
    poller: Aws::Waiters::Poller.new(
      operation_name: :get_policy,
      acceptors: [
        {
          "matcher" => "path",
          "argument" => "status",
          "state" => "success",
          "expected" => "ACTIVE"
        },
        {
          "matcher" => "path",
          "argument" => "status",
          "state" => "failure",
          "expected" => "CREATE_FAILED"
        },
        {
          "matcher" => "path",
          "argument" => "status",
          "state" => "failure",
          "expected" => "UPDATE_FAILED"
        },
        {
          "matcher" => "path",
          "argument" => "status",
          "state" => "failure",
          "expected" => "DELETE_FAILED"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

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

Returns a response object which responds to the following methods:

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :policy_engine_id (required, String)

    The identifier of the policy engine that manages the policy to be retrieved.

  • :policy_id (required, String)

    The unique identifier of the policy to be retrieved. This must be a valid policy ID that exists within the specified policy engine.

Returns:



179
180
181
# File 'gems/aws-sdk-bedrockagentcorecontrol/lib/aws-sdk-bedrockagentcorecontrol/waiters.rb', line 179

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