Skip to content

list_datasets async

list_datasets(
    domain_id: DomainId,
    *,
    config_overrides: Optional[AsyncConnectHealthClientConfig] = None,
    type: Optional[DatasetType] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> ListDatasetsOutput

Lists the Datasets in a Domain. You can list only the datasets of one type. The operation doesn't return datasets whose status is DELETED, and the order of the results isn't specified. We recommend using pagination to ensure that the operation returns quickly and successfully.

Datasets are in preview release and are subject to change.

Parameters:

  • domain_id (DomainId) –

    The unique identifier of the parent Domain.

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

    Returns only datasets of this type.

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

    The token for the next page of results, from a previous ListDatasets response. If you don't specify a value, the operation returns the first page of results.

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

    The maximum number of datasets to return in one page. The default is 100.

Raises:

Source code in docs_src/capo_connecthealth/_services/async_connect_health.py
async def list_datasets(
    self,
    domain_id: "capo_connecthealth.types.domain_id.DomainId",
    *,
    config_overrides: Optional[AsyncConnectHealthClientConfig] = None,
    type: Optional["capo_connecthealth.types.dataset_type.DatasetType"] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> "capo_connecthealth.types.list_datasets_output.ListDatasetsOutput":
    """<p>Lists the Datasets in a Domain. You can list only the datasets of one type. The operation doesn't return datasets whose status is DELETED, and the order of the results isn't specified. We recommend using pagination to ensure that the operation returns quickly and successfully.</p> <p>Datasets are in preview release and are subject to change.</p>

    Args:
        domain_id: <p>The unique identifier of the parent Domain.</p>
        type: <p>Returns only datasets of this type.</p>
        next_token: <p>The token for the next page of results, from a previous ListDatasets response. If you don't specify a value, the operation returns the first page of results.</p>
        max_results: <p>The maximum number of datasets to return in one page. The default is 100.</p>

    Raises:
        capo_connecthealth.errors.access_denied_exception.AccessDeniedException: <p>This error is thrown when the client does not supply proper credentials to the API.</p>
        capo_connecthealth.errors.internal_server_exception.InternalServerException: <p>This error is thrown when a transient error causes our API to fail.</p>
        capo_connecthealth.errors.resource_not_found_exception.ResourceNotFoundException: <p>This error is thrown when the requested resource is not found.</p>
        capo_connecthealth.errors.throttling_exception.ThrottlingException: <p>This error is thrown when the client exceeds the allowed request rate.</p>
        capo_connecthealth.errors.validation_exception.ValidationException: <p>This error is thrown when the client supplies invalid input to the API.</p>
        capo_connecthealth.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connecthealth.types.list_datasets_input.ListDatasetsInput]",
    ) -> AsyncOperationResponse[
        "capo_connecthealth.types.list_datasets_output.ListDatasetsOutput"
    ]:
        import capo_connecthealth._operations.connect_health.list_datasets

        (
            output,
            http_response,
        ) = await capo_connecthealth._operations.connect_health.list_datasets.async_list_datasets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDatasets")
    )
    input_: capo_connecthealth.types.list_datasets_input.ListDatasetsInput = {
        "domain_id": domain_id
    }
    if type is not None:
        input_["type"] = type
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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