Skip to content

start_notebook_run async

start_notebook_run(
    domain_identifier: DomainId,
    owning_project_identifier: ProjectId,
    notebook_identifier: NotebookId,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    schedule_identifier: Optional[ScheduleId] = None,
    compute_configuration: Optional[ComputeConfig] = None,
    network_configuration: Optional[NetworkConfig] = None,
    timeout_configuration: Optional[TimeoutConfig] = None,
    notification_configuration: Optional[NotificationConfig] = None,
    trigger_source: Optional[TriggerSource] = None,
    metadata: Optional[Metadata] = None,
    parameters: Optional[Parameters] = None,
    client_token: Optional[ClientToken] = None,
) -> StartNotebookRunOutput

Starts a notebook run in Amazon SageMaker Unified Studio. A notebook run represents the execution of an Amazon SageMaker notebook within a project. You can configure compute, network, timeout, and environment settings for the run.

Parameters:

  • domain_identifier (DomainId) –

    The identifier of the Amazon SageMaker Unified Studio domain in which the notebook run is started.

  • owning_project_identifier (ProjectId) –

    The identifier of the project that owns the notebook run.

  • notebook_identifier (NotebookId) –

    The identifier of the notebook to run.

  • schedule_identifier (Optional[ScheduleId], default: None ) –

    The identifier of the schedule associated with the notebook run.

  • compute_configuration (Optional[ComputeConfig], default: None ) –

    The compute configuration for the notebook run, including instance type and environment version.

  • network_configuration (Optional[NetworkConfig], default: None ) –

    The network configuration for the notebook run, including network access type and optional VPC settings.

  • timeout_configuration (Optional[TimeoutConfig], default: None ) –

    The timeout configuration for the notebook run. The default timeout is 720 minutes (12 hours) and the maximum is 1440 minutes (24 hours).

  • notification_configuration (Optional[NotificationConfig], default: None ) –

    The notification configuration for the notebook run. Use this to specify the notebook run states that trigger notifications.

  • trigger_source (Optional[TriggerSource], default: None ) –

    The source that triggered the notebook run.

  • metadata (Optional[Metadata], default: None ) –

    The metadata for the notebook run, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.

  • parameters (Optional[Parameters], default: None ) –

    The sensitive parameters for the notebook run, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def start_notebook_run(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    owning_project_identifier: "capo_datazone.types.project_id.ProjectId",
    notebook_identifier: "capo_datazone.types.notebook_id.NotebookId",
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    schedule_identifier: Optional[
        "capo_datazone.types.schedule_id.ScheduleId"
    ] = None,
    compute_configuration: Optional[
        "capo_datazone.types.compute_config.ComputeConfig"
    ] = None,
    network_configuration: Optional[
        "capo_datazone.types.network_config.NetworkConfig"
    ] = None,
    timeout_configuration: Optional[
        "capo_datazone.types.timeout_config.TimeoutConfig"
    ] = None,
    notification_configuration: Optional[
        "capo_datazone.types.notification_config.NotificationConfig"
    ] = None,
    trigger_source: Optional[
        "capo_datazone.types.trigger_source.TriggerSource"
    ] = None,
    metadata: Optional["capo_datazone.types.metadata.Metadata"] = None,
    parameters: Optional["capo_datazone.types.parameters.Parameters"] = None,
    client_token: Optional["capo_datazone.types.client_token.ClientToken"] = None,
) -> "capo_datazone.types.start_notebook_run_output.StartNotebookRunOutput":
    """<p>Starts a notebook run in Amazon SageMaker Unified Studio. A notebook run represents the execution of an <a href="https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/notebooks.html">Amazon SageMaker notebook</a> within a project. You can configure compute, network, timeout, and environment settings for the run.</p>

    Args:
        domain_identifier: <p>The identifier of the Amazon SageMaker Unified Studio domain in which the notebook run is started.</p>
        owning_project_identifier: <p>The identifier of the project that owns the notebook run.</p>
        notebook_identifier: <p>The identifier of the notebook to run.</p>
        schedule_identifier: <p>The identifier of the schedule associated with the notebook run.</p>
        compute_configuration: <p>The compute configuration for the notebook run, including instance type and environment version.</p>
        network_configuration: <p>The network configuration for the notebook run, including network access type and optional VPC settings.</p>
        timeout_configuration: <p>The timeout configuration for the notebook run. The default timeout is 720 minutes (12 hours) and the maximum is 1440 minutes (24 hours).</p>
        notification_configuration: <p>The notification configuration for the notebook run. Use this to specify the notebook run states that trigger notifications.</p>
        trigger_source: <p>The source that triggered the notebook run.</p>
        metadata: <p>The metadata for the notebook run, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
        parameters: <p>The sensitive parameters for the notebook run, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.conflict_exception.ConflictException: <p>There is a conflict while performing this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request has exceeded the specified service quota.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.start_notebook_run_input.StartNotebookRunInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.start_notebook_run_output.StartNotebookRunOutput"
    ]:
        import capo_datazone._operations.data_zone.start_notebook_run

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.start_notebook_run.async_start_notebook_run(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datazone.types.start_notebook_run_input.StartNotebookRunInput",
    ) -> dict[str, Any]:
        import capo_datazone.types.start_notebook_run_input

        return capo_datazone.types.start_notebook_run_input.redact_sensitive(input_)

    def _redact_output(
        output: "capo_datazone.types.start_notebook_run_output.StartNotebookRunOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.start_notebook_run_output

        return capo_datazone.types.start_notebook_run_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartNotebookRun",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.start_notebook_run_input.StartNotebookRunInput = {
        "domain_identifier": domain_identifier,
        "owning_project_identifier": owning_project_identifier,
        "notebook_identifier": notebook_identifier,
    }
    if schedule_identifier is not None:
        input_["schedule_identifier"] = schedule_identifier
    if compute_configuration is not None:
        input_["compute_configuration"] = compute_configuration
    if network_configuration is not None:
        input_["network_configuration"] = network_configuration
    if timeout_configuration is not None:
        input_["timeout_configuration"] = timeout_configuration
    if notification_configuration is not None:
        input_["notification_configuration"] = notification_configuration
    if trigger_source is not None:
        input_["trigger_source"] = trigger_source
    if metadata is not None:
        input_["metadata"] = metadata
    if parameters is not None:
        input_["parameters"] = parameters
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output