Skip to content

start_notebook_sync

start_notebook_sync(
    domain_identifier: DomainId,
    owning_project_identifier: ProjectId,
    source_location: SourceLocation,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    git_metadata: Optional[GitMetadata] = None,
    notebook_id: Optional[NotebookId] = None,
    name: Optional[NotebookName] = None,
    description: Optional[Description] = None,
    client_token: Optional[ClientToken] = None,
) -> StartNotebookSyncOutput

Starts a notebook sync in Amazon SageMaker Unified Studio. This operation syncs a notebook from a Git repository into a project.

Parameters:

  • domain_identifier (DomainId) –

    The identifier of the Amazon SageMaker Unified Studio domain in which to sync the notebook.

  • owning_project_identifier (ProjectId) –

    The identifier of the project that will own the synced notebook.

  • source_location (SourceLocation) –

    The source location of the notebook to sync. This specifies the Amazon Simple Storage Service URI of the notebook file.

  • git_metadata (Optional[GitMetadata], default: None ) –

    The Git metadata for the notebook sync, including repository, branch, and commit information.

  • notebook_id (Optional[NotebookId], default: None ) –

    The identifier of an existing notebook to sync. If not specified, a new notebook is created.

  • name (Optional[NotebookName], default: None ) –

    The name of the notebook. The name must be between 1 and 256 characters.

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

    The description of the notebook.

  • 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/data_zone.py
def start_notebook_sync(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    owning_project_identifier: "capo_datazone.types.project_id.ProjectId",
    source_location: "capo_datazone.types.source_location.SourceLocation",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    git_metadata: Optional["capo_datazone.types.git_metadata.GitMetadata"] = None,
    notebook_id: Optional["capo_datazone.types.notebook_id.NotebookId"] = None,
    name: Optional["capo_datazone.types.notebook_name.NotebookName"] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
    client_token: Optional["capo_datazone.types.client_token.ClientToken"] = None,
) -> "capo_datazone.types.start_notebook_sync_output.StartNotebookSyncOutput":
    """<p>Starts a notebook sync in Amazon SageMaker Unified Studio. This operation syncs a notebook from a Git repository into a project.</p>

    Args:
        domain_identifier: <p>The identifier of the Amazon SageMaker Unified Studio domain in which to sync the notebook.</p>
        owning_project_identifier: <p>The identifier of the project that will own the synced notebook.</p>
        source_location: <p>The source location of the notebook to sync. This specifies the Amazon Simple Storage Service URI of the notebook file.</p>
        git_metadata: <p>The Git metadata for the notebook sync, including repository, branch, and commit information.</p>
        notebook_id: <p>The identifier of an existing notebook to sync. If not specified, a new notebook is created.</p>
        name: <p>The name of the notebook. The name must be between 1 and 256 characters.</p>
        description: <p>The description of the notebook.</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.
    """

    def _handler(
        req: "OperationRequest[capo_datazone.types.start_notebook_sync_input.StartNotebookSyncInput]",
    ) -> OperationResponse[
        "capo_datazone.types.start_notebook_sync_output.StartNotebookSyncOutput"
    ]:
        import capo_datazone._operations.data_zone.start_notebook_sync

        output, http_response = (
            capo_datazone._operations.data_zone.start_notebook_sync.start_notebook_sync(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_datazone.types.start_notebook_sync_input.redact_sensitive(
            input_
        )

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

        return capo_datazone.types.start_notebook_sync_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartNotebookSync",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.start_notebook_sync_input.StartNotebookSyncInput = {
        "domain_identifier": domain_identifier,
        "owning_project_identifier": owning_project_identifier,
        "source_location": source_location,
    }
    if git_metadata is not None:
        input_["git_metadata"] = git_metadata
    if notebook_id is not None:
        input_["notebook_id"] = notebook_id
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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