Class: Aws::AppStream::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::AppStream::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-appstream/client.rb
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#associate_fleet(params = {}) ⇒ Struct
Associates the specified fleet with the specified stack.
-
#batch_associate_user_stack(params = {}) ⇒ Types::BatchAssociateUserStackResult
Associates the specified users with the specified stacks.
-
#batch_disassociate_user_stack(params = {}) ⇒ Types::BatchDisassociateUserStackResult
Disassociates the specified users from the specified stacks.
-
#copy_image(params = {}) ⇒ Types::CopyImageResponse
Copies the image within the same region or to a new region within the same AWS account.
-
#create_directory_config(params = {}) ⇒ Types::CreateDirectoryConfigResult
Creates a Directory Config object in AppStream 2.0.
-
#create_fleet(params = {}) ⇒ Types::CreateFleetResult
Creates a fleet.
-
#create_image_builder(params = {}) ⇒ Types::CreateImageBuilderResult
Creates an image builder.
-
#create_image_builder_streaming_url(params = {}) ⇒ Types::CreateImageBuilderStreamingURLResult
Creates a URL to start an image builder streaming session.
-
#create_stack(params = {}) ⇒ Types::CreateStackResult
Creates a stack to start streaming applications to users.
-
#create_streaming_url(params = {}) ⇒ Types::CreateStreamingURLResult
Creates a temporary URL to start an AppStream 2.0 streaming session for the specified user.
-
#create_user(params = {}) ⇒ Struct
Creates a new user in the user pool.
-
#delete_directory_config(params = {}) ⇒ Struct
Deletes the specified Directory Config object from AppStream 2.0.
-
#delete_fleet(params = {}) ⇒ Struct
Deletes the specified fleet.
-
#delete_image(params = {}) ⇒ Types::DeleteImageResult
Deletes the specified image.
-
#delete_image_builder(params = {}) ⇒ Types::DeleteImageBuilderResult
Deletes the specified image builder and releases the capacity.
-
#delete_image_permissions(params = {}) ⇒ Struct
Deletes permissions for the specified private image.
-
#delete_stack(params = {}) ⇒ Struct
Deletes the specified stack.
-
#delete_user(params = {}) ⇒ Struct
Deletes a user from the user pool.
-
#describe_directory_configs(params = {}) ⇒ Types::DescribeDirectoryConfigsResult
Retrieves a list that describes one or more specified Directory Config objects for AppStream 2.0, if the names for these objects are provided.
-
#describe_fleets(params = {}) ⇒ Types::DescribeFleetsResult
Retrieves a list that describes one or more specified fleets, if the fleet names are provided.
-
#describe_image_builders(params = {}) ⇒ Types::DescribeImageBuildersResult
Retrieves a list that describes one or more specified image builders, if the image builder names are provided.
-
#describe_image_permissions(params = {}) ⇒ Types::DescribeImagePermissionsResult
Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.
-
#describe_images(params = {}) ⇒ Types::DescribeImagesResult
Retrieves a list that describes one or more specified images, if the image names or image ARNs are provided.
-
#describe_sessions(params = {}) ⇒ Types::DescribeSessionsResult
Retrieves a list that describes the active streaming sessions for a specified stack and fleet.
-
#describe_stacks(params = {}) ⇒ Types::DescribeStacksResult
Retrieves a list that describes one or more specified stacks, if the stack names are provided.
-
#describe_user_stack_associations(params = {}) ⇒ Types::DescribeUserStackAssociationsResult
Retrieves a list that describes the UserStackAssociation objects.
-
#describe_users(params = {}) ⇒ Types::DescribeUsersResult
Retrieves a list that describes one or more specified users in the user pool.
-
#disable_user(params = {}) ⇒ Struct
Disables the specified user in the user pool.
-
#disassociate_fleet(params = {}) ⇒ Struct
Disassociates the specified fleet from the specified stack.
-
#enable_user(params = {}) ⇒ Struct
Enables a user in the user pool.
-
#expire_session(params = {}) ⇒ Struct
Immediately stops the specified streaming session.
-
#list_associated_fleets(params = {}) ⇒ Types::ListAssociatedFleetsResult
Retrieves the name of the fleet that is associated with the specified stack.
-
#list_associated_stacks(params = {}) ⇒ Types::ListAssociatedStacksResult
Retrieves the name of the stack with which the specified fleet is associated.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves a list of all tags for the specified AppStream 2.0 resource.
-
#start_fleet(params = {}) ⇒ Struct
Starts the specified fleet.
-
#start_image_builder(params = {}) ⇒ Types::StartImageBuilderResult
Starts the specified image builder.
-
#stop_fleet(params = {}) ⇒ Struct
Stops the specified fleet.
-
#stop_image_builder(params = {}) ⇒ Types::StopImageBuilderResult
Stops the specified image builder.
-
#tag_resource(params = {}) ⇒ Struct
Adds or overwrites one or more tags for the specified AppStream 2.0 resource.
-
#untag_resource(params = {}) ⇒ Struct
Disassociates one or more specified tags from the specified AppStream 2.0 resource.
-
#update_directory_config(params = {}) ⇒ Types::UpdateDirectoryConfigResult
Updates the specified Directory Config object in AppStream 2.0.
-
#update_fleet(params = {}) ⇒ Types::UpdateFleetResult
Updates the specified fleet.
-
#update_image_permissions(params = {}) ⇒ Struct
Adds or updates permissions for the specified private image.
-
#update_stack(params = {}) ⇒ Types::UpdateStackResult
Updates the specified fields for the specified stack.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#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.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
212 213 214 |
# File 'lib/aws-sdk-appstream/client.rb', line 212 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2694 2695 2696 |
# File 'lib/aws-sdk-appstream/client.rb', line 2694 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2697 2698 2699 |
# File 'lib/aws-sdk-appstream/client.rb', line 2697 def errors_module Errors end |
Instance Method Details
#associate_fleet(params = {}) ⇒ Struct
Associates the specified fleet with the specified stack.
239 240 241 242 |
# File 'lib/aws-sdk-appstream/client.rb', line 239 def associate_fleet(params = {}, = {}) req = build_request(:associate_fleet, params) req.send_request() end |
#batch_associate_user_stack(params = {}) ⇒ Types::BatchAssociateUserStackResult
Associates the specified users with the specified stacks. Users in a user pool cannot be assigned to stacks with fleets that are joined to an Active Directory domain.
282 283 284 285 |
# File 'lib/aws-sdk-appstream/client.rb', line 282 def batch_associate_user_stack(params = {}, = {}) req = build_request(:batch_associate_user_stack, params) req.send_request() end |
#batch_disassociate_user_stack(params = {}) ⇒ Types::BatchDisassociateUserStackResult
Disassociates the specified users from the specified stacks.
323 324 325 326 |
# File 'lib/aws-sdk-appstream/client.rb', line 323 def batch_disassociate_user_stack(params = {}, = {}) req = build_request(:batch_disassociate_user_stack, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 |
# File 'lib/aws-sdk-appstream/client.rb', line 2557 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-appstream' context[:gem_version] = '1.21.0' Seahorse::Client::Request.new(handlers, context) end |
#copy_image(params = {}) ⇒ Types::CopyImageResponse
Copies the image within the same region or to a new region within the same AWS account. Note that any tags you added to the image will not be copied.
369 370 371 372 |
# File 'lib/aws-sdk-appstream/client.rb', line 369 def copy_image(params = {}, = {}) req = build_request(:copy_image, params) req.send_request() end |
#create_directory_config(params = {}) ⇒ Types::CreateDirectoryConfigResult
Creates a Directory Config object in AppStream 2.0. This object includes the information required to join streaming instances to an Active Directory domain.
418 419 420 421 |
# File 'lib/aws-sdk-appstream/client.rb', line 418 def create_directory_config(params = {}, = {}) req = build_request(:create_directory_config, params) req.send_request() end |
#create_fleet(params = {}) ⇒ Types::CreateFleetResult
Creates a fleet. A fleet consists of streaming instances that run a specified image.
604 605 606 607 |
# File 'lib/aws-sdk-appstream/client.rb', line 604 def create_fleet(params = {}, = {}) req = build_request(:create_fleet, params) req.send_request() end |
#create_image_builder(params = {}) ⇒ Types::CreateImageBuilderResult
Creates an image builder. An image builder is a virtual machine that is used to create an image.
The initial state of the builder is ‘PENDING`. When it is ready, the state is `RUNNING`.
721 722 723 724 |
# File 'lib/aws-sdk-appstream/client.rb', line 721 def create_image_builder(params = {}, = {}) req = build_request(:create_image_builder, params) req.send_request() end |
#create_image_builder_streaming_url(params = {}) ⇒ Types::CreateImageBuilderStreamingURLResult
Creates a URL to start an image builder streaming session.
756 757 758 759 |
# File 'lib/aws-sdk-appstream/client.rb', line 756 def create_image_builder_streaming_url(params = {}, = {}) req = build_request(:create_image_builder_streaming_url, params) req.send_request() end |
#create_stack(params = {}) ⇒ Types::CreateStackResult
Creates a stack to start streaming applications to users. A stack consists of an associated fleet, user access policies, and storage configurations.
872 873 874 875 |
# File 'lib/aws-sdk-appstream/client.rb', line 872 def create_stack(params = {}, = {}) req = build_request(:create_stack, params) req.send_request() end |
#create_streaming_url(params = {}) ⇒ Types::CreateStreamingURLResult
Creates a temporary URL to start an AppStream 2.0 streaming session for the specified user. A streaming URL enables application streaming to be tested without user setup.
931 932 933 934 |
# File 'lib/aws-sdk-appstream/client.rb', line 931 def create_streaming_url(params = {}, = {}) req = build_request(:create_streaming_url, params) req.send_request() end |
#create_user(params = {}) ⇒ Struct
Creates a new user in the user pool.
978 979 980 981 |
# File 'lib/aws-sdk-appstream/client.rb', line 978 def create_user(params = {}, = {}) req = build_request(:create_user, params) req.send_request() end |
#delete_directory_config(params = {}) ⇒ Struct
Deletes the specified Directory Config object from AppStream 2.0. This object includes the information required to join streaming instances to an Active Directory domain.
1002 1003 1004 1005 |
# File 'lib/aws-sdk-appstream/client.rb', line 1002 def delete_directory_config(params = {}, = {}) req = build_request(:delete_directory_config, params) req.send_request() end |
#delete_fleet(params = {}) ⇒ Struct
Deletes the specified fleet.
1024 1025 1026 1027 |
# File 'lib/aws-sdk-appstream/client.rb', line 1024 def delete_fleet(params = {}, = {}) req = build_request(:delete_fleet, params) req.send_request() end |
#delete_image(params = {}) ⇒ Types::DeleteImageResult
Deletes the specified image. You cannot delete an image when it is in use. After you delete an image, you cannot provision new capacity using the image.
1078 1079 1080 1081 |
# File 'lib/aws-sdk-appstream/client.rb', line 1078 def delete_image(params = {}, = {}) req = build_request(:delete_image, params) req.send_request() end |
#delete_image_builder(params = {}) ⇒ Types::DeleteImageBuilderResult
Deletes the specified image builder and releases the capacity.
1128 1129 1130 1131 |
# File 'lib/aws-sdk-appstream/client.rb', line 1128 def delete_image_builder(params = {}, = {}) req = build_request(:delete_image_builder, params) req.send_request() end |
#delete_image_permissions(params = {}) ⇒ Struct
Deletes permissions for the specified private image. After you delete permissions for an image, AWS accounts to which you previously granted these permissions can no longer use the image.
1157 1158 1159 1160 |
# File 'lib/aws-sdk-appstream/client.rb', line 1157 def (params = {}, = {}) req = build_request(:delete_image_permissions, params) req.send_request() end |
#delete_stack(params = {}) ⇒ Struct
Deletes the specified stack. After the stack is deleted, the application streaming environment provided by the stack is no longer available to users. Also, any reservations made for application streaming sessions for the stack are released.
1182 1183 1184 1185 |
# File 'lib/aws-sdk-appstream/client.rb', line 1182 def delete_stack(params = {}, = {}) req = build_request(:delete_stack, params) req.send_request() end |
#delete_user(params = {}) ⇒ Struct
Deletes a user from the user pool.
1208 1209 1210 1211 |
# File 'lib/aws-sdk-appstream/client.rb', line 1208 def delete_user(params = {}, = {}) req = build_request(:delete_user, params) req.send_request() end |
#describe_directory_configs(params = {}) ⇒ Types::DescribeDirectoryConfigsResult
Retrieves a list that describes one or more specified Directory Config objects for AppStream 2.0, if the names for these objects are provided. Otherwise, all Directory Config objects in the account are described. These objects include the information required to join streaming instances to an Active Directory domain.
Although the response syntax in this topic includes the account password, this password is not returned in the actual response.
1260 1261 1262 1263 |
# File 'lib/aws-sdk-appstream/client.rb', line 1260 def describe_directory_configs(params = {}, = {}) req = build_request(:describe_directory_configs, params) req.send_request() end |
#describe_fleets(params = {}) ⇒ Types::DescribeFleetsResult
Retrieves a list that describes one or more specified fleets, if the fleet names are provided. Otherwise, all fleets in the account are described.
1323 1324 1325 1326 |
# File 'lib/aws-sdk-appstream/client.rb', line 1323 def describe_fleets(params = {}, = {}) req = build_request(:describe_fleets, params) req.send_request() end |
#describe_image_builders(params = {}) ⇒ Types::DescribeImageBuildersResult
Retrieves a list that describes one or more specified image builders, if the image builder names are provided. Otherwise, all image builders in the account are described.
1387 1388 1389 1390 |
# File 'lib/aws-sdk-appstream/client.rb', line 1387 def describe_image_builders(params = {}, = {}) req = build_request(:describe_image_builders, params) req.send_request() end |
#describe_image_permissions(params = {}) ⇒ Types::DescribeImagePermissionsResult
Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.
1438 1439 1440 1441 |
# File 'lib/aws-sdk-appstream/client.rb', line 1438 def (params = {}, = {}) req = build_request(:describe_image_permissions, params) req.send_request() end |
#describe_images(params = {}) ⇒ Types::DescribeImagesResult
Retrieves a list that describes one or more specified images, if the image names or image ARNs are provided. Otherwise, all images in the account are described.
1512 1513 1514 1515 |
# File 'lib/aws-sdk-appstream/client.rb', line 1512 def describe_images(params = {}, = {}) req = build_request(:describe_images, params) req.send_request() end |
#describe_sessions(params = {}) ⇒ Types::DescribeSessionsResult
Retrieves a list that describes the active streaming sessions for a specified stack and fleet. If a value for ‘UserId` is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.
1582 1583 1584 1585 |
# File 'lib/aws-sdk-appstream/client.rb', line 1582 def describe_sessions(params = {}, = {}) req = build_request(:describe_sessions, params) req.send_request() end |
#describe_stacks(params = {}) ⇒ Types::DescribeStacksResult
Retrieves a list that describes one or more specified stacks, if the stack names are provided. Otherwise, all stacks in the account are described.
1640 1641 1642 1643 |
# File 'lib/aws-sdk-appstream/client.rb', line 1640 def describe_stacks(params = {}, = {}) req = build_request(:describe_stacks, params) req.send_request() end |
#describe_user_stack_associations(params = {}) ⇒ Types::DescribeUserStackAssociationsResult
Retrieves a list that describes the UserStackAssociation objects. You must specify either or both of the following:
-
The stack name
-
The user name (email address of the user associated with the stack) and the authentication type for the user
1698 1699 1700 1701 |
# File 'lib/aws-sdk-appstream/client.rb', line 1698 def describe_user_stack_associations(params = {}, = {}) req = build_request(:describe_user_stack_associations, params) req.send_request() end |
#describe_users(params = {}) ⇒ Types::DescribeUsersResult
Retrieves a list that describes one or more specified users in the user pool.
1747 1748 1749 1750 |
# File 'lib/aws-sdk-appstream/client.rb', line 1747 def describe_users(params = {}, = {}) req = build_request(:describe_users, params) req.send_request() end |
#disable_user(params = {}) ⇒ Struct
Disables the specified user in the user pool. Users can’t sign in to AppStream 2.0 until they are re-enabled. This action does not delete the user.
1775 1776 1777 1778 |
# File 'lib/aws-sdk-appstream/client.rb', line 1775 def disable_user(params = {}, = {}) req = build_request(:disable_user, params) req.send_request() end |
#disassociate_fleet(params = {}) ⇒ Struct
Disassociates the specified fleet from the specified stack.
1801 1802 1803 1804 |
# File 'lib/aws-sdk-appstream/client.rb', line 1801 def disassociate_fleet(params = {}, = {}) req = build_request(:disassociate_fleet, params) req.send_request() end |
#enable_user(params = {}) ⇒ Struct
Enables a user in the user pool. After being enabled, users can sign in to AppStream 2.0 and open applications from the stacks to which they are assigned.
1829 1830 1831 1832 |
# File 'lib/aws-sdk-appstream/client.rb', line 1829 def enable_user(params = {}, = {}) req = build_request(:enable_user, params) req.send_request() end |
#expire_session(params = {}) ⇒ Struct
Immediately stops the specified streaming session.
1851 1852 1853 1854 |
# File 'lib/aws-sdk-appstream/client.rb', line 1851 def expire_session(params = {}, = {}) req = build_request(:expire_session, params) req.send_request() end |
#list_associated_fleets(params = {}) ⇒ Types::ListAssociatedFleetsResult
Retrieves the name of the fleet that is associated with the specified stack.
1888 1889 1890 1891 |
# File 'lib/aws-sdk-appstream/client.rb', line 1888 def list_associated_fleets(params = {}, = {}) req = build_request(:list_associated_fleets, params) req.send_request() end |
#list_associated_stacks(params = {}) ⇒ Types::ListAssociatedStacksResult
Retrieves the name of the stack with which the specified fleet is associated.
1925 1926 1927 1928 |
# File 'lib/aws-sdk-appstream/client.rb', line 1925 def list_associated_stacks(params = {}, = {}) req = build_request(:list_associated_stacks, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves a list of all tags for the specified AppStream 2.0 resource. You can tag AppStream 2.0 image builders, images, fleets, and stacks.
For more information about tags, see [Tagging Your Resources] in the *Amazon AppStream 2.0 Developer Guide*.
[1]: docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html
1962 1963 1964 1965 |
# File 'lib/aws-sdk-appstream/client.rb', line 1962 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#start_fleet(params = {}) ⇒ Struct
Starts the specified fleet.
1984 1985 1986 1987 |
# File 'lib/aws-sdk-appstream/client.rb', line 1984 def start_fleet(params = {}, = {}) req = build_request(:start_fleet, params) req.send_request() end |
#start_image_builder(params = {}) ⇒ Types::StartImageBuilderResult
Starts the specified image builder.
2040 2041 2042 2043 |
# File 'lib/aws-sdk-appstream/client.rb', line 2040 def start_image_builder(params = {}, = {}) req = build_request(:start_image_builder, params) req.send_request() end |
#stop_fleet(params = {}) ⇒ Struct
Stops the specified fleet.
2062 2063 2064 2065 |
# File 'lib/aws-sdk-appstream/client.rb', line 2062 def stop_fleet(params = {}, = {}) req = build_request(:stop_fleet, params) req.send_request() end |
#stop_image_builder(params = {}) ⇒ Types::StopImageBuilderResult
Stops the specified image builder.
2112 2113 2114 2115 |
# File 'lib/aws-sdk-appstream/client.rb', line 2112 def stop_image_builder(params = {}, = {}) req = build_request(:stop_image_builder, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds or overwrites one or more tags for the specified AppStream 2.0 resource. You can tag AppStream 2.0 image builders, images, fleets, and stacks.
Each tag consists of a key and an optional value. If a resource already has a tag with the same key, this operation updates its value.
To list the current tags for your resources, use ListTagsForResource. To disassociate tags from your resources, use UntagResource.
For more information about tags, see [Tagging Your Resources] in the *Amazon AppStream 2.0 Developer Guide*.
[1]: docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html
2159 2160 2161 2162 |
# File 'lib/aws-sdk-appstream/client.rb', line 2159 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Disassociates one or more specified tags from the specified AppStream 2.0 resource.
To list the current tags for your resources, use ListTagsForResource.
For more information about tags, see [Tagging Your Resources] in the *Amazon AppStream 2.0 Developer Guide*.
[1]: docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html
2195 2196 2197 2198 |
# File 'lib/aws-sdk-appstream/client.rb', line 2195 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_directory_config(params = {}) ⇒ Types::UpdateDirectoryConfigResult
Updates the specified Directory Config object in AppStream 2.0. This object includes the information required to join streaming instances to an Active Directory domain.
2243 2244 2245 2246 |
# File 'lib/aws-sdk-appstream/client.rb', line 2243 def update_directory_config(params = {}, = {}) req = build_request(:update_directory_config, params) req.send_request() end |
#update_fleet(params = {}) ⇒ Types::UpdateFleetResult
Updates the specified fleet.
If the fleet is in the ‘STOPPED` state, you can update any attribute except the fleet name. If the fleet is in the `RUNNING` state, you can update the `DisplayName` and `ComputeCapacity` attributes. If the fleet is in the `STARTING` or `STOPPING` state, you can’t update it.
2409 2410 2411 2412 |
# File 'lib/aws-sdk-appstream/client.rb', line 2409 def update_fleet(params = {}, = {}) req = build_request(:update_fleet, params) req.send_request() end |
#update_image_permissions(params = {}) ⇒ Struct
Adds or updates permissions for the specified private image.
2443 2444 2445 2446 |
# File 'lib/aws-sdk-appstream/client.rb', line 2443 def (params = {}, = {}) req = build_request(:update_image_permissions, params) req.send_request() end |
#update_stack(params = {}) ⇒ Types::UpdateStackResult
Updates the specified fields for the specified stack.
2548 2549 2550 2551 |
# File 'lib/aws-sdk-appstream/client.rb', line 2548 def update_stack(params = {}, = {}) req = build_request(:update_stack, 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.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 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 | | ————- | —————— | ——– | ————- | | fleet_started | #describe_fleets | 30 | 40 | | fleet_stopped | #describe_fleets | 30 | 40 |
2659 2660 2661 2662 2663 |
# File 'lib/aws-sdk-appstream/client.rb', line 2659 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2667 2668 2669 |
# File 'lib/aws-sdk-appstream/client.rb', line 2667 def waiter_names waiters.keys end |