Skip to content

/AWS1/CL_REK=>LISTDATASETENTRIES()

About ListDatasetEntries

This operation applies only to Amazon Rekognition Custom Labels.

Lists the entries (images) within a dataset. An entry is a JSON Line that contains the information for a single image, including the image location, assigned labels, and object location bounding boxes. For more information, see Creating a manifest file.

JSON Lines in the response include information about non-terminal errors found in the dataset. Non terminal errors are reported in errors lists within each JSON Line. The same information is reported in the training and testing validation result manifests that Amazon Rekognition Custom Labels creates during model training.

You can filter the response in variety of ways, such as choosing which labels to return and returning JSON Lines created after a specific date.

This operation requires permissions to perform the rekognition:ListDatasetEntries action.

Method Signature

IMPORTING

Required arguments:

iv_datasetarn TYPE /AWS1/REKDATASETARN /AWS1/REKDATASETARN

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

Optional arguments:

it_containslabels TYPE /AWS1/CL_REKDATASETLABELS_W=>TT_DATASETLABELS TT_DATASETLABELS

Specifies a label filter for the response. The response includes an entry only if one or more of the labels in ContainsLabels exist in the entry.

iv_labeled TYPE /AWS1/REKISLABELED /AWS1/REKISLABELED

Specify true to get only the JSON Lines where the image is labeled. Specify false to get only the JSON Lines where the image isn't labeled. If you don't specify Labeled, ListDatasetEntries returns JSON Lines for labeled and unlabeled images.

iv_sourcerefcontains TYPE /AWS1/REKQUERYSTRING /AWS1/REKQUERYSTRING

If specified, ListDatasetEntries only returns JSON Lines where the value of SourceRefContains is part of the source-ref field. The source-ref field contains the Amazon S3 location of the image. You can use SouceRefContains for tasks such as getting the JSON Line for a single image, or gettting JSON Lines for all images within a specific folder.

iv_haserrors TYPE /AWS1/REKHASERRORS /AWS1/REKHASERRORS

Specifies an error filter for the response. Specify True to only include entries that have errors.

iv_nexttoken TYPE /AWS1/REKEXTENDEDPAGINATIONTOK /AWS1/REKEXTENDEDPAGINATIONTOK

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.

iv_maxresults TYPE /AWS1/REKLISTDSENTRIESPAGESIZE /AWS1/REKLISTDSENTRIESPAGESIZE

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.

RETURNING

oo_output TYPE REF TO /aws1/cl_reklistdsentriesrsp /AWS1/CL_REKLISTDSENTRIESRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_rek~listdatasetentries(
  it_containslabels = VALUE /aws1/cl_rekdatasetlabels_w=>tt_datasetlabels(
    ( new /aws1/cl_rekdatasetlabels_w( |string| ) )
  )
  iv_datasetarn = |string|
  iv_haserrors = ABAP_TRUE
  iv_labeled = ABAP_TRUE
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_sourcerefcontains = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_datasetentries( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_datasetentry = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  lv_extendedpaginationtoken = lo_result->get_nexttoken( ).
ENDIF.

To list the entries in an Amazon Rekognition Custom Labels dataset

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

DATA(lo_result) = lo_client->/aws1/if_rek~listdatasetentries(
  it_containslabels = VALUE /aws1/cl_rekdatasetlabels_w=>tt_datasetlabels(
    ( new /aws1/cl_rekdatasetlabels_w( |camellia| ) )
  )
  iv_datasetarn = |arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106|
  iv_haserrors = ABAP_TRUE
  iv_labeled = ABAP_TRUE
  iv_maxresults = 100
  iv_nexttoken = ||
  iv_sourcerefcontains = |camellia4.jpg|
).