Skip to content

describe_collection

describe_collection(
    collection_id: CollectionId,
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> DescribeCollectionResponse

Describes the specified collection. You can use DescribeCollection to get information, such as the number of faces indexed into a collection and the version of the model used by the collection for face detection.

For more information, see Describing a Collection in the Amazon Rekognition Developer Guide.

Parameters:

  • collection_id (CollectionId) –

    The ID of the collection to describe.

Raises:

Source code in docs_src/capo_rekognition/_services/rekognition.py
def describe_collection(
    self,
    collection_id: "capo_rekognition.types.collection_id.CollectionId",
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> (
    "capo_rekognition.types.describe_collection_response.DescribeCollectionResponse"
):
    """<p>Describes the specified collection. You can use <code>DescribeCollection</code> to get information, such as the number of faces indexed into a collection and the version of the model used by the collection for face detection.</p> <p>For more information, see Describing a Collection in the Amazon Rekognition Developer Guide.</p>

    Args:
        collection_id: <p>The ID of the collection to describe.</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_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_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request cannot be found.</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.
    """

    def _handler(
        req: "OperationRequest[capo_rekognition.types.describe_collection_request.DescribeCollectionRequest]",
    ) -> OperationResponse[
        "capo_rekognition.types.describe_collection_response.DescribeCollectionResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.describe_collection

        output, http_response = (
            capo_rekognition._operations.rekognition_service.describe_collection.describe_collection(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCollection")
    )
    input_: capo_rekognition.types.describe_collection_request.DescribeCollectionRequest = {
        "collection_id": collection_id
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output