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/media_connect.py
| def tag_global_resource(
self,
resource_arn: str,
*,
config_overrides: Optional[MediaConnectClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_mediaconnect.types.tag_global_resource_request.TagGlobalResourceRequest]",
) -> OperationResponse[None]:
import capo_mediaconnect._operations.media_connect.tag_global_resource
output, http_response = (
capo_mediaconnect._operations.media_connect.tag_global_resource.tag_global_resource(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|