Skip to content

tag_global_resource async

tag_global_resource(
    resource_arn: str,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    tags: Optional[__mapOfString] = None,
) -> None

Adds tags to a global resource in AWS Elemental MediaConnect. The API supports the following global resources: router inputs, router outputs and router network interfaces.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) of the global resource to tag.

  • tags (Optional[__mapOfString], default: None ) –

    A map of tag keys and values to add to the global resource.

Raises:

  • BadRequestException –

    This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message.

  • InternalServerErrorException –

    The server encountered an internal error and is unable to complete the request.

  • NotFoundException –

    One or more of the resources in the request does not exist in the system.

  • UnknownServiceError –

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

Source code in docs_src/capo_mediaconnect/_services/async_media_connect.py
async def tag_global_resource(
    self,
    resource_arn: str,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    tags: Optional["capo_mediaconnect.types.__map_of_string.__mapOfString"] = None,
) -> None:
    """<p>Adds tags to a global resource in AWS Elemental MediaConnect. The API supports the following global resources: router inputs, router outputs and router network interfaces. </p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the global resource to tag.</p>
        tags: <p>A map of tag keys and values to add to the global resource.</p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.not_found_exception.NotFoundException: <p>One or more of the resources in the request does not exist in the system. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediaconnect.types.tag_global_resource_request.TagGlobalResourceRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_mediaconnect._operations.media_connect.tag_global_resource

        (
            output,
            http_response,
        ) = await capo_mediaconnect._operations.media_connect.tag_global_resource.async_tag_global_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagGlobalResource")
    )
    input_: capo_mediaconnect.types.tag_global_resource_request.TagGlobalResourceRequest = {
        "resource_arn": resource_arn
    }
    if tags is not None:
        input_["tags"] = tags

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