Class: Aws::AccountAccess::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::AccountAccess::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb
Overview
An API client for AccountAccess. To construct a client, you need to configure a :region and :credentials.
client = Aws::AccountAccess::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#create_application(params = {}) ⇒ Types::CreateApplicationResponse
Creates an account access manager instance and its Amazon Web Services account access application in the associated IAM Identity Center instance.
-
#create_entitlement(params = {}) ⇒ Types::CreateEntitlementResponse
Creates an entitlement (assignment) in account access manager.
-
#delete_application(params = {}) ⇒ Struct
Deletes an account access manager application.
-
#delete_entitlement(params = {}) ⇒ Struct
Deletes an entitlement from an account access manager application.
-
#get_application(params = {}) ⇒ Types::GetApplicationResponse
Retrieves details about an account access manager application, including its status, identity source, and tags.
-
#get_entitlement(params = {}) ⇒ Types::GetEntitlementResponse
Retrieves details about a specific entitlement for an account access manager application, including the principal, IAM role, and target account.
-
#list_applications(params = {}) ⇒ Types::ListApplicationsResponse
Lists the account access manager applications in your account.
-
#list_entitlements(params = {}) ⇒ Types::ListEntitlementsResponse
Lists the entitlements for a specified account access manager application.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags associated with an account access manager resource.
-
#tag_resource(params = {}) ⇒ Struct
Adds tags to an account access manager resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes tags from an account access manager resource.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
471 472 473 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 471 def initialize(*args) super end |
Instance Method Details
#create_application(params = {}) ⇒ Types::CreateApplicationResponse
Creates an account access manager instance and its Amazon Web Services account access application in the associated IAM Identity Center instance. This operation is idempotent; calling it multiple times with the same parameters returns the existing application.
515 516 517 518 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 515 def create_application(params = {}, = {}) req = build_request(:create_application, params) req.send_request() end |
#create_entitlement(params = {}) ⇒ Types::CreateEntitlementResponse
Creates an entitlement (assignment) in account access manager. An entitlement (assignment) grants a principal (IAM Identity Center user or group) permission to assume a specified IAM role in an Amazon Web Services account. This operation is idempotent.
561 562 563 564 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 561 def create_entitlement(params = {}, = {}) req = build_request(:create_entitlement, params) req.send_request() end |
#delete_application(params = {}) ⇒ Struct
Deletes an account access manager application. This operation is idempotent; deleting an application that has already been deleted does not return an error.
585 586 587 588 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 585 def delete_application(params = {}, = {}) req = build_request(:delete_application, params) req.send_request() end |
#delete_entitlement(params = {}) ⇒ Struct
Deletes an entitlement from an account access manager application. This operation is idempotent; deleting an entitlement that has already been deleted does not return an error.
613 614 615 616 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 613 def delete_entitlement(params = {}, = {}) req = build_request(:delete_entitlement, params) req.send_request() end |
#get_application(params = {}) ⇒ Types::GetApplicationResponse
Retrieves details about an account access manager application, including its status, identity source, and tags.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- application_active
662 663 664 665 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 662 def get_application(params = {}, = {}) req = build_request(:get_application, params) req.send_request() end |
#get_entitlement(params = {}) ⇒ Types::GetEntitlementResponse
Retrieves details about a specific entitlement for an account access manager application, including the principal, IAM role, and target account.
706 707 708 709 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 706 def get_entitlement(params = {}, = {}) req = build_request(:get_entitlement, params) req.send_request() end |
#list_applications(params = {}) ⇒ Types::ListApplicationsResponse
Lists the account access manager applications in your account. Use pagination to ensure that the operation returns quickly and successfully.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
749 750 751 752 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 749 def list_applications(params = {}, = {}) req = build_request(:list_applications, params) req.send_request() end |
#list_entitlements(params = {}) ⇒ Types::ListEntitlementsResponse
Lists the entitlements for a specified account access manager application. You can filter results by principal, IAM role, or account. Use pagination to ensure that the operation returns quickly and successfully.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
816 817 818 819 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 816 def list_entitlements(params = {}, = {}) req = build_request(:list_entitlements, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags associated with an account access manager resource.
845 846 847 848 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 845 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds tags to an account access manager resource.
873 874 875 876 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 873 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from an account access manager resource.
899 900 901 902 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 899 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Basic Usage
A waiter will call an API operation until:
- It is successful
- It enters a terminal state
- It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
Valid Waiters
The following table lists the valid waiter names, the operations they call,
and the default :delay and :max_attempts values.
| waiter_name | params | :delay | :max_attempts |
|---|---|---|---|
| application_active | #get_application | 5 | 24 |
1014 1015 1016 1017 1018 |
# File 'gems/aws-sdk-accountaccess/lib/aws-sdk-accountaccess/client.rb', line 1014 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |