Skip to content

create_space

create_space(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    domain_id: Optional[DomainId] = None,
    space_name: Optional[SpaceName] = None,
    tags: Optional[TagList] = None,
    space_settings: Optional[SpaceSettings] = None,
    ownership_settings: Optional[OwnershipSettings] = None,
    space_sharing_settings: Optional[SpaceSharingSettings] = None,
    space_display_name: Optional[NonEmptyString64] = None,
) -> CreateSpaceResponse

Creates a private space or a space used for real time collaboration in a domain.

Parameters:

  • domain_id (Optional[DomainId], default: None ) –

    The ID of the associated domain.

  • space_name (Optional[SpaceName], default: None ) –

    The name of the space.

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

    Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the Search API.

  • space_settings (Optional[SpaceSettings], default: None ) –

    A collection of space settings.

  • ownership_settings (Optional[OwnershipSettings], default: None ) –

    A collection of ownership settings.

  • space_sharing_settings (Optional[SpaceSharingSettings], default: None ) –

    A collection of space sharing settings.

  • space_display_name (Optional[NonEmptyString64], default: None ) –

    The name of the space that appears in the SageMaker Studio UI.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_space(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    domain_id: Optional["capo_sagemaker.types.domain_id.DomainId"] = None,
    space_name: Optional["capo_sagemaker.types.space_name.SpaceName"] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    space_settings: Optional[
        "capo_sagemaker.types.space_settings.SpaceSettings"
    ] = None,
    ownership_settings: Optional[
        "capo_sagemaker.types.ownership_settings.OwnershipSettings"
    ] = None,
    space_sharing_settings: Optional[
        "capo_sagemaker.types.space_sharing_settings.SpaceSharingSettings"
    ] = None,
    space_display_name: Optional[
        "capo_sagemaker.types.non_empty_string64.NonEmptyString64"
    ] = None,
) -> "capo_sagemaker.types.create_space_response.CreateSpaceResponse":
    """<p>Creates a private space or a space used for real time collaboration in a domain.</p>

    Args:
        domain_id: <p>The ID of the associated domain.</p>
        space_name: <p>The name of the space.</p>
        tags: <p>Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the <code>Search</code> API.</p>
        space_settings: <p>A collection of space settings.</p>
        ownership_settings: <p>A collection of ownership settings.</p>
        space_sharing_settings: <p>A collection of space sharing settings.</p>
        space_display_name: <p>The name of the space that appears in the SageMaker Studio UI.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_space_request.CreateSpaceRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_space_response.CreateSpaceResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_space

        output, http_response = (
            capo_sagemaker._operations.sage_maker.create_space.create_space(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSpace")
    )
    input_: capo_sagemaker.types.create_space_request.CreateSpaceRequest = {}
    if domain_id is not None:
        input_["domain_id"] = domain_id
    if space_name is not None:
        input_["space_name"] = space_name
    if tags is not None:
        input_["tags"] = tags
    if space_settings is not None:
        input_["space_settings"] = space_settings
    if ownership_settings is not None:
        input_["ownership_settings"] = ownership_settings
    if space_sharing_settings is not None:
        input_["space_sharing_settings"] = space_sharing_settings
    if space_display_name is not None:
        input_["space_display_name"] = space_display_name

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