Skip to content

update_notebook

update_notebook(
    domain_identifier: DomainId,
    identifier: NotebookId,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional[Description] = None,
    status: Optional[NotebookStatus] = None,
    name: Optional[NotebookName] = None,
    cell_order: Optional[CellOrder] = None,
    type: Optional[NotebookType] = None,
    metadata: Optional[Metadata] = None,
    parameters: Optional[Parameters] = None,
    environment_configuration: Optional[EnvironmentConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateNotebookOutput

Updates a notebook in Amazon SageMaker Unified Studio.

Parameters:

  • domain_identifier (DomainId) –

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

  • identifier (NotebookId) –

    The identifier of the notebook to update.

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

    The updated description of the notebook.

  • status (Optional[NotebookStatus], default: None ) –

    The updated status of the notebook.

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

    The updated name of the notebook.

  • cell_order (Optional[CellOrder], default: None ) –

    The updated ordered list of cells in the notebook.

  • type (Optional[NotebookType], default: None ) –

    The updated type of the notebook.

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

    The updated metadata for the notebook, specified as key-value pairs.

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

    The updated sensitive parameters for the notebook, specified as key-value pairs.

  • environment_configuration (Optional[EnvironmentConfig], default: None ) –

    The updated environment configuration for 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 update_notebook(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    identifier: "capo_datazone.types.notebook_id.NotebookId",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
    status: Optional["capo_datazone.types.notebook_status.NotebookStatus"] = None,
    name: Optional["capo_datazone.types.notebook_name.NotebookName"] = None,
    cell_order: Optional["capo_datazone.types.cell_order.CellOrder"] = None,
    type: Optional["capo_datazone.types.notebook_type.NotebookType"] = None,
    metadata: Optional["capo_datazone.types.metadata.Metadata"] = None,
    parameters: Optional["capo_datazone.types.parameters.Parameters"] = None,
    environment_configuration: Optional[
        "capo_datazone.types.environment_config.EnvironmentConfig"
    ] = None,
    client_token: Optional["capo_datazone.types.client_token.ClientToken"] = None,
) -> "capo_datazone.types.update_notebook_output.UpdateNotebookOutput":
    """<p>Updates a <a href="https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/notebooks.html">notebook</a> in Amazon SageMaker Unified Studio.</p>

    Args:
        domain_identifier: <p>The identifier of the Amazon SageMaker Unified Studio domain in which the notebook exists.</p>
        identifier: <p>The identifier of the notebook to update.</p>
        description: <p>The updated description of the notebook.</p>
        status: <p>The updated status of the notebook.</p>
        name: <p>The updated name of the notebook.</p>
        cell_order: <p>The updated ordered list of cells in the notebook.</p>
        type: <p>The updated type of the notebook.</p>
        metadata: <p>The updated metadata for the notebook, specified as key-value pairs.</p>
        parameters: <p>The updated sensitive parameters for the notebook, specified as key-value pairs.</p>
        environment_configuration: <p>The updated environment configuration for 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.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.update_notebook_input.UpdateNotebookInput]",
    ) -> OperationResponse[
        "capo_datazone.types.update_notebook_output.UpdateNotebookOutput"
    ]:
        import capo_datazone._operations.data_zone.update_notebook

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

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

        return capo_datazone.types.update_notebook_input.redact_sensitive(input_)

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

        return capo_datazone.types.update_notebook_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateNotebook",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.update_notebook_input.UpdateNotebookInput = {
        "domain_identifier": domain_identifier,
        "identifier": identifier,
    }
    if description is not None:
        input_["description"] = description
    if status is not None:
        input_["status"] = status
    if name is not None:
        input_["name"] = name
    if cell_order is not None:
        input_["cell_order"] = cell_order
    if type is not None:
        input_["type"] = type
    if metadata is not None:
        input_["metadata"] = metadata
    if parameters is not None:
        input_["parameters"] = parameters
    if environment_configuration is not None:
        input_["environment_configuration"] = environment_configuration
    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