Skip to content

list_notebook_instances async

list_notebook_instances(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    sort_by: Optional[NotebookInstanceSortKey] = None,
    sort_order: Optional[NotebookInstanceSortOrder] = None,
    name_contains: Optional[NotebookInstanceNameContains] = None,
    creation_time_before: Optional[CreationTime] = None,
    creation_time_after: Optional[CreationTime] = None,
    last_modified_time_before: Optional[LastModifiedTime] = None,
    last_modified_time_after: Optional[LastModifiedTime] = None,
    status_equals: Optional[NotebookInstanceStatus] = None,
    notebook_instance_lifecycle_config_name_contains: Optional[
        NotebookInstanceLifecycleConfigName
    ] = None,
    default_code_repository_contains: Optional[CodeRepositoryContains] = None,
    additional_code_repository_equals: Optional[CodeRepositoryNameOrUrl] = None,
) -> ListNotebookInstancesOutput

Returns a list of the SageMaker AI notebook instances in the requester's account in an Amazon Web Services Region.

Parameters:

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

    If the previous call to the ListNotebookInstances is truncated, the response includes a NextToken. You can use this token in your subsequent ListNotebookInstances request to fetch the next set of notebook instances.

    You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.

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

    The maximum number of notebook instances to return.

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

    The field to sort results by. The default is Name.

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

    The sort order for results.

  • name_contains (Optional[NotebookInstanceNameContains], default: None ) –

    A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.

  • creation_time_before (Optional[CreationTime], default: None ) –

    A filter that returns only notebook instances that were created before the specified time (timestamp).

  • creation_time_after (Optional[CreationTime], default: None ) –

    A filter that returns only notebook instances that were created after the specified time (timestamp).

  • last_modified_time_before (Optional[LastModifiedTime], default: None ) –

    A filter that returns only notebook instances that were modified before the specified time (timestamp).

  • last_modified_time_after (Optional[LastModifiedTime], default: None ) –

    A filter that returns only notebook instances that were modified after the specified time (timestamp).

  • status_equals (Optional[NotebookInstanceStatus], default: None ) –

    A filter that returns only notebook instances with the specified status.

  • notebook_instance_lifecycle_config_name_contains (Optional[NotebookInstanceLifecycleConfigName], default: None ) –

    A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.

  • default_code_repository_contains (Optional[CodeRepositoryContains], default: None ) –

    A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.

  • additional_code_repository_equals (Optional[CodeRepositoryNameOrUrl], default: None ) –

    A filter that returns only notebook instances with associated with the specified git repository.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def list_notebook_instances(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    sort_by: Optional[
        "capo_sagemaker.types.notebook_instance_sort_key.NotebookInstanceSortKey"
    ] = None,
    sort_order: Optional[
        "capo_sagemaker.types.notebook_instance_sort_order.NotebookInstanceSortOrder"
    ] = None,
    name_contains: Optional[
        "capo_sagemaker.types.notebook_instance_name_contains.NotebookInstanceNameContains"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.creation_time.CreationTime"
    ] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.creation_time.CreationTime"
    ] = None,
    last_modified_time_before: Optional[
        "capo_sagemaker.types.last_modified_time.LastModifiedTime"
    ] = None,
    last_modified_time_after: Optional[
        "capo_sagemaker.types.last_modified_time.LastModifiedTime"
    ] = None,
    status_equals: Optional[
        "capo_sagemaker.types.notebook_instance_status.NotebookInstanceStatus"
    ] = None,
    notebook_instance_lifecycle_config_name_contains: Optional[
        "capo_sagemaker.types.notebook_instance_lifecycle_config_name.NotebookInstanceLifecycleConfigName"
    ] = None,
    default_code_repository_contains: Optional[
        "capo_sagemaker.types.code_repository_contains.CodeRepositoryContains"
    ] = None,
    additional_code_repository_equals: Optional[
        "capo_sagemaker.types.code_repository_name_or_url.CodeRepositoryNameOrUrl"
    ] = None,
) -> "capo_sagemaker.types.list_notebook_instances_output.ListNotebookInstancesOutput":
    """<p>Returns a list of the SageMaker AI notebook instances in the requester's account in an Amazon Web Services Region. </p>

    Args:
        next_token: <p> If the previous call to the <code>ListNotebookInstances</code> is truncated, the response includes a <code>NextToken</code>. You can use this token in your subsequent <code>ListNotebookInstances</code> request to fetch the next set of notebook instances. </p> <note> <p>You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request. </p> </note>
        max_results: <p>The maximum number of notebook instances to return.</p>
        sort_by: <p>The field to sort results by. The default is <code>Name</code>.</p>
        sort_order: <p>The sort order for results. </p>
        name_contains: <p>A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.</p>
        creation_time_before: <p>A filter that returns only notebook instances that were created before the specified time (timestamp). </p>
        creation_time_after: <p>A filter that returns only notebook instances that were created after the specified time (timestamp).</p>
        last_modified_time_before: <p>A filter that returns only notebook instances that were modified before the specified time (timestamp).</p>
        last_modified_time_after: <p>A filter that returns only notebook instances that were modified after the specified time (timestamp).</p>
        status_equals: <p>A filter that returns only notebook instances with the specified status.</p>
        notebook_instance_lifecycle_config_name_contains: <p>A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.</p>
        default_code_repository_contains: <p>A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.</p>
        additional_code_repository_equals: <p>A filter that returns only notebook instances with associated with the specified git repository.</p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.list_notebook_instances_input.ListNotebookInstancesInput]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.list_notebook_instances_output.ListNotebookInstancesOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.list_notebook_instances

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.list_notebook_instances.async_list_notebook_instances(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListNotebookInstances")
    )
    input_: capo_sagemaker.types.list_notebook_instances_input.ListNotebookInstancesInput = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if name_contains is not None:
        input_["name_contains"] = name_contains
    if creation_time_before is not None:
        input_["creation_time_before"] = creation_time_before
    if creation_time_after is not None:
        input_["creation_time_after"] = creation_time_after
    if last_modified_time_before is not None:
        input_["last_modified_time_before"] = last_modified_time_before
    if last_modified_time_after is not None:
        input_["last_modified_time_after"] = last_modified_time_after
    if status_equals is not None:
        input_["status_equals"] = status_equals
    if notebook_instance_lifecycle_config_name_contains is not None:
        input_["notebook_instance_lifecycle_config_name_contains"] = (
            notebook_instance_lifecycle_config_name_contains
        )
    if default_code_repository_contains is not None:
        input_["default_code_repository_contains"] = (
            default_code_repository_contains
        )
    if additional_code_repository_equals is not None:
        input_["additional_code_repository_equals"] = (
            additional_code_repository_equals
        )

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