You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::WorkSpaces::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon WorkSpaces. To construct a client, you need to configure a :region and :credentials.

workspaces = Aws::WorkSpaces::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'] and ENV['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::WorkSpaces::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

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

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::WorkSpaces::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#associate_connection_alias(options = {}) ⇒ Types::AssociateConnectionAliasResult

Associates the specified connection alias with the specified directory to enable cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

Before performing this operation, call DescribeConnectionAliases to make sure that the current state of the connection alias is CREATED.

Examples:

Request syntax with placeholder values


resp = client.associate_connection_alias({
  alias_id: "ConnectionAliasId", # required
  resource_id: "NonEmptyString", # required
})

Response structure


resp.connection_identifier #=> String

Options Hash (options):

  • :alias_id (required, String)

    The identifier of the connection alias.

  • :resource_id (required, String)

    The identifier of the directory to associate the connection alias with.

Returns:

See Also:

#associate_ip_groups(options = {}) ⇒ Struct

Associates the specified IP access control group with the specified directory.

Examples:

Request syntax with placeholder values


resp = client.associate_ip_groups({
  directory_id: "DirectoryId", # required
  group_ids: ["IpGroupId"], # required
})

Options Hash (options):

  • :directory_id (required, String)

    The identifier of the directory.

  • :group_ids (required, Array<String>)

    The identifiers of one or more IP access control groups.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#authorize_ip_rules(options = {}) ⇒ Struct

Adds one or more rules to the specified IP access control group.

This action gives users permission to access their WorkSpaces from the CIDR address ranges specified in the rules.

Examples:

Request syntax with placeholder values


resp = client.authorize_ip_rules({
  group_id: "IpGroupId", # required
  user_rules: [ # required
    {
      ip_rule: "IpRule",
      rule_desc: "IpRuleDesc",
    },
  ],
})

Options Hash (options):

  • :group_id (required, String)

    The identifier of the group.

  • :user_rules (required, Array<Types::IpRuleItem>)

    The rules to add to the group.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#copy_workspace_image(options = {}) ⇒ Types::CopyWorkspaceImageResult

Copies the specified image from the specified Region to the current Region. For more information about copying images, see Copy a Custom WorkSpaces Image.

Before copying a shared image, be sure to verify that it has been shared from the correct AWS account. To determine if an image has been shared and to see the AWS account ID that owns an image, use the DescribeWorkSpaceImages and DescribeWorkspaceImagePermissions API operations.

Examples:

Request syntax with placeholder values


resp = client.copy_workspace_image({
  name: "WorkspaceImageName", # required
  description: "WorkspaceImageDescription",
  source_image_id: "WorkspaceImageId", # required
  source_region: "Region", # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.image_id #=> String

Options Hash (options):

  • :name (required, String)

    The name of the image.

  • :description (String)

    A description of the image.

  • :source_image_id (required, String)

    The identifier of the source image.

  • :source_region (required, String)

    The identifier of the source Region.

  • :tags (Array<Types::Tag>)

    The tags for the image.

Returns:

See Also:

#create_connection_alias(options = {}) ⇒ Types::CreateConnectionAliasResult

Creates the specified connection alias for use with cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

Examples:

Request syntax with placeholder values


resp = client.create_connection_alias({
  connection_string: "ConnectionString", # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.alias_id #=> String

Options Hash (options):

  • :connection_string (required, String)

    A connection string in the form of a fully qualified domain name (FQDN), such as www.example.com.

    After you create a connection string, it is always associated to your AWS account. You cannot recreate the same connection string with a different account, even if you delete all instances of it from the original account. The connection string is globally reserved for your account.

  • :tags (Array<Types::Tag>)

    The tags to associate with the connection alias.

Returns:

See Also:

#create_ip_group(options = {}) ⇒ Types::CreateIpGroupResult

Creates an IP access control group.

An IP access control group provides you with the ability to control the IP addresses from which users are allowed to access their WorkSpaces. To specify the CIDR address ranges, add rules to your IP access control group and then associate the group with your directory. You can add rules when you create the group or at any time using AuthorizeIpRules.

There is a default IP access control group associated with your directory. If you don't associate an IP access control group with your directory, the default group is used. The default group includes a default rule that allows users to access their WorkSpaces from anywhere. You cannot modify the default IP access control group for your directory.

Examples:

Request syntax with placeholder values


resp = client.create_ip_group({
  group_name: "IpGroupName", # required
  group_desc: "IpGroupDesc",
  user_rules: [
    {
      ip_rule: "IpRule",
      rule_desc: "IpRuleDesc",
    },
  ],
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.group_id #=> String

Options Hash (options):

  • :group_name (required, String)

    The name of the group.

  • :group_desc (String)

    The description of the group.

  • :user_rules (Array<Types::IpRuleItem>)

    The rules to add to the group.

  • :tags (Array<Types::Tag>)

    The tags. Each WorkSpaces resource can have a maximum of 50 tags.

Returns:

See Also:

#create_tags(options = {}) ⇒ Struct

Creates the specified tags for the specified WorkSpaces resource.

Examples:

Request syntax with placeholder values


resp = client.create_tags({
  resource_id: "NonEmptyString", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Options Hash (options):

  • :resource_id (required, String)

    The identifier of the WorkSpaces resource. The supported resource types are WorkSpaces, registered directories, images, custom bundles, IP access control groups, and connection aliases.

  • :tags (required, Array<Types::Tag>)

    The tags. Each WorkSpaces resource can have a maximum of 50 tags.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_workspaces(options = {}) ⇒ Types::CreateWorkspacesResult

Creates one or more WorkSpaces.

This operation is asynchronous and returns before the WorkSpaces are created.

Examples:

Request syntax with placeholder values


resp = client.create_workspaces({
  workspaces: [ # required
    {
      directory_id: "DirectoryId", # required
      user_name: "UserName", # required
      bundle_id: "BundleId", # required
      volume_encryption_key: "VolumeEncryptionKey",
      user_volume_encryption_enabled: false,
      root_volume_encryption_enabled: false,
      workspace_properties: {
        running_mode: "AUTO_STOP", # accepts AUTO_STOP, ALWAYS_ON
        running_mode_auto_stop_timeout_in_minutes: 1,
        root_volume_size_gib: 1,
        user_volume_size_gib: 1,
        compute_type_name: "VALUE", # accepts VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO, GRAPHICSPRO
      },
      tags: [
        {
          key: "TagKey", # required
          value: "TagValue",
        },
      ],
    },
  ],
})

Response structure


resp.failed_requests #=> Array
resp.failed_requests[0].workspace_request.directory_id #=> String
resp.failed_requests[0].workspace_request.user_name #=> String
resp.failed_requests[0].workspace_request.bundle_id #=> String
resp.failed_requests[0].workspace_request.volume_encryption_key #=> String
resp.failed_requests[0].workspace_request.user_volume_encryption_enabled #=> true/false
resp.failed_requests[0].workspace_request.root_volume_encryption_enabled #=> true/false
resp.failed_requests[0].workspace_request.workspace_properties.running_mode #=> String, one of "AUTO_STOP", "ALWAYS_ON"
resp.failed_requests[0].workspace_request.workspace_properties.running_mode_auto_stop_timeout_in_minutes #=> Integer
resp.failed_requests[0].workspace_request.workspace_properties.root_volume_size_gib #=> Integer
resp.failed_requests[0].workspace_request.workspace_properties.user_volume_size_gib #=> Integer
resp.failed_requests[0].workspace_request.workspace_properties.compute_type_name #=> String, one of "VALUE", "STANDARD", "PERFORMANCE", "POWER", "GRAPHICS", "POWERPRO", "GRAPHICSPRO"
resp.failed_requests[0].workspace_request.tags #=> Array
resp.failed_requests[0].workspace_request.tags[0].key #=> String
resp.failed_requests[0].workspace_request.tags[0].value #=> String
resp.failed_requests[0].error_code #=> String
resp.failed_requests[0].error_message #=> String
resp.pending_requests #=> Array
resp.pending_requests[0].workspace_id #=> String
resp.pending_requests[0].directory_id #=> String
resp.pending_requests[0].user_name #=> String
resp.pending_requests[0].ip_address #=> String
resp.pending_requests[0].state #=> String, one of "PENDING", "AVAILABLE", "IMPAIRED", "UNHEALTHY", "REBOOTING", "STARTING", "REBUILDING", "RESTORING", "MAINTENANCE", "ADMIN_MAINTENANCE", "TERMINATING", "TERMINATED", "SUSPENDED", "UPDATING", "STOPPING", "STOPPED", "ERROR"
resp.pending_requests[0].bundle_id #=> String
resp.pending_requests[0].subnet_id #=> String
resp.pending_requests[0].error_message #=> String
resp.pending_requests[0].error_code #=> String
resp.pending_requests[0].computer_name #=> String
resp.pending_requests[0].volume_encryption_key #=> String
resp.pending_requests[0].user_volume_encryption_enabled #=> true/false
resp.pending_requests[0].root_volume_encryption_enabled #=> true/false
resp.pending_requests[0].workspace_properties.running_mode #=> String, one of "AUTO_STOP", "ALWAYS_ON"
resp.pending_requests[0].workspace_properties.running_mode_auto_stop_timeout_in_minutes #=> Integer
resp.pending_requests[0].workspace_properties.root_volume_size_gib #=> Integer
resp.pending_requests[0].workspace_properties.user_volume_size_gib #=> Integer
resp.pending_requests[0].workspace_properties.compute_type_name #=> String, one of "VALUE", "STANDARD", "PERFORMANCE", "POWER", "GRAPHICS", "POWERPRO", "GRAPHICSPRO"
resp.pending_requests[0].modification_states #=> Array
resp.pending_requests[0].modification_states[0].resource #=> String, one of "ROOT_VOLUME", "USER_VOLUME", "COMPUTE_TYPE"
resp.pending_requests[0].modification_states[0].state #=> String, one of "UPDATE_INITIATED", "UPDATE_IN_PROGRESS"

Options Hash (options):

  • :workspaces (required, Array<Types::WorkspaceRequest>)

    The WorkSpaces to create. You can specify up to 25 WorkSpaces.

Returns:

See Also:

#delete_connection_alias(options = {}) ⇒ Struct

Deletes the specified connection alias. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

If you will no longer be using a fully qualified domain name (FQDN) as the registration code for your WorkSpaces users, you must take certain precautions to prevent potential security issues. For more information, see Security Considerations if You Stop Using Cross-Region Redirection.

To delete a connection alias that has been shared, the shared account must first disassociate the connection alias from any directories it has been associated with. Then you must unshare the connection alias from the account it has been shared with. You can delete a connection alias only after it is no longer shared with any accounts or associated with any directories.

Examples:

Request syntax with placeholder values


resp = client.delete_connection_alias({
  alias_id: "ConnectionAliasId", # required
})

Options Hash (options):

  • :alias_id (required, String)

    The identifier of the connection alias to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_ip_group(options = {}) ⇒ Struct

Deletes the specified IP access control group.

You cannot delete an IP access control group that is associated with a directory.

Examples:

Request syntax with placeholder values


resp = client.delete_ip_group({
  group_id: "IpGroupId", # required
})

Options Hash (options):

  • :group_id (required, String)

    The identifier of the IP access control group.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_tags(options = {}) ⇒ Struct

Deletes the specified tags from the specified WorkSpaces resource.

Examples:

Request syntax with placeholder values


resp = client.delete_tags({
  resource_id: "NonEmptyString", # required
  tag_keys: ["NonEmptyString"], # required
})

Options Hash (options):

  • :resource_id (required, String)

    The identifier of the WorkSpaces resource. The supported resource types are WorkSpaces, registered directories, images, custom bundles, IP access control groups, and connection aliases.

  • :tag_keys (required, Array<String>)

    The tag keys.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_workspace_image(options = {}) ⇒ Struct

Deletes the specified image from your account. To delete an image, you must first delete any bundles that are associated with the image and unshare the image if it is shared with other accounts.

Examples:

Request syntax with placeholder values


resp = client.delete_workspace_image({
  image_id: "WorkspaceImageId", # required
})

Options Hash (options):

  • :image_id (required, String)

    The identifier of the image.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#deregister_workspace_directory(options = {}) ⇒ Struct

Deregisters the specified directory. This operation is asynchronous and returns before the WorkSpace directory is deregistered. If any WorkSpaces are registered to this directory, you must remove them before you can deregister the directory.

Examples:

Request syntax with placeholder values


resp = client.deregister_workspace_directory({
  directory_id: "DirectoryId", # required
})

Options Hash (options):

  • :directory_id (required, String)

    The identifier of the directory. If any WorkSpaces are registered to this directory, you must remove them before you deregister the directory, or you will receive an OperationNotSupportedException error.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_account(options = {}) ⇒ Types::DescribeAccountResult

Retrieves a list that describes the configuration of Bring Your Own License (BYOL) for the specified account.

Examples:

Request syntax with placeholder values


resp = client.()

Response structure


resp.dedicated_tenancy_support #=> String, one of "ENABLED", "DISABLED"
resp.dedicated_tenancy_management_cidr_range #=> String

Returns:

See Also:

#describe_account_modifications(options = {}) ⇒ Types::DescribeAccountModificationsResult

Retrieves a list that describes modifications to the configuration of Bring Your Own License (BYOL) for the specified account.

Examples:

Request syntax with placeholder values


resp = client.({
  next_token: "PaginationToken",
})

Response structure


resp. #=> Array
resp.[0].modification_state #=> String, one of "PENDING", "COMPLETED", "FAILED"
resp.[0].dedicated_tenancy_support #=> String, one of "ENABLED", "DISABLED"
resp.[0].dedicated_tenancy_management_cidr_range #=> String
resp.[0].start_time #=> Time
resp.[0].error_code #=> String
resp.[0].error_message #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Returns:

See Also:

#describe_client_properties(options = {}) ⇒ Types::DescribeClientPropertiesResult

Retrieves a list that describes one or more specified Amazon WorkSpaces clients.

Examples:

Request syntax with placeholder values


resp = client.describe_client_properties({
  resource_ids: ["NonEmptyString"], # required
})

Response structure


resp.client_properties_list #=> Array
resp.client_properties_list[0].resource_id #=> String
resp.client_properties_list[0].client_properties.reconnect_enabled #=> String, one of "ENABLED", "DISABLED"

Options Hash (options):

  • :resource_ids (required, Array<String>)

    The resource identifier, in the form of directory IDs.

Returns:

See Also:

#describe_connection_alias_permissions(options = {}) ⇒ Types::DescribeConnectionAliasPermissionsResult

Describes the permissions that the owner of a connection alias has granted to another AWS account for the specified connection alias. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

Examples:

Request syntax with placeholder values


resp = client.describe_connection_alias_permissions({
  alias_id: "ConnectionAliasId", # required
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.alias_id #=> String
resp.connection_alias_permissions #=> Array
resp.connection_alias_permissions[0]. #=> String
resp.connection_alias_permissions[0].allow_association #=> true/false
resp.next_token #=> String

Options Hash (options):

  • :alias_id (required, String)

    The identifier of the connection alias.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

  • :max_results (Integer)

    The maximum number of results to return.

Returns:

See Also:

#describe_connection_aliases(options = {}) ⇒ Types::DescribeConnectionAliasesResult

Retrieves a list that describes the connection aliases used for cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

Examples:

Request syntax with placeholder values


resp = client.describe_connection_aliases({
  alias_ids: ["ConnectionAliasId"],
  resource_id: "NonEmptyString",
  limit: 1,
  next_token: "PaginationToken",
})

Response structure


resp.connection_aliases #=> Array
resp.connection_aliases[0].connection_string #=> String
resp.connection_aliases[0].alias_id #=> String
resp.connection_aliases[0].state #=> String, one of "CREATING", "CREATED", "DELETING"
resp.connection_aliases[0]. #=> String
resp.connection_aliases[0].associations #=> Array
resp.connection_aliases[0].associations[0].association_status #=> String, one of "NOT_ASSOCIATED", "ASSOCIATED_WITH_OWNER_ACCOUNT", "ASSOCIATED_WITH_SHARED_ACCOUNT", "PENDING_ASSOCIATION", "PENDING_DISASSOCIATION"
resp.connection_aliases[0].associations[0]. #=> String
resp.connection_aliases[0].associations[0].resource_id #=> String
resp.connection_aliases[0].associations[0].connection_identifier #=> String
resp.next_token #=> String

Options Hash (options):

  • :alias_ids (Array<String>)

    The identifiers of the connection aliases to describe.

  • :resource_id (String)

    The identifier of the directory associated with the connection alias.

  • :limit (Integer)

    The maximum number of connection aliases to return.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Returns:

See Also:

#describe_ip_groups(options = {}) ⇒ Types::DescribeIpGroupsResult

Describes one or more of your IP access control groups.

Examples:

Request syntax with placeholder values


resp = client.describe_ip_groups({
  group_ids: ["IpGroupId"],
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.result #=> Array
resp.result[0].group_id #=> String
resp.result[0].group_name #=> String
resp.result[0].group_desc #=> String
resp.result[0].user_rules #=> Array
resp.result[0].user_rules[0].ip_rule #=> String
resp.result[0].user_rules[0].rule_desc #=> String
resp.next_token #=> String

Options Hash (options):

  • :group_ids (Array<String>)

    The identifiers of one or more IP access control groups.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

  • :max_results (Integer)

    The maximum number of items to return.

Returns:

See Also:

#describe_tags(options = {}) ⇒ Types::DescribeTagsResult

Describes the specified tags for the specified WorkSpaces resource.

Examples:

Request syntax with placeholder values


resp = client.describe_tags({
  resource_id: "NonEmptyString", # required
})

Response structure


resp.tag_list #=> Array
resp.tag_list[0].key #=> String
resp.tag_list[0].value #=> String

Options Hash (options):

  • :resource_id (required, String)

    The identifier of the WorkSpaces resource. The supported resource types are WorkSpaces, registered directories, images, custom bundles, IP access control groups, and connection aliases.

Returns:

See Also:

#describe_workspace_bundles(options = {}) ⇒ Types::DescribeWorkspaceBundlesResult

Retrieves a list that describes the available WorkSpace bundles.

You can filter the results using either bundle ID or owner, but not both.

Examples:

Request syntax with placeholder values


resp = client.describe_workspace_bundles({
  bundle_ids: ["BundleId"],
  owner: "BundleOwner",
  next_token: "PaginationToken",
})

Response structure


resp.bundles #=> Array
resp.bundles[0].bundle_id #=> String
resp.bundles[0].name #=> String
resp.bundles[0].owner #=> String
resp.bundles[0].description #=> String
resp.bundles[0].image_id #=> String
resp.bundles[0].root_storage.capacity #=> String
resp.bundles[0].user_storage.capacity #=> String
resp.bundles[0].compute_type.name #=> String, one of "VALUE", "STANDARD", "PERFORMANCE", "POWER", "GRAPHICS", "POWERPRO", "GRAPHICSPRO"
resp.bundles[0].last_updated_time #=> Time
resp.next_token #=> String

Options Hash (options):

  • :bundle_ids (Array<String>)

    The identifiers of the bundles. You cannot combine this parameter with any other filter.

  • :owner (String)

    The owner of the bundles. You cannot combine this parameter with any other filter.

    Specify AMAZON to describe the bundles provided by AWS or null to describe the bundles that belong to your account.

  • :next_token (String)

    The token for the next set of results. (You received this token from a previous call.)

Returns:

See Also:

#describe_workspace_directories(options = {}) ⇒ Types::DescribeWorkspaceDirectoriesResult

Describes the available directories that are registered with Amazon WorkSpaces.

Examples:

Request syntax with placeholder values


resp = client.describe_workspace_directories({
  directory_ids: ["DirectoryId"],
  limit: 1,
  next_token: "PaginationToken",
})

Response structure


resp.directories #=> Array
resp.directories[0].directory_id #=> String
resp.directories[0].alias #=> String
resp.directories[0].directory_name #=> String
resp.directories[0].registration_code #=> String
resp.directories[0].subnet_ids #=> Array
resp.directories[0].subnet_ids[0] #=> String
resp.directories[0].dns_ip_addresses #=> Array
resp.directories[0].dns_ip_addresses[0] #=> String
resp.directories[0].customer_user_name #=> String
resp.directories[0].iam_role_id #=> String
resp.directories[0].directory_type #=> String, one of "SIMPLE_AD", "AD_CONNECTOR"
resp.directories[0].workspace_security_group_id #=> String
resp.directories[0].state #=> String, one of "REGISTERING", "REGISTERED", "DEREGISTERING", "DEREGISTERED", "ERROR"
resp.directories[0].workspace_creation_properties.enable_work_docs #=> true/false
resp.directories[0].workspace_creation_properties.enable_internet_access #=> true/false
resp.directories[0].workspace_creation_properties.default_ou #=> String
resp.directories[0].workspace_creation_properties.custom_security_group_id #=> String
resp.directories[0].workspace_creation_properties.user_enabled_as_local_administrator #=> true/false
resp.directories[0].workspace_creation_properties.enable_maintenance_mode #=> true/false
resp.directories[0].ip_group_ids #=> Array
resp.directories[0].ip_group_ids[0] #=> String
resp.directories[0].workspace_access_properties.device_type_windows #=> String, one of "ALLOW", "DENY"
resp.directories[0].workspace_access_properties.device_type_osx #=> String, one of "ALLOW", "DENY"
resp.directories[0].workspace_access_properties.device_type_web #=> String, one of "ALLOW", "DENY"
resp.directories[0].workspace_access_properties.device_type_ios #=> String, one of "ALLOW", "DENY"
resp.directories[0].workspace_access_properties.device_type_android #=> String, one of "ALLOW", "DENY"
resp.directories[0].workspace_access_properties.device_type_chrome_os #=> String, one of "ALLOW", "DENY"
resp.directories[0].workspace_access_properties.device_type_zero_client #=> String, one of "ALLOW", "DENY"
resp.directories[0].tenancy #=> String, one of "DEDICATED", "SHARED"
resp.directories[0].selfservice_permissions.restart_workspace #=> String, one of "ENABLED", "DISABLED"
resp.directories[0].selfservice_permissions.increase_volume_size #=> String, one of "ENABLED", "DISABLED"
resp.directories[0].selfservice_permissions.change_compute_type #=> String, one of "ENABLED", "DISABLED"
resp.directories[0].selfservice_permissions.switch_running_mode #=> String, one of "ENABLED", "DISABLED"
resp.directories[0].selfservice_permissions.rebuild_workspace #=> String, one of "ENABLED", "DISABLED"
resp.next_token #=> String

Options Hash (options):

  • :directory_ids (Array<String>)

    The identifiers of the directories. If the value is null, all directories are retrieved.

  • :limit (Integer)

    The maximum number of directories to return.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Returns:

See Also:

#describe_workspace_image_permissions(options = {}) ⇒ Types::DescribeWorkspaceImagePermissionsResult

Describes the permissions that the owner of an image has granted to other AWS accounts for an image.

Examples:

Request syntax with placeholder values


resp = client.describe_workspace_image_permissions({
  image_id: "WorkspaceImageId", # required
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.image_id #=> String
resp.image_permissions #=> Array
resp.image_permissions[0]. #=> String
resp.next_token #=> String

Options Hash (options):

  • :image_id (required, String)

    The identifier of the image.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

  • :max_results (Integer)

    The maximum number of items to return.

Returns:

See Also:

#describe_workspace_images(options = {}) ⇒ Types::DescribeWorkspaceImagesResult

Retrieves a list that describes one or more specified images, if the image identifiers are provided. Otherwise, all images in the account are described.

Examples:

Request syntax with placeholder values


resp = client.describe_workspace_images({
  image_ids: ["WorkspaceImageId"],
  image_type: "OWNED", # accepts OWNED, SHARED
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.images #=> Array
resp.images[0].image_id #=> String
resp.images[0].name #=> String
resp.images[0].description #=> String
resp.images[0].operating_system.type #=> String, one of "WINDOWS", "LINUX"
resp.images[0].state #=> String, one of "AVAILABLE", "PENDING", "ERROR"
resp.images[0].required_tenancy #=> String, one of "DEFAULT", "DEDICATED"
resp.images[0].error_code #=> String
resp.images[0].error_message #=> String
resp.images[0].created #=> Time
resp.images[0]. #=> String
resp.next_token #=> String

Options Hash (options):

  • :image_ids (Array<String>)

    The identifier of the image.

  • :image_type (String)

    The type (owned or shared) of the image.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

  • :max_results (Integer)

    The maximum number of items to return.

Returns:

See Also:

#describe_workspace_snapshots(options = {}) ⇒ Types::DescribeWorkspaceSnapshotsResult

Describes the snapshots for the specified WorkSpace.

Examples:

Request syntax with placeholder values


resp = client.describe_workspace_snapshots({
  workspace_id: "WorkspaceId", # required
})

Response structure


resp.rebuild_snapshots #=> Array
resp.rebuild_snapshots[0].snapshot_time #=> Time
resp.restore_snapshots #=> Array
resp.restore_snapshots[0].snapshot_time #=> Time

Options Hash (options):

  • :workspace_id (required, String)

    The identifier of the WorkSpace.

Returns:

See Also:

#describe_workspaces(options = {}) ⇒ Types::DescribeWorkspacesResult

Describes the specified WorkSpaces.

You can filter the results by using the bundle identifier, directory identifier, or owner, but you can specify only one filter at a time.

Examples:

Request syntax with placeholder values


resp = client.describe_workspaces({
  workspace_ids: ["WorkspaceId"],
  directory_id: "DirectoryId",
  user_name: "UserName",
  bundle_id: "BundleId",
  limit: 1,
  next_token: "PaginationToken",
})

Response structure


resp.workspaces #=> Array
resp.workspaces[0].workspace_id #=> String
resp.workspaces[0].directory_id #=> String
resp.workspaces[0].user_name #=> String
resp.workspaces[0].ip_address #=> String
resp.workspaces[0].state #=> String, one of "PENDING", "AVAILABLE", "IMPAIRED", "UNHEALTHY", "REBOOTING", "STARTING", "REBUILDING", "RESTORING", "MAINTENANCE", "ADMIN_MAINTENANCE", "TERMINATING", "TERMINATED", "SUSPENDED", "UPDATING", "STOPPING", "STOPPED", "ERROR"
resp.workspaces[0].bundle_id #=> String
resp.workspaces[0].subnet_id #=> String
resp.workspaces[0].error_message #=> String
resp.workspaces[0].error_code #=> String
resp.workspaces[0].computer_name #=> String
resp.workspaces[0].volume_encryption_key #=> String
resp.workspaces[0].user_volume_encryption_enabled #=> true/false
resp.workspaces[0].root_volume_encryption_enabled #=> true/false
resp.workspaces[0].workspace_properties.running_mode #=> String, one of "AUTO_STOP", "ALWAYS_ON"
resp.workspaces[0].workspace_properties.running_mode_auto_stop_timeout_in_minutes #=> Integer
resp.workspaces[0].workspace_properties.root_volume_size_gib #=> Integer
resp.workspaces[0].workspace_properties.user_volume_size_gib #=> Integer
resp.workspaces[0].workspace_properties.compute_type_name #=> String, one of "VALUE", "STANDARD", "PERFORMANCE", "POWER", "GRAPHICS", "POWERPRO", "GRAPHICSPRO"
resp.workspaces[0].modification_states #=> Array
resp.workspaces[0].modification_states[0].resource #=> String, one of "ROOT_VOLUME", "USER_VOLUME", "COMPUTE_TYPE"
resp.workspaces[0].modification_states[0].state #=> String, one of "UPDATE_INITIATED", "UPDATE_IN_PROGRESS"
resp.next_token #=> String

Options Hash (options):

  • :workspace_ids (Array<String>)

    The identifiers of the WorkSpaces. You cannot combine this parameter with any other filter.

    Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not immediately available. If you immediately call DescribeWorkspaces with this identifier, no information is returned.

  • :directory_id (String)

    The identifier of the directory. In addition, you can optionally specify a specific directory user (see UserName). You cannot combine this parameter with any other filter.

  • :user_name (String)

    The name of the directory user. You must specify this parameter with DirectoryId.

  • :bundle_id (String)

    The identifier of the bundle. All WorkSpaces that are created from this bundle are retrieved. You cannot combine this parameter with any other filter.

  • :limit (Integer)

    The maximum number of items to return.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Returns:

See Also:

#describe_workspaces_connection_status(options = {}) ⇒ Types::DescribeWorkspacesConnectionStatusResult

Describes the connection status of the specified WorkSpaces.

Examples:

Request syntax with placeholder values


resp = client.describe_workspaces_connection_status({
  workspace_ids: ["WorkspaceId"],
  next_token: "PaginationToken",
})

Response structure


resp.workspaces_connection_status #=> Array
resp.workspaces_connection_status[0].workspace_id #=> String
resp.workspaces_connection_status[0].connection_state #=> String, one of "CONNECTED", "DISCONNECTED", "UNKNOWN"
resp.workspaces_connection_status[0].connection_state_check_timestamp #=> Time
resp.workspaces_connection_status[0].last_known_user_connection_timestamp #=> Time
resp.next_token #=> String

Options Hash (options):

  • :workspace_ids (Array<String>)

    The identifiers of the WorkSpaces. You can specify up to 25 WorkSpaces.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Returns:

See Also:

#disassociate_connection_alias(options = {}) ⇒ Struct

Disassociates a connection alias from a directory. Disassociating a connection alias disables cross-Region redirection between two directories in different AWS Regions. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

Before performing this operation, call DescribeConnectionAliases to make sure that the current state of the connection alias is CREATED.

Examples:

Request syntax with placeholder values


resp = client.disassociate_connection_alias({
  alias_id: "ConnectionAliasId", # required
})

Options Hash (options):

  • :alias_id (required, String)

    The identifier of the connection alias to disassociate.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#disassociate_ip_groups(options = {}) ⇒ Struct

Disassociates the specified IP access control group from the specified directory.

Examples:

Request syntax with placeholder values


resp = client.disassociate_ip_groups({
  directory_id: "DirectoryId", # required
  group_ids: ["IpGroupId"], # required
})

Options Hash (options):

  • :directory_id (required, String)

    The identifier of the directory.

  • :group_ids (required, Array<String>)

    The identifiers of one or more IP access control groups.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#import_workspace_image(options = {}) ⇒ Types::ImportWorkspaceImageResult

Imports the specified Windows 10 Bring Your Own License (BYOL) image into Amazon WorkSpaces. The image must be an already licensed Amazon EC2 image that is in your AWS account, and you must own the image. For more information about creating BYOL images, see Bring Your Own Windows Desktop Licenses.

Examples:

Request syntax with placeholder values


resp = client.import_workspace_image({
  ec2_image_id: "Ec2ImageId", # required
  ingestion_process: "BYOL_REGULAR", # required, accepts BYOL_REGULAR, BYOL_GRAPHICS, BYOL_GRAPHICSPRO
  image_name: "WorkspaceImageName", # required
  image_description: "WorkspaceImageDescription", # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
  applications: ["Microsoft_Office_2016"], # accepts Microsoft_Office_2016, Microsoft_Office_2019
})

Response structure


resp.image_id #=> String

Options Hash (options):

  • :ec2_image_id (required, String)

    The identifier of the EC2 image.

  • :ingestion_process (required, String)

    The ingestion process to be used when importing the image. For non-GPU-enabled bundles (bundles other than Graphics or GraphicsPro), specify BYOL_REGULAR.

  • :image_name (required, String)

    The name of the WorkSpace image.

  • :image_description (required, String)

    The description of the WorkSpace image.

  • :tags (Array<Types::Tag>)

    The tags. Each WorkSpaces resource can have a maximum of 50 tags.

  • :applications (Array<String>)

    If specified, the version of Microsoft Office to subscribe to. Valid only for Windows 10 BYOL images. For more information about subscribing to Office for BYOL images, see Bring Your Own Windows Desktop Licenses.

    Although this parameter is an array, only one item is allowed at this time.

Returns:

See Also:

#list_available_management_cidr_ranges(options = {}) ⇒ Types::ListAvailableManagementCidrRangesResult

Retrieves a list of IP address ranges, specified as IPv4 CIDR blocks, that you can use for the network management interface when you enable Bring Your Own License (BYOL).

This operation can be run only by AWS accounts that are enabled for BYOL. If your account isn't enabled for BYOL, you'll receive an AccessDeniedException error.

The management network interface is connected to a secure Amazon WorkSpaces management network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage the WorkSpace.

Examples:

Request syntax with placeholder values


resp = client.list_available_management_cidr_ranges({
  management_cidr_range_constraint: "ManagementCidrRangeConstraint", # required
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.management_cidr_ranges #=> Array
resp.management_cidr_ranges[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :management_cidr_range_constraint (required, String)

    The IP address range to search. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block).

  • :max_results (Integer)

    The maximum number of items to return.

  • :next_token (String)

    If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Returns:

See Also:

#migrate_workspace(options = {}) ⇒ Types::MigrateWorkspaceResult

Migrates a WorkSpace from one operating system or bundle type to another, while retaining the data on the user volume.

The migration process recreates the WorkSpace by using a new root volume from the target bundle image and the user volume from the last available snapshot of the original WorkSpace. During migration, the original D:\Users\%USERNAME% user profile folder is renamed to D:\Users\%USERNAME%MMddyyTHHmmss%.NotMigrated. A new D:\Users\%USERNAME%\ folder is generated by the new OS. Certain files in the old user profile are moved to the new user profile.

For available migration scenarios, details about what happens during migration, and best practices, see Migrate a WorkSpace.

Examples:

Request syntax with placeholder values


resp = client.migrate_workspace({
  source_workspace_id: "WorkspaceId", # required
  bundle_id: "BundleId", # required
})

Response structure


resp.source_workspace_id #=> String
resp.target_workspace_id #=> String

Options Hash (options):

  • :source_workspace_id (required, String)

    The identifier of the WorkSpace to migrate from.

  • :bundle_id (required, String)

    The identifier of the target bundle type to migrate the WorkSpace to.

Returns:

See Also:

#modify_account(options = {}) ⇒ Struct

Modifies the configuration of Bring Your Own License (BYOL) for the specified account.

Examples:

Request syntax with placeholder values


resp = client.({
  dedicated_tenancy_support: "ENABLED", # accepts ENABLED
  dedicated_tenancy_management_cidr_range: "DedicatedTenancyManagementCidrRange",
})

Options Hash (options):

  • :dedicated_tenancy_support (String)

    The status of BYOL.

  • :dedicated_tenancy_management_cidr_range (String)

    The IP address range, specified as an IPv4 CIDR block, for the management network interface. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It must also be specified as available by the ListAvailableManagementCidrRanges operation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#modify_client_properties(options = {}) ⇒ Struct

Modifies the properties of the specified Amazon WorkSpaces clients.

Examples:

Request syntax with placeholder values


resp = client.modify_client_properties({
  resource_id: "NonEmptyString", # required
  client_properties: { # required
    reconnect_enabled: "ENABLED", # accepts ENABLED, DISABLED
  },
})

Options Hash (options):

  • :resource_id (required, String)

    The resource identifiers, in the form of directory IDs.

  • :client_properties (required, Types::ClientProperties)

    Information about the Amazon WorkSpaces client.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#modify_selfservice_permissions(options = {}) ⇒ Struct

Modifies the self-service WorkSpace management capabilities for your users. For more information, see Enable Self-Service WorkSpace Management Capabilities for Your Users.

Examples:

Request syntax with placeholder values


resp = client.modify_selfservice_permissions({
  resource_id: "DirectoryId", # required
  selfservice_permissions: { # required
    restart_workspace: "ENABLED", # accepts ENABLED, DISABLED
    increase_volume_size: "ENABLED", # accepts ENABLED, DISABLED
    change_compute_type: "ENABLED", # accepts ENABLED, DISABLED
    switch_running_mode: "ENABLED", # accepts ENABLED, DISABLED
    rebuild_workspace: "ENABLED", # accepts ENABLED, DISABLED
  },
})

Options Hash (options):

  • :resource_id (required, String)

    The identifier of the directory.

  • :selfservice_permissions (required, Types::SelfservicePermissions)

    The permissions to enable or disable self-service capabilities.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#modify_workspace_access_properties(options = {}) ⇒ Struct

Specifies which devices and operating systems users can use to access their WorkSpaces. For more information, see Control Device Access.

Examples:

Request syntax with placeholder values


resp = client.modify_workspace_access_properties({
  resource_id: "DirectoryId", # required
  workspace_access_properties: { # required
    device_type_windows: "ALLOW", # accepts ALLOW, DENY
    device_type_osx: "ALLOW", # accepts ALLOW, DENY
    device_type_web: "ALLOW", # accepts ALLOW, DENY
    device_type_ios: "ALLOW", # accepts ALLOW, DENY
    device_type_android: "ALLOW", # accepts ALLOW, DENY
    device_type_chrome_os: "ALLOW", # accepts ALLOW, DENY
    device_type_zero_client: "ALLOW", # accepts ALLOW, DENY
  },
})

Options Hash (options):

  • :resource_id (required, String)

    The identifier of the directory.

  • :workspace_access_properties (required, Types::WorkspaceAccessProperties)

    The device types and operating systems to enable or disable for access.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#modify_workspace_creation_properties(options = {}) ⇒ Struct

Modify the default properties used to create WorkSpaces.

Examples:

Request syntax with placeholder values


resp = client.modify_workspace_creation_properties({
  resource_id: "DirectoryId", # required
  workspace_creation_properties: { # required
    enable_work_docs: false,
    enable_internet_access: false,
    default_ou: "DefaultOu",
    custom_security_group_id: "SecurityGroupId",
    user_enabled_as_local_administrator: false,
    enable_maintenance_mode: false,
  },
})

Options Hash (options):

  • :resource_id (required, String)

    The identifier of the directory.

  • :workspace_creation_properties (required, Types::WorkspaceCreationProperties)

    The default properties for creating WorkSpaces.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#modify_workspace_properties(options = {}) ⇒ Struct

Modifies the specified WorkSpace properties. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

Examples:

Request syntax with placeholder values


resp = client.modify_workspace_properties({
  workspace_id: "WorkspaceId", # required
  workspace_properties: { # required
    running_mode: "AUTO_STOP", # accepts AUTO_STOP, ALWAYS_ON
    running_mode_auto_stop_timeout_in_minutes: 1,
    root_volume_size_gib: 1,
    user_volume_size_gib: 1,
    compute_type_name: "VALUE", # accepts VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO, GRAPHICSPRO
  },
})

Options Hash (options):

  • :workspace_id (required, String)

    The identifier of the WorkSpace.

  • :workspace_properties (required, Types::WorkspaceProperties)

    The properties of the WorkSpace.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#modify_workspace_state(options = {}) ⇒ Struct

Sets the state of the specified WorkSpace.

To maintain a WorkSpace without being interrupted, set the WorkSpace state to ADMIN_MAINTENANCE. WorkSpaces in this state do not respond to requests to reboot, stop, start, rebuild, or restore. An AutoStop WorkSpace in this state is not stopped. Users cannot log into a WorkSpace in the ADMIN_MAINTENANCE state.

Examples:

Request syntax with placeholder values


resp = client.modify_workspace_state({
  workspace_id: "WorkspaceId", # required
  workspace_state: "AVAILABLE", # required, accepts AVAILABLE, ADMIN_MAINTENANCE
})

Options Hash (options):

  • :workspace_id (required, String)

    The identifier of the WorkSpace.

  • :workspace_state (required, String)

    The WorkSpace state.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#reboot_workspaces(options = {}) ⇒ Types::RebootWorkspacesResult

Reboots the specified WorkSpaces.

You cannot reboot a WorkSpace unless its state is AVAILABLE or UNHEALTHY.

This operation is asynchronous and returns before the WorkSpaces have rebooted.

Examples:

Request syntax with placeholder values


resp = client.reboot_workspaces({
  reboot_workspace_requests: [ # required
    {
      workspace_id: "WorkspaceId", # required
    },
  ],
})

Response structure


resp.failed_requests #=> Array
resp.failed_requests[0].workspace_id #=> String
resp.failed_requests[0].error_code #=> String
resp.failed_requests[0].error_message #=> String

Options Hash (options):

  • :reboot_workspace_requests (required, Array<Types::RebootRequest>)

    The WorkSpaces to reboot. You can specify up to 25 WorkSpaces.

Returns:

See Also:

#rebuild_workspaces(options = {}) ⇒ Types::RebuildWorkspacesResult

Rebuilds the specified WorkSpace.

You cannot rebuild a WorkSpace unless its state is AVAILABLE, ERROR, UNHEALTHY, STOPPED, or REBOOTING.

Rebuilding a WorkSpace is a potentially destructive action that can result in the loss of data. For more information, see Rebuild a WorkSpace.

This operation is asynchronous and returns before the WorkSpaces have been completely rebuilt.

Examples:

Request syntax with placeholder values


resp = client.rebuild_workspaces({
  rebuild_workspace_requests: [ # required
    {
      workspace_id: "WorkspaceId", # required
    },
  ],
})

Response structure


resp.failed_requests #=> Array
resp.failed_requests[0].workspace_id #=> String
resp.failed_requests[0].error_code #=> String
resp.failed_requests[0].error_message #=> String

Options Hash (options):

  • :rebuild_workspace_requests (required, Array<Types::RebuildRequest>)

    The WorkSpace to rebuild. You can specify a single WorkSpace.

Returns:

See Also:

#register_workspace_directory(options = {}) ⇒ Struct

Registers the specified directory. This operation is asynchronous and returns before the WorkSpace directory is registered. If this is the first time you are registering a directory, you will need to create the workspaces_DefaultRole role before you can register a directory. For more information, see Creating the workspaces_DefaultRole Role.

Examples:

Request syntax with placeholder values


resp = client.register_workspace_directory({
  directory_id: "DirectoryId", # required
  subnet_ids: ["SubnetId"],
  enable_work_docs: false, # required
  enable_self_service: false,
  tenancy: "DEDICATED", # accepts DEDICATED, SHARED
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Options Hash (options):

  • :directory_id (required, String)

    The identifier of the directory. You cannot register a directory if it does not have a status of Active. If the directory does not have a status of Active, you will receive an InvalidResourceStateException error. If you have already registered the maximum number of directories that you can register with Amazon WorkSpaces, you will receive a ResourceLimitExceededException error. Deregister directories that you are not using for WorkSpaces, and try again.

  • :subnet_ids (Array<String>)

    The identifiers of the subnets for your virtual private cloud (VPC). Make sure that the subnets are in supported Availability Zones. The subnets must also be in separate Availability Zones. If these conditions are not met, you will receive an OperationNotSupportedException error.

  • :enable_work_docs (required, Boolean)

    Indicates whether Amazon WorkDocs is enabled or disabled. If you have enabled this parameter and WorkDocs is not available in the Region, you will receive an OperationNotSupportedException error. Set EnableWorkDocs to disabled, and try again.

  • :enable_self_service (Boolean)

    Indicates whether self-service capabilities are enabled or disabled.

  • :tenancy (String)

    Indicates whether your WorkSpace directory is dedicated or shared. To use Bring Your Own License (BYOL) images, this value must be set to DEDICATED and your AWS account must be enabled for BYOL. If your account has not been enabled for BYOL, you will receive an InvalidParameterValuesException error. For more information about BYOL images, see Bring Your Own Windows Desktop Images.

  • :tags (Array<Types::Tag>)

    The tags associated with the directory.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#restore_workspace(options = {}) ⇒ Struct

Restores the specified WorkSpace to its last known healthy state.

You cannot restore a WorkSpace unless its state is AVAILABLE, ERROR, UNHEALTHY, or STOPPED.

Restoring a WorkSpace is a potentially destructive action that can result in the loss of data. For more information, see Restore a WorkSpace.

This operation is asynchronous and returns before the WorkSpace is completely restored.

Examples:

Request syntax with placeholder values


resp = client.restore_workspace({
  workspace_id: "WorkspaceId", # required
})

Options Hash (options):

  • :workspace_id (required, String)

    The identifier of the WorkSpace.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#revoke_ip_rules(options = {}) ⇒ Struct

Removes one or more rules from the specified IP access control group.

Examples:

Request syntax with placeholder values


resp = client.revoke_ip_rules({
  group_id: "IpGroupId", # required
  user_rules: ["IpRule"], # required
})

Options Hash (options):

  • :group_id (required, String)

    The identifier of the group.

  • :user_rules (required, Array<String>)

    The rules to remove from the group.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#start_workspaces(options = {}) ⇒ Types::StartWorkspacesResult

Starts the specified WorkSpaces.

You cannot start a WorkSpace unless it has a running mode of AutoStop and a state of STOPPED.

Examples:

Request syntax with placeholder values


resp = client.start_workspaces({
  start_workspace_requests: [ # required
    {
      workspace_id: "WorkspaceId",
    },
  ],
})

Response structure


resp.failed_requests #=> Array
resp.failed_requests[0].workspace_id #=> String
resp.failed_requests[0].error_code #=> String
resp.failed_requests[0].error_message #=> String

Options Hash (options):

  • :start_workspace_requests (required, Array<Types::StartRequest>)

    The WorkSpaces to start. You can specify up to 25 WorkSpaces.

Returns:

See Also:

#stop_workspaces(options = {}) ⇒ Types::StopWorkspacesResult

Stops the specified WorkSpaces.

You cannot stop a WorkSpace unless it has a running mode of AutoStop and a state of AVAILABLE, IMPAIRED, UNHEALTHY, or ERROR.

Examples:

Request syntax with placeholder values


resp = client.stop_workspaces({
  stop_workspace_requests: [ # required
    {
      workspace_id: "WorkspaceId",
    },
  ],
})

Response structure


resp.failed_requests #=> Array
resp.failed_requests[0].workspace_id #=> String
resp.failed_requests[0].error_code #=> String
resp.failed_requests[0].error_message #=> String

Options Hash (options):

  • :stop_workspace_requests (required, Array<Types::StopRequest>)

    The WorkSpaces to stop. You can specify up to 25 WorkSpaces.

Returns:

See Also:

#terminate_workspaces(options = {}) ⇒ Types::TerminateWorkspacesResult

Terminates the specified WorkSpaces.

Terminating a WorkSpace is a permanent action and cannot be undone. The user's data is destroyed. If you need to archive any user data, contact AWS Support before terminating the WorkSpace.

You can terminate a WorkSpace that is in any state except SUSPENDED.

This operation is asynchronous and returns before the WorkSpaces have been completely terminated. After a WorkSpace is terminated, the TERMINATED state is returned only briefly before the WorkSpace directory metadata is cleaned up, so this state is rarely returned. To confirm that a WorkSpace is terminated, check for the WorkSpace ID by using DescribeWorkSpaces. If the WorkSpace ID isn't returned, then the WorkSpace has been successfully terminated.

Examples:

Request syntax with placeholder values


resp = client.terminate_workspaces({
  terminate_workspace_requests: [ # required
    {
      workspace_id: "WorkspaceId", # required
    },
  ],
})

Response structure


resp.failed_requests #=> Array
resp.failed_requests[0].workspace_id #=> String
resp.failed_requests[0].error_code #=> String
resp.failed_requests[0].error_message #=> String

Options Hash (options):

  • :terminate_workspace_requests (required, Array<Types::TerminateRequest>)

    The WorkSpaces to terminate. You can specify up to 25 WorkSpaces.

Returns:

See Also:

#update_connection_alias_permission(options = {}) ⇒ Struct

Shares or unshares a connection alias with one account by specifying whether that account has permission to associate the connection alias with a directory. If the association permission is granted, the connection alias is shared with that account. If the association permission is revoked, the connection alias is unshared with the account. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

  • Before performing this operation, call DescribeConnectionAliases to make sure that the current state of the connection alias is CREATED.

  • To delete a connection alias that has been shared, the shared account must first disassociate the connection alias from any directories it has been associated with. Then you must unshare the connection alias from the account it has been shared with. You can delete a connection alias only after it is no longer shared with any accounts or associated with any directories.

Examples:

Request syntax with placeholder values


resp = client.update_connection_alias_permission({
  alias_id: "ConnectionAliasId", # required
  connection_alias_permission: { # required
    shared_account_id: "AwsAccount", # required
    allow_association: false, # required
  },
})

Options Hash (options):

  • :alias_id (required, String)

    The identifier of the connection alias that you want to update permissions for.

  • :connection_alias_permission (required, Types::ConnectionAliasPermission)

    Indicates whether to share or unshare the connection alias with the specified AWS account.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_rules_of_ip_group(options = {}) ⇒ Struct

Replaces the current rules of the specified IP access control group with the specified rules.

Examples:

Request syntax with placeholder values


resp = client.update_rules_of_ip_group({
  group_id: "IpGroupId", # required
  user_rules: [ # required
    {
      ip_rule: "IpRule",
      rule_desc: "IpRuleDesc",
    },
  ],
})

Options Hash (options):

  • :group_id (required, String)

    The identifier of the group.

  • :user_rules (required, Array<Types::IpRuleItem>)

    One or more rules.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_workspace_image_permission(options = {}) ⇒ Struct

Shares or unshares an image with one account by specifying whether that account has permission to copy the image. If the copy image permission is granted, the image is shared with that account. If the copy image permission is revoked, the image is unshared with the account. For more information about sharing images, see Share or Unshare a Custom WorkSpaces Image.

  • To delete an image that has been shared, you must unshare the image before you delete it.

  • Sharing Bring Your Own License (BYOL) images across AWS accounts isn't supported at this time in the AWS GovCloud (US-West) Region. To share BYOL images across accounts in the AWS GovCloud (US-West) Region, contact AWS Support.

Examples:

Request syntax with placeholder values


resp = client.update_workspace_image_permission({
  image_id: "WorkspaceImageId", # required
  allow_copy_image: false, # required
  shared_account_id: "AwsAccount", # required
})

Options Hash (options):

  • :image_id (required, String)

    The identifier of the image.

  • :allow_copy_image (required, Boolean)

    The permission to copy the image. This permission can be revoked only after an image has been shared.

  • :shared_account_id (required, String)

    The identifier of the AWS account to share or unshare the image with.

    Before sharing the image, confirm that you are sharing to the correct AWS account ID.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#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 Aws::Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

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

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.