Skip to content

tag_resource async

tag_resource(
    resource_arn: ResourceArn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncRekognitionClientConfig] = None,
) -> TagResourceResponse

Adds one or more key-value tags to an Amazon Rekognition collection, stream processor, or Custom Labels model. For more information, see Tagging AWS Resources.

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

Parameters:

  • resource_arn (ResourceArn) –

    Amazon Resource Name (ARN) of the model, collection, or stream processor that you want to assign the tags to.

  • tags (TagMap) –

    The key-value tags to assign to the resource.

Raises:

Source code in docs_src/capo_rekognition/_services/async_rekognition.py
async def tag_resource(
    self,
    resource_arn: "capo_rekognition.types.resource_arn.ResourceArn",
    tags: "capo_rekognition.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncRekognitionClientConfig] = None,
) -> "capo_rekognition.types.tag_resource_response.TagResourceResponse":
    """<p> Adds one or more key-value tags to an Amazon Rekognition collection, stream processor, or Custom Labels model. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging AWS Resources</a>. </p> <p>This operation requires permissions to perform the <code>rekognition:TagResource</code> action. </p>

    Args:
        resource_arn: <p> Amazon Resource Name (ARN) of the model, collection, or stream processor that you want to assign the tags to. </p>
        tags: <p> The key-value tags to assign to the resource. </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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p></p> <p>The size of the collection exceeds the allowed limit. For more information, see Guidelines and quotas in Amazon Rekognition in the Amazon Rekognition Developer Guide. </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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rekognition.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_rekognition.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.tag_resource

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_rekognition.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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