Skip to content

create_workspace

create_workspace(
    workspace_id: Id,
    *,
    config_overrides: Optional[IoTTwinMakerClientConfig] = None,
    description: Optional[Description] = None,
    s3_location: Optional[S3Location] = None,
    role: Optional[RoleArn] = None,
    tags: Optional[TagMap] = None,
) -> CreateWorkspaceResponse

Creates a workplace.

Parameters:

  • workspace_id (Id) –

    The ID of the workspace.

  • description (Optional[Description], default: None ) –

    The description of the workspace.

  • s3_location (Optional[S3Location], default: None ) –

    The ARN of the S3 bucket where resources associated with the workspace are stored.

  • role (Optional[RoleArn], default: None ) –

    The ARN of the execution role associated with the workspace.

  • tags (Optional[TagMap], default: None ) –

    Metadata that you can use to manage the workspace

Raises:

Source code in docs_src/capo_iottwinmaker/_services/io_t_twin_maker.py
def create_workspace(
    self,
    workspace_id: "capo_iottwinmaker.types.id.Id",
    *,
    config_overrides: Optional[IoTTwinMakerClientConfig] = None,
    description: Optional["capo_iottwinmaker.types.description.Description"] = None,
    s3_location: Optional["capo_iottwinmaker.types.s3_location.S3Location"] = None,
    role: Optional["capo_iottwinmaker.types.role_arn.RoleArn"] = None,
    tags: Optional["capo_iottwinmaker.types.tag_map.TagMap"] = None,
) -> "capo_iottwinmaker.types.create_workspace_response.CreateWorkspaceResponse":
    """<p>Creates a workplace.</p>

    Args:
        workspace_id: <p>The ID of the workspace.</p>
        description: <p>The description of the workspace.</p>
        s3_location: <p>The ARN of the S3 bucket where resources associated with the workspace are stored.</p>
        role: <p>The ARN of the execution role associated with the workspace.</p>
        tags: <p>Metadata that you can use to manage the workspace</p>

    Raises:
        capo_iottwinmaker.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_iottwinmaker.errors.conflict_exception.ConflictException: <p>A conflict occurred.</p>
        capo_iottwinmaker.errors.internal_server_exception.InternalServerException: <p>An unexpected error has occurred.</p>
        capo_iottwinmaker.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota was exceeded.</p>
        capo_iottwinmaker.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iottwinmaker.errors.validation_exception.ValidationException: <p>Failed</p>
        capo_iottwinmaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iottwinmaker.types.create_workspace_request.CreateWorkspaceRequest]",
    ) -> OperationResponse[
        "capo_iottwinmaker.types.create_workspace_response.CreateWorkspaceResponse"
    ]:
        import capo_iottwinmaker._operations.aws_io_t_twin_maker.create_workspace

        output, http_response = (
            capo_iottwinmaker._operations.aws_io_t_twin_maker.create_workspace.create_workspace(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkspace")
    )
    input_: capo_iottwinmaker.types.create_workspace_request.CreateWorkspaceRequest = {
        "workspace_id": workspace_id
    }
    if description is not None:
        input_["description"] = description
    if s3_location is not None:
        input_["s3_location"] = s3_location
    if role is not None:
        input_["role"] = role
    if tags is not None:
        input_["tags"] = tags

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