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

Class: Aws::WorkSpaces::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



152
153
154
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 152

def initialize(*args)
  super
end

Instance Method Details

#create_tags(params = {}) ⇒ Struct

Creates tags for a WorkSpace.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :resource_id (required, String)

    The resource ID of the request.

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

    The tags of the request.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



184
185
186
187
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 184

def create_tags(params = {}, options = {})
  req = build_request(:create_tags, params)
  req.send_request(options)
end

#create_workspaces(params = {}) ⇒ 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,
      },
      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 #=> Boolean
resp.failed_requests[0].workspace_request.root_volume_encryption_enabled #=> Boolean
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.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", "MAINTENANCE", "TERMINATING", "TERMINATED", "SUSPENDED", "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 #=> Boolean
resp.pending_requests[0].root_volume_encryption_enabled #=> Boolean
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

Parameters:

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

    ({})

Options Hash (params):

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

    An array of structures that specify the WorkSpaces to create.

Returns:

See Also:



266
267
268
269
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 266

def create_workspaces(params = {}, options = {})
  req = build_request(:create_workspaces, params)
  req.send_request(options)
end

#delete_tags(params = {}) ⇒ Struct

Deletes tags from a WorkSpace.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :resource_id (required, String)

    The resource ID of the request.

  • :tag_keys (required, Array<String>)

    The tag keys of the request.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



292
293
294
295
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 292

def delete_tags(params = {}, options = {})
  req = build_request(:delete_tags, params)
  req.send_request(options)
end

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

Describes tags for a WorkSpace.

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

Parameters:

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

    ({})

Options Hash (params):

  • :resource_id (required, String)

    The resource ID of the request.

Returns:

See Also:



322
323
324
325
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 322

def describe_tags(params = {}, options = {})
  req = build_request(:describe_tags, params)
  req.send_request(options)
end

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

Obtains information about the WorkSpace bundles that are available to your account in the specified region.

You can filter the results with either the BundleIds parameter, or the Owner parameter, but not both.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the NextToken response member contains a token that you pass in the next call to this operation to retrieve the next set of items.

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].user_storage.capacity #=> String
resp.bundles[0].compute_type.name #=> String, one of "VALUE", "STANDARD", "PERFORMANCE"
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :bundle_ids (Array<String>)

    An array of strings that contains the identifiers of the bundles to retrieve. This parameter cannot be combined with any other filter parameter.

  • :owner (String)

    The owner of the bundles to retrieve. This parameter cannot be combined with any other filter parameter.

    This contains one of the following values:

    • null- Retrieves the bundles that belong to the account making the call.

    • AMAZON- Retrieves the bundles that are provided by AWS.

  • :next_token (String)

    The NextToken value from a previous call to this operation. Pass null if this is the first call.

Returns:

See Also:



386
387
388
389
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 386

def describe_workspace_bundles(params = {}, options = {})
  req = build_request(:describe_workspace_bundles, params)
  req.send_request(options)
end

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

Retrieves information about the AWS Directory Service directories in the region that are registered with Amazon WorkSpaces and are available to your account.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the NextToken response member contains a token that you pass in the next call to this operation to retrieve the next set of items.

Examples:

Request syntax with placeholder values


resp = client.describe_workspace_directories({
  directory_ids: ["DirectoryId"],
  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 #=> Boolean
resp.directories[0].workspace_creation_properties.enable_internet_access #=> Boolean
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 #=> Boolean
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :directory_ids (Array<String>)

    An array of strings that contains the directory identifiers to retrieve information for. If this member is null, all directories are retrieved.

  • :next_token (String)

    The NextToken value from a previous call to this operation. Pass null if this is the first call.

Returns:

See Also:



448
449
450
451
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 448

def describe_workspace_directories(params = {}, options = {})
  req = build_request(:describe_workspace_directories, params)
  req.send_request(options)
end

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

Obtains information about the specified WorkSpaces.

Only one of the filter parameters, such as BundleId, DirectoryId, or WorkspaceIds, can be specified at a time.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the NextToken response member contains a token that you pass in the next call to this operation to retrieve the next set of items.

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", "MAINTENANCE", "TERMINATING", "TERMINATED", "SUSPENDED", "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 #=> Boolean
resp.workspaces[0].root_volume_encryption_enabled #=> Boolean
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.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :workspace_ids (Array<String>)

    An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This parameter cannot be combined with any other filter parameter.

    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)

    Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a specific directory user with the UserName parameter. This parameter cannot be combined with any other filter parameter.

  • :user_name (String)

    Used with the DirectoryId parameter to specify the directory user for whom to obtain the WorkSpace.

  • :bundle_id (String)

    The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle will be retrieved. This parameter cannot be combined with any other filter parameter.

  • :limit (Integer)

    The maximum number of items to return.

  • :next_token (String)

    The NextToken value from a previous call to this operation. Pass null if this is the first call.

Returns:

See Also:



534
535
536
537
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 534

def describe_workspaces(params = {}, options = {})
  req = build_request(:describe_workspaces, params)
  req.send_request(options)
end

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

Describes the connection status of a specified WorkSpace.

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

Parameters:

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

    ({})

Options Hash (params):

  • :workspace_ids (Array<String>)

    An array of strings that contain the identifiers of the WorkSpaces.

  • :next_token (String)

    The next token of the request.

Returns:

See Also:



572
573
574
575
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 572

def describe_workspaces_connection_status(params = {}, options = {})
  req = build_request(:describe_workspaces_connection_status, params)
  req.send_request(options)
end

#modify_workspace_properties(params = {}) ⇒ Struct

Modifies the WorkSpace properties, including the running mode and AutoStop time.

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,
  },
})

Parameters:

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

    ({})

Options Hash (params):

  • :workspace_id (required, String)

    The ID of the WorkSpace.

  • :workspace_properties (required, Types::WorkspaceProperties)

    The WorkSpace properties of the request.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



602
603
604
605
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 602

def modify_workspace_properties(params = {}, options = {})
  req = build_request(:modify_workspace_properties, params)
  req.send_request(options)
end

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

Reboots the specified WorkSpaces.

To be able to reboot a WorkSpace, the WorkSpace must have a State of AVAILABLE, IMPAIRED, or INOPERABLE.

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

Parameters:

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

    ({})

Options Hash (params):

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

    An array of structures that specify the WorkSpaces to reboot.

Returns:

See Also:



645
646
647
648
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 645

def reboot_workspaces(params = {}, options = {})
  req = build_request(:reboot_workspaces, params)
  req.send_request(options)
end

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

Rebuilds the specified WorkSpaces.

Rebuilding a WorkSpace is a potentially destructive action that can result in the loss of data. Rebuilding a WorkSpace causes the following to occur:

  • The system is restored to the image of the bundle that the WorkSpace is created from. Any applications that have been installed, or system settings that have been made since the WorkSpace was created will be lost.

  • The data drive (D drive) is re-created from the last automatic snapshot taken of the data drive. The current contents of the data drive are overwritten. Automatic snapshots of the data drive are taken every 12 hours, so the snapshot can be as much as 12 hours old.

To be able to rebuild a WorkSpace, the WorkSpace must have a State of AVAILABLE or ERROR.

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

Parameters:

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

    ({})

Options Hash (params):

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

    An array of structures that specify the WorkSpaces to rebuild.

Returns:

See Also:



703
704
705
706
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 703

def rebuild_workspaces(params = {}, options = {})
  req = build_request(:rebuild_workspaces, params)
  req.send_request(options)
end

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

Starts the specified WorkSpaces. The WorkSpaces must have 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

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



739
740
741
742
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 739

def start_workspaces(params = {}, options = {})
  req = build_request(:start_workspaces, params)
  req.send_request(options)
end

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

Stops the specified WorkSpaces. The WorkSpaces must have 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

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



776
777
778
779
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 776

def stop_workspaces(params = {}, options = {})
  req = build_request(:stop_workspaces, params)
  req.send_request(options)
end

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

Terminates the specified WorkSpaces.

Terminating a WorkSpace is a permanent action and cannot be undone. The user's data is not maintained and will be destroyed. If you need to archive any user data, contact Amazon Web Services 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.

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

Parameters:

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

    ({})

Options Hash (params):

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

    An array of structures that specify the WorkSpaces to terminate.

Returns:

See Also:



823
824
825
826
# File 'gems/aws-sdk-workspaces/lib/aws-sdk-workspaces/client.rb', line 823

def terminate_workspaces(params = {}, options = {})
  req = build_request(:terminate_workspaces, params)
  req.send_request(options)
end