You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::AppStream::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::AppStream::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon AppStream. To construct a client, you need to configure a :region
and :credentials
.
appstream = Aws::AppStream::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::AppStream::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::AppStream::Client
constructor
Constructs an API client.
API Operations collapse
-
#associate_fleet(options = {}) ⇒ Struct
Associates the specified fleet with the specified stack.
.
-
#batch_associate_user_stack(options = {}) ⇒ Types::BatchAssociateUserStackResult
Associates the specified users with the specified stacks.
-
#batch_disassociate_user_stack(options = {}) ⇒ Types::BatchDisassociateUserStackResult
Disassociates the specified users from the specified stacks.
.
-
#copy_image(options = {}) ⇒ Types::CopyImageResponse
Copies the image within the same region or to a new region within the same AWS account.
-
#create_directory_config(options = {}) ⇒ Types::CreateDirectoryConfigResult
Creates a Directory Config object in AppStream 2.0.
-
#create_fleet(options = {}) ⇒ Types::CreateFleetResult
Creates a fleet.
-
#create_image_builder(options = {}) ⇒ Types::CreateImageBuilderResult
Creates an image builder.
-
#create_image_builder_streaming_url(options = {}) ⇒ Types::CreateImageBuilderStreamingURLResult
Creates a URL to start an image builder streaming session.
.
-
#create_stack(options = {}) ⇒ Types::CreateStackResult
Creates a stack to start streaming applications to users.
-
#create_streaming_url(options = {}) ⇒ Types::CreateStreamingURLResult
Creates a temporary URL to start an AppStream 2.0 streaming session for the specified user.
-
#create_usage_report_subscription(options = {}) ⇒ Types::CreateUsageReportSubscriptionResult
Creates a usage report subscription.
-
#create_user(options = {}) ⇒ Struct
Creates a new user in the user pool.
.
-
#delete_directory_config(options = {}) ⇒ Struct
Deletes the specified Directory Config object from AppStream 2.0.
-
#delete_fleet(options = {}) ⇒ Struct
Deletes the specified fleet.
.
-
#delete_image(options = {}) ⇒ Types::DeleteImageResult
Deletes the specified image.
-
#delete_image_builder(options = {}) ⇒ Types::DeleteImageBuilderResult
Deletes the specified image builder and releases the capacity.
.
-
#delete_image_permissions(options = {}) ⇒ Struct
Deletes permissions for the specified private image.
-
#delete_stack(options = {}) ⇒ Struct
Deletes the specified stack.
-
#delete_usage_report_subscription(options = {}) ⇒ Struct
Disables usage report generation.
.
-
#delete_user(options = {}) ⇒ Struct
Deletes a user from the user pool.
.
-
#describe_directory_configs(options = {}) ⇒ 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(options = {}) ⇒ Types::DescribeFleetsResult
Retrieves a list that describes one or more specified fleets, if the fleet names are provided.
-
#describe_image_builders(options = {}) ⇒ Types::DescribeImageBuildersResult
Retrieves a list that describes one or more specified image builders, if the image builder names are provided.
-
#describe_image_permissions(options = {}) ⇒ Types::DescribeImagePermissionsResult
Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.
-
#describe_images(options = {}) ⇒ Types::DescribeImagesResult
Retrieves a list that describes one or more specified images, if the image names or image ARNs are provided.
-
#describe_sessions(options = {}) ⇒ Types::DescribeSessionsResult
Retrieves a list that describes the streaming sessions for a specified stack and fleet.
-
#describe_stacks(options = {}) ⇒ Types::DescribeStacksResult
Retrieves a list that describes one or more specified stacks, if the stack names are provided.
-
#describe_usage_report_subscriptions(options = {}) ⇒ Types::DescribeUsageReportSubscriptionsResult
Retrieves a list that describes one or more usage report subscriptions.
.
-
#describe_user_stack_associations(options = {}) ⇒ Types::DescribeUserStackAssociationsResult
Retrieves a list that describes the UserStackAssociation objects.
-
#describe_users(options = {}) ⇒ Types::DescribeUsersResult
Retrieves a list that describes one or more specified users in the user pool.
.
-
#disable_user(options = {}) ⇒ Struct
Disables the specified user in the user pool.
-
#disassociate_fleet(options = {}) ⇒ Struct
Disassociates the specified fleet from the specified stack.
.
-
#enable_user(options = {}) ⇒ Struct
Enables a user in the user pool.
-
#expire_session(options = {}) ⇒ Struct
Immediately stops the specified streaming session.
.
-
#list_associated_fleets(options = {}) ⇒ Types::ListAssociatedFleetsResult
Retrieves the name of the fleet that is associated with the specified stack.
.
-
#list_associated_stacks(options = {}) ⇒ Types::ListAssociatedStacksResult
Retrieves the name of the stack with which the specified fleet is associated.
.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves a list of all tags for the specified AppStream 2.0 resource.
-
#start_fleet(options = {}) ⇒ Struct
Starts the specified fleet.
.
-
#start_image_builder(options = {}) ⇒ Types::StartImageBuilderResult
Starts the specified image builder.
.
-
#stop_fleet(options = {}) ⇒ Struct
Stops the specified fleet.
.
-
#stop_image_builder(options = {}) ⇒ Types::StopImageBuilderResult
Stops the specified image builder.
.
-
#tag_resource(options = {}) ⇒ Struct
Adds or overwrites one or more tags for the specified AppStream 2.0 resource.
-
#untag_resource(options = {}) ⇒ 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 Administration Guide.
. -
#update_directory_config(options = {}) ⇒ Types::UpdateDirectoryConfigResult
Updates the specified Directory Config object in AppStream 2.0.
-
#update_fleet(options = {}) ⇒ Types::UpdateFleetResult
Updates the specified fleet.
If the fleet is in the
STOPPED
state, you can update any attribute except the fleet name. -
#update_image_permissions(options = {}) ⇒ Struct
Adds or updates permissions for the specified private image.
-
#update_stack(options = {}) ⇒ Types::UpdateStackResult
Updates the specified fields for the specified stack.
.
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::AppStream::Client
Constructs an API client.
Instance Method Details
#associate_fleet(options = {}) ⇒ Struct
Associates the specified fleet with the specified stack.
#batch_associate_user_stack(options = {}) ⇒ 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.
#batch_disassociate_user_stack(options = {}) ⇒ Types::BatchDisassociateUserStackResult
Disassociates the specified users from the specified stacks.
#copy_image(options = {}) ⇒ 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.
#create_directory_config(options = {}) ⇒ Types::CreateDirectoryConfigResult
Creates a Directory Config object in AppStream 2.0. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.
#create_fleet(options = {}) ⇒ Types::CreateFleetResult
Creates a fleet. A fleet consists of streaming instances that run a specified image.
#create_image_builder(options = {}) ⇒ 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
.
#create_image_builder_streaming_url(options = {}) ⇒ Types::CreateImageBuilderStreamingURLResult
Creates a URL to start an image builder streaming session.
#create_stack(options = {}) ⇒ Types::CreateStackResult
Creates a stack to start streaming applications to users. A stack consists of an associated fleet, user access policies, and storage configurations.
#create_streaming_url(options = {}) ⇒ 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.
#create_usage_report_subscription(options = {}) ⇒ Types::CreateUsageReportSubscriptionResult
Creates a usage report subscription. Usage reports are generated daily.
#create_user(options = {}) ⇒ Struct
Creates a new user in the user pool.
#delete_directory_config(options = {}) ⇒ 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.
#delete_fleet(options = {}) ⇒ Struct
Deletes the specified fleet.
#delete_image(options = {}) ⇒ 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.
#delete_image_builder(options = {}) ⇒ Types::DeleteImageBuilderResult
Deletes the specified image builder and releases the capacity.
#delete_image_permissions(options = {}) ⇒ 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.
#delete_stack(options = {}) ⇒ 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.
#delete_usage_report_subscription(options = {}) ⇒ Struct
Disables usage report generation.
#delete_user(options = {}) ⇒ Struct
Deletes a user from the user pool.
#describe_directory_configs(options = {}) ⇒ 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 configuration information required to join fleets and image builders to Microsoft Active Directory domains.
Although the response syntax in this topic includes the account password, this password is not returned in the actual response.
#describe_fleets(options = {}) ⇒ 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.
#describe_image_builders(options = {}) ⇒ 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.
#describe_image_permissions(options = {}) ⇒ Types::DescribeImagePermissionsResult
Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.
#describe_images(options = {}) ⇒ 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.
#describe_sessions(options = {}) ⇒ Types::DescribeSessionsResult
Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a 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.
#describe_stacks(options = {}) ⇒ 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.
#describe_usage_report_subscriptions(options = {}) ⇒ Types::DescribeUsageReportSubscriptionsResult
Retrieves a list that describes one or more usage report subscriptions.
#describe_user_stack_associations(options = {}) ⇒ 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
#describe_users(options = {}) ⇒ Types::DescribeUsersResult
Retrieves a list that describes one or more specified users in the user pool.
#disable_user(options = {}) ⇒ 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.
#disassociate_fleet(options = {}) ⇒ Struct
Disassociates the specified fleet from the specified stack.
#enable_user(options = {}) ⇒ 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.
#expire_session(options = {}) ⇒ Struct
Immediately stops the specified streaming session.
#list_associated_fleets(options = {}) ⇒ Types::ListAssociatedFleetsResult
Retrieves the name of the fleet that is associated with the specified stack.
#list_associated_stacks(options = {}) ⇒ Types::ListAssociatedStacksResult
Retrieves the name of the stack with which the specified fleet is associated.
#list_tags_for_resource(options = {}) ⇒ 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 Administration Guide.
#start_fleet(options = {}) ⇒ Struct
Starts the specified fleet.
#start_image_builder(options = {}) ⇒ Types::StartImageBuilderResult
Starts the specified image builder.
#stop_fleet(options = {}) ⇒ Struct
Stops the specified fleet.
#stop_image_builder(options = {}) ⇒ Types::StopImageBuilderResult
Stops the specified image builder.
#tag_resource(options = {}) ⇒ 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 Administration Guide.
#untag_resource(options = {}) ⇒ 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 Administration Guide.
#update_directory_config(options = {}) ⇒ Types::UpdateDirectoryConfigResult
Updates the specified Directory Config object in AppStream 2.0. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.
#update_fleet(options = {}) ⇒ 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
, ComputeCapacity
, ImageARN
, ImageName
, IdleDisconnectTimeoutInSeconds
, and DisconnectTimeoutInSeconds
attributes. If the fleet is in the STARTING
or STOPPING
state, you can't update it.
#update_image_permissions(options = {}) ⇒ Struct
Adds or updates permissions for the specified private image.
#update_stack(options = {}) ⇒ Types::UpdateStackResult
Updates the specified fields for the specified stack.
#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: |
---|---|---|---|
:fleet_started | #describe_fleets | 30 | 40 |
:fleet_stopped | #describe_fleets | 30 | 40 |