Skip to content

describe_workspaces

describe_workspaces(
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    workspace_ids: Optional[WorkspaceIdList] = None,
    directory_id: Optional[DirectoryId] = None,
    user_name: Optional[UserName] = None,
    bundle_id: Optional[BundleId] = None,
    limit: Optional[Limit] = None,
    next_token: Optional[PaginationToken] = None,
    workspace_name: Optional[WorkspaceName] = None,
) -> DescribeWorkspacesResult

Describes the specified WorkSpaces.

You can filter the results by using the bundle identifier, directory identifier, or owner, but you can specify only one filter at a time.

Parameters:

  • workspace_ids (Optional[WorkspaceIdList], default: None ) –

    The identifiers of the WorkSpaces. You cannot combine this parameter with any other filter.

    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 (Optional[DirectoryId], default: None ) –

    The identifier of the directory. In addition, you can optionally specify a specific directory user (see UserName). You cannot combine this parameter with any other filter.

  • user_name (Optional[UserName], default: None ) –

    The name of the directory user. You must specify this parameter with DirectoryId.

  • bundle_id (Optional[BundleId], default: None ) –

    The identifier of the bundle. All WorkSpaces that are created from this bundle are retrieved. You cannot combine this parameter with any other filter.

  • limit (Optional[Limit], default: None ) –

    The maximum number of items to return.

  • next_token (Optional[PaginationToken], default: None ) –

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

  • workspace_name (Optional[WorkspaceName], default: None ) –

    The name of the user-decoupled WorkSpace.

Raises:

Source code in docs_src/capo_workspaces/_services/work_spaces.py
def describe_workspaces(
    self,
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    workspace_ids: Optional[
        "capo_workspaces.types.workspace_id_list.WorkspaceIdList"
    ] = None,
    directory_id: Optional["capo_workspaces.types.directory_id.DirectoryId"] = None,
    user_name: Optional["capo_workspaces.types.user_name.UserName"] = None,
    bundle_id: Optional["capo_workspaces.types.bundle_id.BundleId"] = None,
    limit: Optional["capo_workspaces.types.limit.Limit"] = None,
    next_token: Optional[
        "capo_workspaces.types.pagination_token.PaginationToken"
    ] = None,
    workspace_name: Optional[
        "capo_workspaces.types.workspace_name.WorkspaceName"
    ] = None,
) -> "capo_workspaces.types.describe_workspaces_result.DescribeWorkspacesResult":
    """<p>Describes the specified WorkSpaces.</p> <p>You can filter the results by using the bundle identifier, directory identifier, or owner, but you can specify only one filter at a time.</p>

    Args:
        workspace_ids: <p>The identifiers of the WorkSpaces. You cannot combine this parameter with any other filter.</p> <p>Because the <a>CreateWorkspaces</a> operation is asynchronous, the identifier it returns is not immediately available. If you immediately call <a>DescribeWorkspaces</a> with this identifier, no information is returned.</p>
        directory_id: <p>The identifier of the directory. In addition, you can optionally specify a specific directory user (see <code>UserName</code>). You cannot combine this parameter with any other filter.</p>
        user_name: <p>The name of the directory user. You must specify this parameter with <code>DirectoryId</code>.</p>
        bundle_id: <p>The identifier of the bundle. All WorkSpaces that are created from this bundle are retrieved. You cannot combine this parameter with any other filter.</p>
        limit: <p>The maximum number of items to return.</p>
        next_token: <p>If you received a <code>NextToken</code> from a previous call that was paginated, provide this token to receive the next set of results.</p>
        workspace_name: <p>The name of the user-decoupled WorkSpace.</p>

    Raises:
        capo_workspaces.errors.invalid_parameter_values_exception.InvalidParameterValuesException: <p>One or more parameter values are not valid.</p>
        capo_workspaces.errors.resource_unavailable_exception.ResourceUnavailableException: <p>The specified resource is not available.</p>
        capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workspaces.types.describe_workspaces_request.DescribeWorkspacesRequest]",
    ) -> OperationResponse[
        "capo_workspaces.types.describe_workspaces_result.DescribeWorkspacesResult"
    ]:
        import capo_workspaces._operations.workspaces_service.describe_workspaces

        output, http_response = (
            capo_workspaces._operations.workspaces_service.describe_workspaces.describe_workspaces(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeWorkspaces")
    )
    input_: capo_workspaces.types.describe_workspaces_request.DescribeWorkspacesRequest = {}
    if workspace_ids is not None:
        input_["workspace_ids"] = workspace_ids
    if directory_id is not None:
        input_["directory_id"] = directory_id
    if user_name is not None:
        input_["user_name"] = user_name
    if bundle_id is not None:
        input_["bundle_id"] = bundle_id
    if limit is not None:
        input_["limit"] = limit
    if next_token is not None:
        input_["next_token"] = next_token
    if workspace_name is not None:
        input_["workspace_name"] = workspace_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output