Amazon WorkSpaces

2020/07/23 - Amazon WorkSpaces - 2 new 1 updated api methods

Changes  Added UpdateWorkspaceImagePermission API to share Amazon WorkSpaces images across AWS accounts.

DescribeWorkspaceImagePermissions (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.describe_workspace_image_permissions(
    ImageId='string',
    NextToken='string',
    MaxResults=123
)
type ImageId

string

param ImageId

[REQUIRED]

The identifier of the image.

type NextToken

string

param NextToken

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

type MaxResults

integer

param MaxResults

The maximum number of items to return.

rtype

dict

returns

Response Syntax

{
    'ImageId': 'string',
    'ImagePermissions': [
        {
            'SharedAccountId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ImageId (string) --

      The identifier of the image.

    • ImagePermissions (list) --

      The identifiers of the AWS accounts that the image has been shared with.

      • (dict) --

        Describes the AWS accounts that have been granted permission to use a shared image.

        • SharedAccountId (string) --

          The identifier of the AWS account that an image has been shared with.

    • NextToken (string) --

      The token to use to retrieve the next set of results, or null if no more results are available.

UpdateWorkspaceImagePermission (new) Link ¶

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.

Note

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

See also: AWS API Documentation

Request Syntax

client.update_workspace_image_permission(
    ImageId='string',
    AllowCopyImage=True|False,
    SharedAccountId='string'
)
type ImageId

string

param ImageId

[REQUIRED]

The identifier of the image.

type AllowCopyImage

boolean

param AllowCopyImage

[REQUIRED]

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

type SharedAccountId

string

param SharedAccountId

[REQUIRED]

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

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

DescribeWorkspaceImages (updated) Link ¶
Changes (request, response)
Request
{'ImageType': 'OWNED | SHARED'}
Response
{'Images': {'Created': 'timestamp', 'OwnerAccountId': 'string'}}

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

See also: AWS API Documentation

Request Syntax

client.describe_workspace_images(
    ImageIds=[
        'string',
    ],
    ImageType='OWNED'|'SHARED',
    NextToken='string',
    MaxResults=123
)
type ImageIds

list

param ImageIds

The identifier of the image.

  • (string) --

type ImageType

string

param ImageType

The type (owned or shared) of the image.

type NextToken

string

param NextToken

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

type MaxResults

integer

param MaxResults

The maximum number of items to return.

rtype

dict

returns

Response Syntax

{
    'Images': [
        {
            'ImageId': 'string',
            'Name': 'string',
            'Description': 'string',
            'OperatingSystem': {
                'Type': 'WINDOWS'|'LINUX'
            },
            'State': 'AVAILABLE'|'PENDING'|'ERROR',
            'RequiredTenancy': 'DEFAULT'|'DEDICATED',
            'ErrorCode': 'string',
            'ErrorMessage': 'string',
            'Created': datetime(2015, 1, 1),
            'OwnerAccountId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Images (list) --

      Information about the images.

      • (dict) --

        Describes a WorkSpace image.

        • ImageId (string) --

          The identifier of the image.

        • Name (string) --

          The name of the image.

        • Description (string) --

          The description of the image.

        • OperatingSystem (dict) --

          The operating system that the image is running.

          • Type (string) --

            The operating system.

        • State (string) --

          The status of the image.

        • RequiredTenancy (string) --

          Specifies whether the image is running on dedicated hardware. When Bring Your Own License (BYOL) is enabled, this value is set to DEDICATED . For more information, see Bring Your Own Windows Desktop Images.

        • ErrorCode (string) --

          The error code that is returned for the image.

        • ErrorMessage (string) --

          The text of the error message that is returned for the image.

        • Created (datetime) --

          The date when the image was created. If the image has been shared, the AWS account that the image has been shared with sees the original creation date of the image.

        • OwnerAccountId (string) --

          The identifier of the AWS account that owns the image.

    • NextToken (string) --

      The token to use to retrieve the next set of results, or null if no more results are available.