You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::GlobalAccelerator::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::GlobalAccelerator::Client
- Defined in:
- (unknown)
Overview
An API client for AWS Global Accelerator. To construct a client, you need to configure a :region
and :credentials
.
globalaccelerator = Aws::GlobalAccelerator::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::GlobalAccelerator::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::GlobalAccelerator::Client
constructor
Constructs an API client.
API Operations collapse
-
#advertise_byoip_cidr(options = {}) ⇒ Types::AdvertiseByoipCidrResponse
Advertises an IPv4 address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP).
-
#create_accelerator(options = {}) ⇒ Types::CreateAcceleratorResponse
Create an accelerator.
-
#create_endpoint_group(options = {}) ⇒ Types::CreateEndpointGroupResponse
Create an endpoint group for the specified listener.
-
#create_listener(options = {}) ⇒ Types::CreateListenerResponse
Create a listener to process inbound connections from clients to an accelerator.
-
#delete_accelerator(options = {}) ⇒ Struct
Delete an accelerator.
-
#delete_endpoint_group(options = {}) ⇒ Struct
Delete an endpoint group from a listener.
.
-
#delete_listener(options = {}) ⇒ Struct
Delete a listener from an accelerator.
.
-
#deprovision_byoip_cidr(options = {}) ⇒ Types::DeprovisionByoipCidrResponse
Releases the specified address range that you provisioned to use with your AWS resources through bring your own IP addresses (BYOIP) and deletes the corresponding address pool.
-
#describe_accelerator(options = {}) ⇒ Types::DescribeAcceleratorResponse
Describe an accelerator.
-
#describe_accelerator_attributes(options = {}) ⇒ Types::DescribeAcceleratorAttributesResponse
Describe the attributes of an accelerator.
-
#describe_endpoint_group(options = {}) ⇒ Types::DescribeEndpointGroupResponse
Describe an endpoint group.
-
#describe_listener(options = {}) ⇒ Types::DescribeListenerResponse
Describe a listener.
-
#list_accelerators(options = {}) ⇒ Types::ListAcceleratorsResponse
List the accelerators for an AWS account.
-
#list_byoip_cidrs(options = {}) ⇒ Types::ListByoipCidrsResponse
Lists the IP address ranges that were specified in calls to ProvisionByoipCidr, including the current state and a history of state changes.
To see an AWS CLI example of listing BYOIP CIDR addresses, scroll down to Example.
. -
#list_endpoint_groups(options = {}) ⇒ Types::ListEndpointGroupsResponse
List the endpoint groups that are associated with a listener.
-
#list_listeners(options = {}) ⇒ Types::ListListenersResponse
List the listeners for an accelerator.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
List all tags for an accelerator.
-
#provision_byoip_cidr(options = {}) ⇒ Types::ProvisionByoipCidrResponse
Provisions an IP address range to use with your AWS resources through bring your own IP addresses (BYOIP) and creates a corresponding address pool.
-
#tag_resource(options = {}) ⇒ Struct
Add tags to an accelerator resource.
-
#untag_resource(options = {}) ⇒ Struct
Remove tags from a Global Accelerator resource.
-
#update_accelerator(options = {}) ⇒ Types::UpdateAcceleratorResponse
Update an accelerator.
-
#update_accelerator_attributes(options = {}) ⇒ Types::UpdateAcceleratorAttributesResponse
Update the attributes for an accelerator.
-
#update_endpoint_group(options = {}) ⇒ Types::UpdateEndpointGroupResponse
Update an endpoint group.
-
#update_listener(options = {}) ⇒ Types::UpdateListenerResponse
Update a listener.
-
#withdraw_byoip_cidr(options = {}) ⇒ Types::WithdrawByoipCidrResponse
Stops advertising an address range that is provisioned as an address pool.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::GlobalAccelerator::Client
Constructs an API client.
Instance Method Details
#advertise_byoip_cidr(options = {}) ⇒ Types::AdvertiseByoipCidrResponse
Advertises an IPv4 address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP). It can take a few minutes before traffic to the specified addresses starts routing to AWS because of propagation delays. To see an AWS CLI example of advertising an address range, scroll down to Example.
To stop advertising the BYOIP address range, use WithdrawByoipCidr.
For more information, see Bring Your Own IP Addresses (BYOIP) in the AWS Global Accelerator Developer Guide.
#create_accelerator(options = {}) ⇒ Types::CreateAcceleratorResponse
Create an accelerator. An accelerator includes one or more listeners that process inbound connections and direct traffic to one or more endpoint groups, each of which includes endpoints, such as Network Load Balancers. To see an AWS CLI example of creating an accelerator, scroll down to Example.
Global Accelerator is a global service that supports endpoints in multiple AWS Regions but you must specify the US West (Oregon) Region to create or update accelerators.
#create_endpoint_group(options = {}) ⇒ Types::CreateEndpointGroupResponse
Create an endpoint group for the specified listener. An endpoint group is a collection of endpoints in one AWS Region. A resource must be valid and active when you add it as an endpoint.
To see an AWS CLI example of creating an endpoint group, scroll down to Example.
#create_listener(options = {}) ⇒ Types::CreateListenerResponse
Create a listener to process inbound connections from clients to an accelerator. Connections arrive to assigned static IP addresses on a port, port range, or list of port ranges that you specify. To see an AWS CLI example of creating a listener, scroll down to Example.
#delete_accelerator(options = {}) ⇒ Struct
Delete an accelerator. Before you can delete an accelerator, you must disable it and remove all dependent resources (listeners and endpoint groups). To disable the accelerator, update the accelerator to set Enabled
to false.
When you create an accelerator, by default, Global Accelerator provides you with a set of two static IP addresses. Alternatively, you can bring your own IP address ranges to Global Accelerator and assign IP addresses from those ranges. The IP addresses are assigned to your accelerator for as long as it exists, even if you disable the accelerator and it no longer accepts or routes traffic. However, when you delete an accelerator, you lose the static IP addresses that are assigned to the accelerator, so you can no longer route traffic by using them. As a best practice, ensure that you have permissions in place to avoid inadvertently deleting accelerators. You can use IAM policies with Global Accelerator to limit the users who have permissions to delete an accelerator. For more information, see Authentication and Access Control in the AWS Global Accelerator Developer Guide.
#delete_endpoint_group(options = {}) ⇒ Struct
Delete an endpoint group from a listener.
#delete_listener(options = {}) ⇒ Struct
Delete a listener from an accelerator.
#deprovision_byoip_cidr(options = {}) ⇒ Types::DeprovisionByoipCidrResponse
Releases the specified address range that you provisioned to use with your AWS resources through bring your own IP addresses (BYOIP) and deletes the corresponding address pool. To see an AWS CLI example of deprovisioning an address range, scroll down to Example.
Before you can release an address range, you must stop advertising it by using WithdrawByoipCidr and you must not have any accelerators that are using static IP addresses allocated from its address range.
For more information, see Bring Your Own IP Addresses (BYOIP) in the AWS Global Accelerator Developer Guide.
#describe_accelerator(options = {}) ⇒ Types::DescribeAcceleratorResponse
Describe an accelerator. To see an AWS CLI example of describing an accelerator, scroll down to Example.
#describe_accelerator_attributes(options = {}) ⇒ Types::DescribeAcceleratorAttributesResponse
Describe the attributes of an accelerator. To see an AWS CLI example of describing the attributes of an accelerator, scroll down to Example.
#describe_endpoint_group(options = {}) ⇒ Types::DescribeEndpointGroupResponse
Describe an endpoint group. To see an AWS CLI example of describing an endpoint group, scroll down to Example.
#describe_listener(options = {}) ⇒ Types::DescribeListenerResponse
Describe a listener. To see an AWS CLI example of describing a listener, scroll down to Example.
#list_accelerators(options = {}) ⇒ Types::ListAcceleratorsResponse
List the accelerators for an AWS account. To see an AWS CLI example of listing the accelerators for an AWS account, scroll down to Example.
#list_byoip_cidrs(options = {}) ⇒ Types::ListByoipCidrsResponse
Lists the IP address ranges that were specified in calls to ProvisionByoipCidr, including the current state and a history of state changes.
To see an AWS CLI example of listing BYOIP CIDR addresses, scroll down to Example.
#list_endpoint_groups(options = {}) ⇒ Types::ListEndpointGroupsResponse
List the endpoint groups that are associated with a listener. To see an AWS CLI example of listing the endpoint groups for listener, scroll down to Example.
#list_listeners(options = {}) ⇒ Types::ListListenersResponse
List the listeners for an accelerator. To see an AWS CLI example of listing the listeners for an accelerator, scroll down to Example.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
List all tags for an accelerator. To see an AWS CLI example of listing tags for an accelerator, scroll down to Example.
For more information, see Tagging in AWS Global Accelerator in the AWS Global Accelerator Developer Guide.
#provision_byoip_cidr(options = {}) ⇒ Types::ProvisionByoipCidrResponse
Provisions an IP address range to use with your AWS resources through bring your own IP addresses (BYOIP) and creates a corresponding address pool. After the address range is provisioned, it is ready to be advertised using AdvertiseByoipCidr.
To see an AWS CLI example of provisioning an address range for BYOIP, scroll down to Example.
For more information, see Bring Your Own IP Addresses (BYOIP) in the AWS Global Accelerator Developer Guide.
#tag_resource(options = {}) ⇒ Struct
Add tags to an accelerator resource. To see an AWS CLI example of adding tags to an accelerator, scroll down to Example.
For more information, see Tagging in AWS Global Accelerator in the AWS Global Accelerator Developer Guide.
#untag_resource(options = {}) ⇒ Struct
Remove tags from a Global Accelerator resource. When you specify a tag key, the action removes both that key and its associated value. To see an AWS CLI example of removing tags from an accelerator, scroll down to Example. The operation succeeds even if you attempt to remove tags from an accelerator that was already removed.
For more information, see Tagging in AWS Global Accelerator in the AWS Global Accelerator Developer Guide.
#update_accelerator(options = {}) ⇒ Types::UpdateAcceleratorResponse
Update an accelerator. To see an AWS CLI example of updating an accelerator, scroll down to Example.
Global Accelerator is a global service that supports endpoints in multiple AWS Regions but you must specify the US West (Oregon) Region to create or update accelerators.
#update_accelerator_attributes(options = {}) ⇒ Types::UpdateAcceleratorAttributesResponse
Update the attributes for an accelerator. To see an AWS CLI example of updating an accelerator to enable flow logs, scroll down to Example.
#update_endpoint_group(options = {}) ⇒ Types::UpdateEndpointGroupResponse
Update an endpoint group. A resource must be valid and active when you add it as an endpoint.
To see an AWS CLI example of updating an endpoint group, scroll down to Example.
#update_listener(options = {}) ⇒ Types::UpdateListenerResponse
Update a listener. To see an AWS CLI example of updating listener, scroll down to Example.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
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(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|
#withdraw_byoip_cidr(options = {}) ⇒ Types::WithdrawByoipCidrResponse
Stops advertising an address range that is provisioned as an address pool. You can perform this operation at most once every 10 seconds, even if you specify different address ranges each time. To see an AWS CLI example of withdrawing an address range for BYOIP so it will no longer be advertised by AWS, scroll down to Example.
It can take a few minutes before traffic to the specified addresses stops routing to AWS because of propagation delays.
For more information, see Bring Your Own IP Addresses (BYOIP) in the AWS Global Accelerator Developer Guide.