Rekognition.Client.
list_collections
(**kwargs)¶Returns list of collection IDs in your account. If the result is truncated, the response also provides a NextToken
that you can use in the subsequent request to fetch the next set of collection IDs.
For an example, see Listing collections in the Amazon Rekognition Developer Guide.
This operation requires permissions to perform the rekognition:ListCollections
action.
See also: AWS API Documentation
Request Syntax
response = client.list_collections(
NextToken='string',
MaxResults=123
)
dict
Response Syntax
{
'CollectionIds': [
'string',
],
'NextToken': 'string',
'FaceModelVersions': [
'string',
]
}
Response Structure
(dict) --
CollectionIds (list) --
An array of collection IDs.
NextToken (string) --
If the result is truncated, the response provides a NextToken
that you can use in the subsequent request to fetch the next set of collection IDs.
FaceModelVersions (list) --
Version numbers of the face detection models associated with the collections in the array CollectionIds
. For example, the value of FaceModelVersions[2]
is the version number for the face detection model used by the collection in CollectionId[2]
.
Exceptions
Rekognition.Client.exceptions.InvalidParameterException
Rekognition.Client.exceptions.AccessDeniedException
Rekognition.Client.exceptions.InternalServerError
Rekognition.Client.exceptions.ThrottlingException
Rekognition.Client.exceptions.ProvisionedThroughputExceededException
Rekognition.Client.exceptions.InvalidPaginationTokenException
Rekognition.Client.exceptions.ResourceNotFoundException
Examples
This operation returns a list of Rekognition collections.
response = client.list_collections(
)
print(response)
Expected Output:
{
'CollectionIds': [
'myphotos',
],
'ResponseMetadata': {
'...': '...',
},
}