Table of Contents
WorkSpaces.
Client
¶A low-level client representing Amazon WorkSpaces:
import boto3
client = boto3.client('workspaces')
These are the available methods:
can_paginate()
create_workspaces()
describe_workspace_bundles()
describe_workspace_directories()
describe_workspaces()
generate_presigned_url()
get_paginator()
get_waiter()
reboot_workspaces()
rebuild_workspaces()
terminate_workspaces()
can_paginate
(operation_name)¶Check if an operation can be paginated.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Returns: | True if the operation can be paginated,
False otherwise. |
create_workspaces
(**kwargs)¶Creates one or more WorkSpaces.
Note
This operation is asynchronous and returns before the WorkSpaces are created.
Request Syntax
response = client.create_workspaces(
Workspaces=[
{
'DirectoryId': 'string',
'UserName': 'string',
'BundleId': 'string'
},
]
)
Parameters: | Workspaces (list) -- [REQUIRED] An array of structures that specify the WorkSpaces to create.
|
---|---|
Return type: | 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
|
describe_workspace_bundles
(**kwargs)¶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
response = client.describe_workspace_bundles(
BundleIds=[
'string',
],
Owner='string',
NextToken='string'
)
Parameters: |
|
---|---|
Return type: | 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
|
describe_workspace_directories
(**kwargs)¶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
response = client.describe_workspace_directories(
DirectoryIds=[
'string',
],
NextToken='string'
)
Parameters: |
|
---|---|
Return type: | 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
|
describe_workspaces
(**kwargs)¶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
response = client.describe_workspaces(
WorkspaceIds=[
'string',
],
DirectoryId='string',
UserName='string',
BundleId='string',
Limit=123,
NextToken='string'
)
Parameters: |
|
---|---|
Return type: | 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
|
generate_presigned_url
(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
Parameters: |
|
---|---|
Returns: | The presigned url |
get_paginator
(operation_name)¶Create a paginator for an operation.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Raises OperationNotPageableError: | |
Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
|
Return type: | L{botocore.paginate.Paginator} |
Returns: | A paginator object. |
get_waiter
(waiter_name)¶reboot_workspaces
(**kwargs)¶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
response = client.reboot_workspaces(
RebootWorkspaceRequests=[
{
'WorkspaceId': 'string'
},
]
)
Parameters: | RebootWorkspaceRequests (list) -- [REQUIRED] An array of structures that specify the WorkSpaces to reboot.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'FailedRequests': [
{
'WorkspaceId': 'string',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
]
}
Response Structure
|
rebuild_workspaces
(**kwargs)¶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:
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
response = client.rebuild_workspaces(
RebuildWorkspaceRequests=[
{
'WorkspaceId': 'string'
},
]
)
Parameters: | RebuildWorkspaceRequests (list) -- [REQUIRED] An array of structures that specify the WorkSpaces to rebuild.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'FailedRequests': [
{
'WorkspaceId': 'string',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
]
}
Response Structure
|
terminate_workspaces
(**kwargs)¶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
response = client.terminate_workspaces(
TerminateWorkspaceRequests=[
{
'WorkspaceId': 'string'
},
]
)
Parameters: | TerminateWorkspaceRequests (list) -- [REQUIRED] An array of structures that specify the WorkSpaces to terminate.
|
---|---|
Return type: | dict |
Returns: | Response Syntax{
'FailedRequests': [
{
'WorkspaceId': 'string',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
]
}
Response Structure
|