Skip to content

list_notebooks async

list_notebooks(
    domain_identifier: DomainId,
    owning_project_identifier: ProjectId,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    sort_order: Optional[SortOrder] = None,
    sort_by: Optional[SortKey] = None,
    status: Optional[NotebookStatus] = None,
    type: Optional[NotebookType] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListNotebooksOutput

Lists notebooks in Amazon SageMaker Unified Studio.

Parameters:

  • domain_identifier (DomainId) –

    The identifier of the Amazon SageMaker Unified Studio domain in which to list notebooks.

  • owning_project_identifier (ProjectId) –

    The identifier of the project that owns the notebooks.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of notebooks to return in a single call. When the number of notebooks exceeds the value of MaxResults, the response contains a NextToken value.

  • sort_order (Optional[SortOrder], default: None ) –

    The sort order for the results.

  • sort_by (Optional[SortKey], default: None ) –

    The field to sort the results by.

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

    The status to filter notebooks by.

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

    The type to filter notebooks by.

  • next_token (Optional[PaginationToken], default: None ) –

    When the number of notebooks is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of notebooks, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListNotebooks to list the next set of notebooks.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def list_notebooks(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    owning_project_identifier: "capo_datazone.types.project_id.ProjectId",
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    max_results: Optional["capo_datazone.types.max_results.MaxResults"] = None,
    sort_order: Optional["capo_datazone.types.sort_order.SortOrder"] = None,
    sort_by: Optional["capo_datazone.types.sort_key.SortKey"] = None,
    status: Optional["capo_datazone.types.notebook_status.NotebookStatus"] = None,
    type: Optional["capo_datazone.types.notebook_type.NotebookType"] = None,
    next_token: Optional[
        "capo_datazone.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_datazone.types.list_notebooks_output.ListNotebooksOutput":
    """<p>Lists <a href="https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/notebooks.html">notebooks</a> in Amazon SageMaker Unified Studio.</p>

    Args:
        domain_identifier: <p>The identifier of the Amazon SageMaker Unified Studio domain in which to list notebooks.</p>
        owning_project_identifier: <p>The identifier of the project that owns the notebooks.</p>
        max_results: <p>The maximum number of notebooks to return in a single call. When the number of notebooks exceeds the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value.</p>
        sort_order: <p>The sort order for the results.</p>
        sort_by: <p>The field to sort the results by.</p>
        status: <p>The status to filter notebooks by.</p>
        type: <p>The type to filter notebooks by.</p>
        next_token: <p>When the number of notebooks is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of notebooks, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>ListNotebooks</code> to list the next set of notebooks.</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.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</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.list_notebooks_input.ListNotebooksInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.list_notebooks_output.ListNotebooksOutput"
    ]:
        import capo_datazone._operations.data_zone.list_notebooks

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

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

        return capo_datazone.types.list_notebooks_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListNotebooks", redact_output=_redact_output),
    )
    input_: capo_datazone.types.list_notebooks_input.ListNotebooksInput = {
        "domain_identifier": domain_identifier,
        "owning_project_identifier": owning_project_identifier,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if status is not None:
        input_["status"] = status
    if type is not None:
        input_["type"] = type
    if next_token is not None:
        input_["next_token"] = next_token

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