Skip to content

tag_resource async

tag_resource(
    resource_arn: RtbTaggableResourceArn,
    tags: TagsMap,
    *,
    config_overrides: Optional[AsyncRTBFabricClientConfig] = None,
) -> TagResourceResponse

Assigns one or more tags (key-value pairs) to the specified resource.

Parameters:

  • resource_arn (RtbTaggableResourceArn) –

    The Amazon Resource Name (ARN) of the resource that you want to tag.

  • tags (TagsMap) –

    A map of the key-value pairs of the tag or tags to assign to the resource.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have sufficient access to perform this action.

  • InternalServerException –

    The request could not be completed because of an internal server error. Try your call again.

  • ResourceNotFoundException –

    The request could not be completed because the resource does not exist.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request could not be completed because it fails satisfy the constraints specified by the service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Add tags to a resource Adds tags to a resource

>>> await client.tag_resource(resource_arn='arn:aws:rtbfabric:us-east-1:123456789012:gateway/rtb-gw-12345678', tags={'Environment': 'Production', 'Team': 'RTB'})
Source code in docs_src/capo_rtbfabric/_services/async_rtb_fabric.py
async def tag_resource(
    self,
    resource_arn: "capo_rtbfabric.types.rtb_taggable_resource_arn.RtbTaggableResourceArn",
    tags: "capo_rtbfabric.types.tags_map.TagsMap",
    *,
    config_overrides: Optional[AsyncRTBFabricClientConfig] = None,
) -> "capo_rtbfabric.types.tag_resource_response.TagResourceResponse":
    """<p>Assigns one or more tags (key-value pairs) to the specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to tag.</p>
        tags: <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>

    Raises:
        capo_rtbfabric.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have sufficient access to perform this action.</p>
        capo_rtbfabric.errors.internal_server_exception.InternalServerException: <p>The request could not be completed because of an internal server error. Try your call again.</p>
        capo_rtbfabric.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request could not be completed because the resource does not exist.</p>
        capo_rtbfabric.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_rtbfabric.errors.validation_exception.ValidationException: <p>The request could not be completed because it fails satisfy the constraints specified by the service.</p>
        capo_rtbfabric.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Add tags to a resource
        Adds tags to a resource

        >>> await client.tag_resource(resource_arn='arn:aws:rtbfabric:us-east-1:123456789012:gateway/rtb-gw-12345678', tags={'Environment': 'Production', 'Team': 'RTB'})
    """

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

        (
            output,
            http_response,
        ) = await capo_rtbfabric._operations.rtb_fabric.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_rtbfabric.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