Assigns one or more tags (key-value pairs) to the specified pipe. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
You can use the TagResource action with a pipe that already has tags. If you specify a new tag key, this tag is appended to the list of tags associated with the pipe. If you specify a tag key that is already associated with the pipe, the new tag value that you specify replaces the previous value for that tag.
You can associate as many as 50 tags with a pipe.
Parameters:
-
resource_arn
(PipeArn)
–
-
tags
(TagMap)
–
The list of key-value pairs associated with the pipe.
Raises:
Source code in docs_src/capo_pipes/_services/async_pipes.py
| async def tag_resource(
self,
resource_arn: "capo_pipes.types.pipe_arn.PipeArn",
tags: "capo_pipes.types.tag_map.TagMap",
*,
config_overrides: Optional[AsyncPipesClientConfig] = None,
) -> "capo_pipes.types.tag_resource_response.TagResourceResponse":
"""<p>Assigns one or more tags (key-value pairs) to the specified pipe. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p> <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p> <p>You can use the <code>TagResource</code> action with a pipe that already has tags. If you specify a new tag key, this tag is appended to the list of tags associated with the pipe. If you specify a tag key that is already associated with the pipe, the new tag value that you specify replaces the previous value for that tag.</p> <p>You can associate as many as 50 tags with a pipe.</p>
Args:
resource_arn: <p>The ARN of the pipe.</p>
tags: <p>The list of key-value pairs associated with the pipe.</p>
Raises:
capo_pipes.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
capo_pipes.errors.not_found_exception.NotFoundException: <p>An entity that you specified does not exist.</p>
capo_pipes.errors.validation_exception.ValidationException: <p>Indicates that an error has occurred while performing a validate operation.</p>
capo_pipes.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_pipes.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_pipes.types.tag_resource_response.TagResourceResponse"
]:
import capo_pipes._operations.pipes.tag_resource
(
output,
http_response,
) = await capo_pipes._operations.pipes.tag_resource.async_tag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_pipes.types.tag_resource_request.TagResourceRequest",
) -> dict[str, Any]:
import capo_pipes.types.tag_resource_request
return capo_pipes.types.tag_resource_request.redact_sensitive(input_)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("TagResource", redact_input=_redact_input),
)
input_: capo_pipes.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
|