Skip to content

start_session

start_session(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    resource_identifier: Optional[ResourceIdentifier] = None,
) -> StartSessionResponse

Initiates a remote connection session between a local integrated development environments (IDEs) and a remote SageMaker space.

Parameters:

  • resource_identifier (Optional[ResourceIdentifier], default: None ) –

    The Amazon Resource Name (ARN) of the resource to which the remote connection will be established. For example, this identifies the specific ARN space application you want to connect to from your local IDE.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def start_session(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    resource_identifier: Optional[
        "capo_sagemaker.types.resource_identifier.ResourceIdentifier"
    ] = None,
) -> "capo_sagemaker.types.start_session_response.StartSessionResponse":
    """<p>Initiates a remote connection session between a local integrated development environments (IDEs) and a remote SageMaker space.</p>

    Args:
        resource_identifier: <p>The Amazon Resource Name (ARN) of the resource to which the remote connection will be established. For example, this identifies the specific ARN space application you want to connect to from your local IDE.</p>

    Raises:
        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.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.start_session_request.StartSessionRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.start_session_response.StartSessionResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.start_session

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartSession")
    )
    input_: capo_sagemaker.types.start_session_request.StartSessionRequest = {}
    if resource_identifier is not None:
        input_["resource_identifier"] = resource_identifier

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