Amazon WorkSpaces

2016/08/18 - Amazon WorkSpaces - 4 new 2 updated api methods

Changes  Adds new APIs to support the launch and management of WorkSpaces that are paid for and used by the hour.

ModifyWorkspaceProperties (new) Link ¶

Modifies the WorkSpace properties, including the RunningMode and AutoStop time.

Request Syntax

client.modify_workspace_properties(
    WorkspaceId='string',
    WorkspaceProperties={
        'RunningMode': 'AUTO_STOP'|'ALWAYS_ON',
        'RunningModeAutoStopTimeoutInMinutes': 123
    }
)
type WorkspaceId

string

param WorkspaceId

[REQUIRED]

The ID of the WorkSpace.

type WorkspaceProperties

dict

param WorkspaceProperties

[REQUIRED]

The WorkSpace properties of the request.

  • RunningMode (string) --

    The running mode of the WorkSpace. AlwaysOn WorkSpaces are billed monthly. AutoStop WorkSpaces are billed by the hour and stopped when no longer being used in order to save on costs.

  • RunningModeAutoStopTimeoutInMinutes (integer) --

    The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60 minute intervals.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

StartWorkspaces (new) Link ¶

Starts the specified WorkSpaces. The API only works with WorkSpaces that have RunningMode configured as AutoStop and the State set to “STOPPED.”

Request Syntax

client.start_workspaces(
    StartWorkspaceRequests=[
        {
            'WorkspaceId': 'string'
        },
    ]
)
type StartWorkspaceRequests

list

param StartWorkspaceRequests

[REQUIRED]

The requests.

  • (dict) --

    Describes the start request.

    • WorkspaceId (string) --

      The ID of the WorkSpace.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • FailedRequests (list) --

      The failed requests.

      • (dict) --

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

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The textual error message.

DescribeWorkspacesConnectionStatus (new) Link ¶

Describes the connection status of a specified WorkSpace.

Request Syntax

client.describe_workspaces_connection_status(
    WorkspaceIds=[
        'string',
    ],
    NextToken='string'
)
type WorkspaceIds

list

param WorkspaceIds

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

  • (string) --

type NextToken

string

param NextToken

The next token of the request.

rtype

dict

returns

Response Syntax

{
    'WorkspacesConnectionStatus': [
        {
            'WorkspaceId': 'string',
            'ConnectionState': 'CONNECTED'|'DISCONNECTED'|'UNKNOWN',
            'ConnectionStateCheckTimestamp': datetime(2015, 1, 1),
            'LastKnownUserConnectionTimestamp': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • WorkspacesConnectionStatus (list) --

      The connection status of the WorkSpace.

      • (dict) --

        Describes the connection status of a WorkSpace.

        • WorkspaceId (string) --

          The ID of the WorkSpace.

        • ConnectionState (string) --

          The connection state of the WorkSpace. Returns UNKOWN if the WorkSpace is in a Stopped state.

        • ConnectionStateCheckTimestamp (datetime) --

          The timestamp of the connection state check.

        • LastKnownUserConnectionTimestamp (datetime) --

          The timestamp of the last known user connection.

    • NextToken (string) --

      The next token of the result.

StopWorkspaces (new) Link ¶

Stops the specified WorkSpaces. The API only works with WorkSpaces that have RunningMode configured as AutoStop and the State set to AVAILABLE, IMPAIRED, UNHEALTHY, or ERROR.

Request Syntax

client.stop_workspaces(
    StopWorkspaceRequests=[
        {
            'WorkspaceId': 'string'
        },
    ]
)
type StopWorkspaceRequests

list

param StopWorkspaceRequests

[REQUIRED]

The requests.

  • (dict) --

    Describes the stop request.

    • WorkspaceId (string) --

      The ID of the WorkSpace.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • FailedRequests (list) --

      The failed requests.

      • (dict) --

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

        • WorkspaceId (string) --

          The identifier of the WorkSpace.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The textual error message.

CreateWorkspaces (updated) Link ¶
Changes (request, response)
Request
{'Workspaces': {'WorkspaceProperties': {'RunningMode': 'AUTO_STOP | ALWAYS_ON',
                                        'RunningModeAutoStopTimeoutInMinutes': 'integer'}}}
Response
{'FailedRequests': {'WorkspaceRequest': {'WorkspaceProperties': {'RunningMode': 'AUTO_STOP '
                                                                                '| '
                                                                                'ALWAYS_ON',
                                                                 'RunningModeAutoStopTimeoutInMinutes': 'integer'}}},
 'PendingRequests': {'State': {'MAINTENANCE',
                               'STARTING',
                               'STOPPED',
                               'STOPPING'},
                     'WorkspaceProperties': {'RunningMode': 'AUTO_STOP | '
                                                            'ALWAYS_ON',
                                             'RunningModeAutoStopTimeoutInMinutes': 'integer'}}}

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',
            'VolumeEncryptionKey': 'string',
            'UserVolumeEncryptionEnabled': True|False,
            'RootVolumeEncryptionEnabled': True|False,
            'WorkspaceProperties': {
                'RunningMode': 'AUTO_STOP'|'ALWAYS_ON',
                'RunningModeAutoStopTimeoutInMinutes': 123
            },
            'Tags': [
                {
                    'Key': 'string',
                    'Value': '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.

    • VolumeEncryptionKey (string) --

      The KMS key used to encrypt data stored on your WorkSpace.

    • UserVolumeEncryptionEnabled (boolean) --

      Specifies whether the data stored on the user volume, or D: drive, is encrypted.

    • RootVolumeEncryptionEnabled (boolean) --

      Specifies whether the data stored on the root volume, or C: drive, is encrypted.

    • WorkspaceProperties (dict) --

      Describes the properties of a WorkSpace.

      • RunningMode (string) --

        The running mode of the WorkSpace. AlwaysOn WorkSpaces are billed monthly. AutoStop WorkSpaces are billed by the hour and stopped when no longer being used in order to save on costs.

      • RunningModeAutoStopTimeoutInMinutes (integer) --

        The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60 minute intervals.

    • Tags (list) --

      The tags of the WorkSpace request.

      • (dict) --

        Describes the tag of the WorkSpace.

        • Key (string) -- [REQUIRED]

          The key of the tag.

        • Value (string) --

          The value of the tag.

rtype

dict

returns

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceRequest': {
                'DirectoryId': 'string',
                'UserName': 'string',
                'BundleId': 'string',
                'VolumeEncryptionKey': 'string',
                'UserVolumeEncryptionEnabled': True|False,
                'RootVolumeEncryptionEnabled': True|False,
                'WorkspaceProperties': {
                    'RunningMode': 'AUTO_STOP'|'ALWAYS_ON',
                    'RunningModeAutoStopTimeoutInMinutes': 123
                },
                'Tags': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ]
            },
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ],
    'PendingRequests': [
        {
            'WorkspaceId': 'string',
            'DirectoryId': 'string',
            'UserName': 'string',
            'IpAddress': 'string',
            'State': 'PENDING'|'AVAILABLE'|'IMPAIRED'|'UNHEALTHY'|'REBOOTING'|'STARTING'|'REBUILDING'|'MAINTENANCE'|'TERMINATING'|'TERMINATED'|'SUSPENDED'|'STOPPING'|'STOPPED'|'ERROR',
            'BundleId': 'string',
            'SubnetId': 'string',
            'ErrorMessage': 'string',
            'ErrorCode': 'string',
            'ComputerName': 'string',
            'VolumeEncryptionKey': 'string',
            'UserVolumeEncryptionEnabled': True|False,
            'RootVolumeEncryptionEnabled': True|False,
            'WorkspaceProperties': {
                'RunningMode': 'AUTO_STOP'|'ALWAYS_ON',
                'RunningModeAutoStopTimeoutInMinutes': 123
            }
        },
    ]
}

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 FailedCreateWorkspaceRequest$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.

          • VolumeEncryptionKey (string) --

            The KMS key used to encrypt data stored on your WorkSpace.

          • UserVolumeEncryptionEnabled (boolean) --

            Specifies whether the data stored on the user volume, or D: drive, is encrypted.

          • RootVolumeEncryptionEnabled (boolean) --

            Specifies whether the data stored on the root volume, or C: drive, is encrypted.

          • WorkspaceProperties (dict) --

            Describes the properties of a WorkSpace.

            • RunningMode (string) --

              The running mode of the WorkSpace. AlwaysOn WorkSpaces are billed monthly. AutoStop WorkSpaces are billed by the hour and stopped when no longer being used in order to save on costs.

            • RunningModeAutoStopTimeoutInMinutes (integer) --

              The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60 minute intervals.

          • Tags (list) --

            The tags of the WorkSpace request.

            • (dict) --

              Describes the tag of the WorkSpace.

              • Key (string) --

                The key of the tag.

              • Value (string) --

                The value of the tag.

        • 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.

        • ComputerName (string) --

          The name of the WorkSpace as seen by the operating system.

        • VolumeEncryptionKey (string) --

          The KMS key used to encrypt data stored on your WorkSpace.

        • UserVolumeEncryptionEnabled (boolean) --

          Specifies whether the data stored on the user volume, or D: drive, is encrypted.

        • RootVolumeEncryptionEnabled (boolean) --

          Specifies whether the data stored on the root volume, or C: drive, is encrypted.

        • WorkspaceProperties (dict) --

          Describes the properties of a WorkSpace.

          • RunningMode (string) --

            The running mode of the WorkSpace. AlwaysOn WorkSpaces are billed monthly. AutoStop WorkSpaces are billed by the hour and stopped when no longer being used in order to save on costs.

          • RunningModeAutoStopTimeoutInMinutes (integer) --

            The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60 minute intervals.

DescribeWorkspaces (updated) Link ¶
Changes (response)
{'Workspaces': {'State': {'STOPPED', 'STARTING', 'MAINTENANCE', 'STOPPING'},
                'WorkspaceProperties': {'RunningMode': 'AUTO_STOP | ALWAYS_ON',
                                        'RunningModeAutoStopTimeoutInMinutes': 'integer'}}}

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 it returns is not immediately available. If you immediately call DescribeWorkspaces with this identifier, no information is 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 whom 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'|'STARTING'|'REBUILDING'|'MAINTENANCE'|'TERMINATING'|'TERMINATED'|'SUSPENDED'|'STOPPING'|'STOPPED'|'ERROR',
            'BundleId': 'string',
            'SubnetId': 'string',
            'ErrorMessage': 'string',
            'ErrorCode': 'string',
            'ComputerName': 'string',
            'VolumeEncryptionKey': 'string',
            'UserVolumeEncryptionEnabled': True|False,
            'RootVolumeEncryptionEnabled': True|False,
            'WorkspaceProperties': {
                'RunningMode': 'AUTO_STOP'|'ALWAYS_ON',
                'RunningModeAutoStopTimeoutInMinutes': 123
            }
        },
    ],
    '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.

        • ComputerName (string) --

          The name of the WorkSpace as seen by the operating system.

        • VolumeEncryptionKey (string) --

          The KMS key used to encrypt data stored on your WorkSpace.

        • UserVolumeEncryptionEnabled (boolean) --

          Specifies whether the data stored on the user volume, or D: drive, is encrypted.

        • RootVolumeEncryptionEnabled (boolean) --

          Specifies whether the data stored on the root volume, or C: drive, is encrypted.

        • WorkspaceProperties (dict) --

          Describes the properties of a WorkSpace.

          • RunningMode (string) --

            The running mode of the WorkSpace. AlwaysOn WorkSpaces are billed monthly. AutoStop WorkSpaces are billed by the hour and stopped when no longer being used in order to save on costs.

          • RunningModeAutoStopTimeoutInMinutes (integer) --

            The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60 minute intervals.

    • 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 time frame.