Skip to content

tag_resource async

tag_resource(
    arn: PlanArn,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncARCRegionswitchClientConfig] = None,
) -> TagResourceResponse

Adds or updates tags for a Region switch resource. You can assign metadata to your resources in the form of tags, which are key-value pairs.

Parameters:

  • arn (PlanArn) –

    The Amazon Resource Name (ARN) for a tag that you add to a resource.

  • tags (Tags) –

    Tags that you add to a resource. You can add a maximum of 50 tags in Region switch.

Raises:

Source code in docs_src/capo_arc_region_switch/_services/async_arc_regionswitch.py
async def tag_resource(
    self,
    arn: "capo_arc_region_switch.types.plan_arn.PlanArn",
    tags: "capo_arc_region_switch.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncARCRegionswitchClientConfig] = None,
) -> "capo_arc_region_switch.types.tag_resource_response.TagResourceResponse":
    """<p>Adds or updates tags for a Region switch resource. You can assign metadata to your resources in the form of tags, which are key-value pairs.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) for a tag that you add to a resource.</p>
        tags: <p>Tags that you add to a resource. You can add a maximum of 50 tags in Region switch.</p>

    Raises:
        capo_arc_region_switch.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p> <p>HTTP Status Code: 500</p>
        capo_arc_region_switch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p> <p>HTTP Status Code: 404</p>
        capo_arc_region_switch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_arc_region_switch._operations.arc_region_switch.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_arc_region_switch.types.tag_resource_request.TagResourceRequest = {
        "arn": arn,
        "tags": tags,
    }

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