Skip to content

list_dataset_labels async

list_dataset_labels(
    dataset_arn: DatasetArn,
    *,
    config_overrides: Optional[AsyncRekognitionClientConfig] = None,
    next_token: Optional[ExtendedPaginationToken] = None,
    max_results: Optional[ListDatasetLabelsPageSize] = None,
) -> ListDatasetLabelsResponse

This operation applies only to Amazon Rekognition Custom Labels.

Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see Labeling images.

Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see Labeling images in the Amazon Rekognition Custom Labels Developer Guide.

Parameters:

  • dataset_arn (DatasetArn) –

    The Amazon Resource Name (ARN) of the dataset that you want to use.

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

    If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.

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

    The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.

Raises:

Examples:

To list the entries in an Amazon Rekognition Custom Labels dataset Lists the JSON line entries in an Amazon Rekognition Custom Labels dataset.

>>> await client.list_dataset_labels(dataset_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106', next_token='', max_results=100)
Source code in docs_src/capo_rekognition/_services/async_rekognition.py
async def list_dataset_labels(
    self,
    dataset_arn: "capo_rekognition.types.dataset_arn.DatasetArn",
    *,
    config_overrides: Optional[AsyncRekognitionClientConfig] = None,
    next_token: Optional[
        "capo_rekognition.types.extended_pagination_token.ExtendedPaginationToken"
    ] = None,
    max_results: Optional[
        "capo_rekognition.types.list_dataset_labels_page_size.ListDatasetLabelsPageSize"
    ] = None,
) -> (
    "capo_rekognition.types.list_dataset_labels_response.ListDatasetLabelsResponse"
):
    """<note> <p>This operation applies only to Amazon Rekognition Custom Labels.</p> </note> <p>Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see <a href="https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-labeling-images.html">Labeling images</a>. </p> <p> Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see Labeling images in the <i>Amazon Rekognition Custom Labels Developer Guide</i>. </p>

    Args:
        dataset_arn: <p> The Amazon Resource Name (ARN) of the dataset that you want to use. </p>
        next_token: <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results. </p>
        max_results: <p>The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100. </p>

    Raises:
        capo_rekognition.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform the action.</p>
        capo_rekognition.errors.internal_server_error.InternalServerError: <p>Amazon Rekognition experienced a service issue. Try your call again.</p>
        capo_rekognition.errors.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>Pagination token in the request is not valid.</p>
        capo_rekognition.errors.invalid_parameter_exception.InvalidParameterException: <p>Input parameter violated a constraint. Validate your parameter before calling the API operation again.</p>
        capo_rekognition.errors.provisioned_throughput_exceeded_exception.ProvisionedThroughputExceededException: <p>The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.</p>
        capo_rekognition.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is already being used.</p>
        capo_rekognition.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request cannot be found.</p>
        capo_rekognition.errors.resource_not_ready_exception.ResourceNotReadyException: <p>The requested resource isn't ready. For example, this exception occurs when you call <code>DetectCustomLabels</code> with a model version that isn't deployed. </p>
        capo_rekognition.errors.throttling_exception.ThrottlingException: <p>Amazon Rekognition is temporarily unable to process the request. Try your call again.</p>
        capo_rekognition.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list the entries in an Amazon Rekognition Custom Labels dataset
        Lists the JSON line entries in an Amazon Rekognition Custom Labels dataset.

        >>> await client.list_dataset_labels(dataset_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106', next_token='', max_results=100)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rekognition.types.list_dataset_labels_request.ListDatasetLabelsRequest]",
    ) -> AsyncOperationResponse[
        "capo_rekognition.types.list_dataset_labels_response.ListDatasetLabelsResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.list_dataset_labels

        (
            output,
            http_response,
        ) = await capo_rekognition._operations.rekognition_service.list_dataset_labels.async_list_dataset_labels(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDatasetLabels")
    )
    input_: capo_rekognition.types.list_dataset_labels_request.ListDatasetLabelsRequest = {
        "dataset_arn": dataset_arn
    }
    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