Amazon WorkSpaces

2015/04/09 - Amazon WorkSpaces - 7 new api methods

DescribeWorkspaceDirectories (new) Link ¶

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.

Request Syntax

client.describe_workspace_directories(
    DirectoryIds=[
        'string',
    ],
    NextToken='string'
)
type DirectoryIds

list

param DirectoryIds

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

  • (string) --

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Directories': [
        {
            'DirectoryId': 'string',
            'Alias': 'string',
            'DirectoryName': 'string',
            'RegistrationCode': 'string',
            'SubnetIds': [
                'string',
            ],
            'DnsIpAddresses': [
                'string',
            ],
            'CustomerUserName': 'string',
            'IamRoleId': 'string',
            'DirectoryType': 'SIMPLE_AD'|'AD_CONNECTOR',
            'WorkspaceSecurityGroupId': 'string',
            'State': 'REGISTERING'|'REGISTERED'|'DEREGISTERING'|'DEREGISTERED'|'ERROR',
            'WorkspaceCreationProperties': {
                'EnableWorkDocs': True|False,
                'EnableInternetAccess': True|False,
                'DefaultOu': 'string',
                'CustomSecurityGroupId': 'string',
                'UserEnabledAsLocalAdministrator': True|False
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the results of the DescribeWorkspaceDirectories operation.

    • Directories (list) --

      An array of structures that contain information about the directories.

      • (dict) --

        Contains information about an AWS Directory Service directory for use with Amazon WorkSpaces.

        • DirectoryId (string) --

          The directory identifier.

        • Alias (string) --

          The directory alias.

        • DirectoryName (string) --

          The name of the directory.

        • RegistrationCode (string) --

          The registration code for the directory. This is the code that users enter in their Amazon WorkSpaces client application to connect to the directory.

        • SubnetIds (list) --

          An array of strings that contains the identifiers of the subnets used with the directory.

          • (string) --

        • DnsIpAddresses (list) --

          An array of strings that contains the IP addresses of the DNS servers for the directory.

          • (string) --

        • CustomerUserName (string) --

          The user name for the service account.

        • IamRoleId (string) --

          The identifier of the IAM role. This is the role that allows Amazon WorkSpaces to make calls to other services, such as Amazon EC2, on your behalf.

        • DirectoryType (string) --

          The directory type.

        • WorkspaceSecurityGroupId (string) --

          The identifier of the security group that is assigned to new WorkSpaces.

        • State (string) --

          The state of the directory's registration with Amazon WorkSpaces

        • WorkspaceCreationProperties (dict) --

          A structure that specifies the default creation properties for all WorkSpaces in the directory.

          • EnableWorkDocs (boolean) --

            Specifies if the directory is enabled for Amazon WorkDocs.

          • EnableInternetAccess (boolean) --

            A public IP address will be attached to all WorkSpaces that are created or rebuilt.

          • DefaultOu (string) --

            The organizational unit (OU) in the directory that the WorkSpace machine accounts are placed in.

          • CustomSecurityGroupId (string) --

            The identifier of any custom security groups that are applied to the WorkSpaces when they are created.

          • UserEnabledAsLocalAdministrator (boolean) --

            The WorkSpace user is an administrator on the WorkSpace.

    • NextToken (string) --

      If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to this operation to retrieve the next set of items. This token is valid for one day and must be used within that timeframe.

DescribeWorkspaces (new) Link ¶

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.

Request Syntax

client.describe_workspaces(
    WorkspaceIds=[
        'string',
    ],
    DirectoryId='string',
    UserName='string',
    BundleId='string',
    Limit=123,
    NextToken='string'
)
type WorkspaceIds

list

param WorkspaceIds

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 returned by CreateWorkspaces is not immediately available. If you immediately call DescribeWorkspaces with this identifier, no information will be returned.

  • (string) --

type DirectoryId

string

param DirectoryId

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.

type UserName

string

param UserName

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

type BundleId

string

param BundleId

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.

type Limit

integer

param Limit

The maximum number of items to return.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Workspaces': [
        {
            'WorkspaceId': 'string',
            'DirectoryId': 'string',
            'UserName': 'string',
            'IpAddress': 'string',
            'State': 'PENDING'|'AVAILABLE'|'IMPAIRED'|'UNHEALTHY'|'REBOOTING'|'REBUILDING'|'TERMINATING'|'TERMINATED'|'SUSPENDED'|'ERROR',
            'BundleId': 'string',
            'SubnetId': 'string',
            'ErrorMessage': 'string',
            'ErrorCode': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the results for the DescribeWorkspaces operation.

    • Workspaces (list) --

      An array of structures that contain the information about the WorkSpaces.

      Because the CreateWorkspaces operation is asynchronous, some of this information may be incomplete for a newly-created WorkSpace.

      • (dict) --

        Contains information about a WorkSpace.

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • DirectoryId (string) --

          The identifier of the AWS Directory Service directory that the WorkSpace belongs to.

        • UserName (string) --

          The user that the WorkSpace is assigned to.

        • IpAddress (string) --

          The IP address of the WorkSpace.

        • State (string) --

          The operational state of the WorkSpace.

        • BundleId (string) --

          The identifier of the bundle that the WorkSpace was created from.

        • SubnetId (string) --

          The identifier of the subnet that the WorkSpace is in.

        • ErrorMessage (string) --

          If the WorkSpace could not be created, this contains a textual error message that describes the failure.

        • ErrorCode (string) --

          If the WorkSpace could not be created, this contains the error code.

    • NextToken (string) --

      If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to this operation to retrieve the next set of items. This token is valid for one day and must be used within that timeframe.

DescribeWorkspaceBundles (new) Link ¶

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.

Request Syntax

client.describe_workspace_bundles(
    BundleIds=[
        'string',
    ],
    Owner='string',
    NextToken='string'
)
type BundleIds

list

param BundleIds

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

  • (string) --

type Owner

string

param Owner

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.

type NextToken

string

param NextToken

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

rtype

dict

returns

Response Syntax

{
    'Bundles': [
        {
            'BundleId': 'string',
            'Name': 'string',
            'Owner': 'string',
            'Description': 'string',
            'UserStorage': {
                'Capacity': 'string'
            },
            'ComputeType': {
                'Name': 'VALUE'|'STANDARD'|'PERFORMANCE'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the results of the DescribeWorkspaceBundles operation.

    • Bundles (list) --

      An array of structures that contain information about the bundles.

      • (dict) --

        Contains information about a WorkSpace bundle.

        • BundleId (string) --

          The bundle identifier.

        • Name (string) --

          The name of the bundle.

        • Owner (string) --

          The owner of the bundle. This contains the owner's account identifier, or AMAZON if the bundle is provided by AWS.

        • Description (string) --

          The bundle description.

        • UserStorage (dict) --

          A UserStorage object that specifies the amount of user storage that the bundle contains.

          • Capacity (string) --

            The amount of user storage for the bundle.

        • ComputeType (dict) --

          A ComputeType object that specifies the compute type for the bundle.

          • Name (string) --

            The name of the compute type for the bundle.

    • NextToken (string) --

      If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to this operation to retrieve the next set of items. This token is valid for one day and must be used within that timeframe.

TerminateWorkspaces (new) Link ¶

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 .

Note

This operation is asynchronous and will return before the WorkSpaces have been completely terminated.

Request Syntax

client.terminate_workspaces(
    TerminateWorkspaceRequests=[
        {
            'WorkspaceId': 'string'
        },
    ]
)
type TerminateWorkspaceRequests

list

param TerminateWorkspaceRequests

[REQUIRED]

An array of structures that specify the WorkSpaces to terminate.

  • (dict) --

    Contains information used with the TerminateWorkspaces operation to terminate a WorkSpace.

    • WorkspaceId (string) -- [REQUIRED]

      The identifier of the WorkSpace to terminate.

rtype

dict

returns

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceId': 'string',
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the results of the TerminateWorkspaces operation.

    • FailedRequests (list) --

      An array of structures that represent any WorkSpaces that could not be terminated.

      • (dict) --

        Contains information about a WorkSpace that could not be rebooted ( RebootWorkspaces ), rebuilt ( RebuildWorkspaces ), or terminated ( TerminateWorkspaces ).

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The textual error message.

CreateWorkspaces (new) Link ¶

Creates one or more WorkSpaces.

Note

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

Request Syntax

client.create_workspaces(
    Workspaces=[
        {
            'DirectoryId': 'string',
            'UserName': 'string',
            'BundleId': 'string'
        },
    ]
)
type Workspaces

list

param Workspaces

[REQUIRED]

An array of structures that specify the WorkSpaces to create.

  • (dict) --

    Contains information about a WorkSpace creation request.

    • DirectoryId (string) -- [REQUIRED]

      The identifier of the AWS Directory Service directory to create the WorkSpace in. You can use the DescribeWorkspaceDirectories operation to obtain a list of the directories that are available.

    • UserName (string) -- [REQUIRED]

      The username that the WorkSpace is assigned to. This username must exist in the AWS Directory Service directory specified by the DirectoryId member.

    • BundleId (string) -- [REQUIRED]

      The identifier of the bundle to create the WorkSpace from. You can use the DescribeWorkspaceBundles operation to obtain a list of the bundles that are available.

rtype

dict

returns

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceRequest': {
                'DirectoryId': 'string',
                'UserName': 'string',
                'BundleId': 'string'
            },
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ],
    'PendingRequests': [
        {
            'WorkspaceId': 'string',
            'DirectoryId': 'string',
            'UserName': 'string',
            'IpAddress': 'string',
            'State': 'PENDING'|'AVAILABLE'|'IMPAIRED'|'UNHEALTHY'|'REBOOTING'|'REBUILDING'|'TERMINATING'|'TERMINATED'|'SUSPENDED'|'ERROR',
            'BundleId': 'string',
            'SubnetId': 'string',
            'ErrorMessage': 'string',
            'ErrorCode': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the result of the CreateWorkspaces operation.

    • FailedRequests (list) --

      An array of structures that represent the WorkSpaces that could not be created.

      • (dict) --

        Contains information about a WorkSpace that could not be created.

        • WorkspaceRequest (dict) --

          A WorkspaceRequest object that contains the information about the WorkSpace that could not be created.

          • DirectoryId (string) --

            The identifier of the AWS Directory Service directory to create the WorkSpace in. You can use the DescribeWorkspaceDirectories operation to obtain a list of the directories that are available.

          • UserName (string) --

            The username that the WorkSpace is assigned to. This username must exist in the AWS Directory Service directory specified by the DirectoryId member.

          • BundleId (string) --

            The identifier of the bundle to create the WorkSpace from. You can use the DescribeWorkspaceBundles operation to obtain a list of the bundles that are available.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The textual error message.

    • PendingRequests (list) --

      An array of structures that represent the WorkSpaces that were created.

      Because this operation is asynchronous, the identifier in WorkspaceId is not immediately available. If you immediately call DescribeWorkspaces with this identifier, no information will be returned.

      • (dict) --

        Contains information about a WorkSpace.

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • DirectoryId (string) --

          The identifier of the AWS Directory Service directory that the WorkSpace belongs to.

        • UserName (string) --

          The user that the WorkSpace is assigned to.

        • IpAddress (string) --

          The IP address of the WorkSpace.

        • State (string) --

          The operational state of the WorkSpace.

        • BundleId (string) --

          The identifier of the bundle that the WorkSpace was created from.

        • SubnetId (string) --

          The identifier of the subnet that the WorkSpace is in.

        • ErrorMessage (string) --

          If the WorkSpace could not be created, this contains a textual error message that describes the failure.

        • ErrorCode (string) --

          If the WorkSpace could not be created, this contains the error code.

RebuildWorkspaces (new) Link ¶

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 .

Note

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

Request Syntax

client.rebuild_workspaces(
    RebuildWorkspaceRequests=[
        {
            'WorkspaceId': 'string'
        },
    ]
)
type RebuildWorkspaceRequests

list

param RebuildWorkspaceRequests

[REQUIRED]

An array of structures that specify the WorkSpaces to rebuild.

  • (dict) --

    Contains information used with the RebuildWorkspaces operation to rebuild a WorkSpace.

    • WorkspaceId (string) -- [REQUIRED]

      The identifier of the WorkSpace to rebuild.

rtype

dict

returns

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceId': 'string',
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the results of the RebuildWorkspaces operation.

    • FailedRequests (list) --

      An array of structures that represent any WorkSpaces that could not be rebuilt.

      • (dict) --

        Contains information about a WorkSpace that could not be rebooted ( RebootWorkspaces ), rebuilt ( RebuildWorkspaces ), or terminated ( TerminateWorkspaces ).

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The textual error message.

RebootWorkspaces (new) Link ¶

Reboots the specified WorkSpaces.

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

Note

This operation is asynchronous and will return before the WorkSpaces have rebooted.

Request Syntax

client.reboot_workspaces(
    RebootWorkspaceRequests=[
        {
            'WorkspaceId': 'string'
        },
    ]
)
type RebootWorkspaceRequests

list

param RebootWorkspaceRequests

[REQUIRED]

An array of structures that specify the WorkSpaces to reboot.

  • (dict) --

    Contains information used with the RebootWorkspaces operation to reboot a WorkSpace.

    • WorkspaceId (string) -- [REQUIRED]

      The identifier of the WorkSpace to reboot.

rtype

dict

returns

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceId': 'string',
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the results of the RebootWorkspaces operation.

    • FailedRequests (list) --

      An array of structures that represent any WorkSpaces that could not be rebooted.

      • (dict) --

        Contains information about a WorkSpace that could not be rebooted ( RebootWorkspaces ), rebuilt ( RebuildWorkspaces ), or terminated ( TerminateWorkspaces ).

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The textual error message.