Add a tag to the specified resource.
Parameters:
-
resource_arn
(str)
–
Specify the resourceArn of the resource to which a tag will be added.
-
tags
(TagsMap)
–
Specify the tags to add to the resource. Tags can be specified as a key-value map.
Raises:
Source code in docs_src/capo_braket/_services/braket.py
| def tag_resource(
self,
resource_arn: str,
tags: "capo_braket.types.tags_map.TagsMap",
*,
config_overrides: Optional[BraketClientConfig] = None,
) -> "capo_braket.types.tag_resource_response.TagResourceResponse":
"""<p>Add a tag to the specified resource.</p>
Args:
resource_arn: <p>Specify the <code>resourceArn</code> of the resource to which a tag will be added.</p>
tags: <p>Specify the tags to add to the resource. Tags can be specified as a key-value map.</p>
Raises:
capo_braket.errors.internal_service_exception.InternalServiceException: <p>The request failed because of an unknown error.</p>
capo_braket.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_braket.errors.validation_exception.ValidationException: <p>The input request failed to satisfy constraints expected by Amazon Braket.</p>
capo_braket.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_braket.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_braket.types.tag_resource_response.TagResourceResponse"
]:
import capo_braket._operations.braket.tag_resource
output, http_response = (
capo_braket._operations.braket.tag_resource.tag_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagResource")
)
input_: capo_braket.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|