Associates a set of tags with a report definition.
Parameters:
-
report_name
(ReportName)
–
The report name of the report definition that tags are to be associated with.
-
tags
(TagList)
–
The tags to be assigned to the report definition resource.
Raises:
Source code in docs_src/capo_cost_and_usage_report_service/_services/costand_usage_report_service.py
| def tag_resource(
self,
report_name: "capo_cost_and_usage_report_service.types.report_name.ReportName",
tags: "capo_cost_and_usage_report_service.types.tag_list.TagList",
*,
config_overrides: Optional[CostandUsageReportServiceClientConfig] = None,
) -> "capo_cost_and_usage_report_service.types.tag_resource_response.TagResourceResponse":
"""<p>Associates a set of tags with a report definition.</p>
Args:
report_name: <p>The report name of the report definition that tags are to be associated with.</p>
tags: <p>The tags to be assigned to the report definition resource.</p>
Raises:
capo_cost_and_usage_report_service.errors.internal_error_exception.InternalErrorException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
capo_cost_and_usage_report_service.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified report (<code>ReportName</code>) in the request doesn't exist.</p>
capo_cost_and_usage_report_service.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_cost_and_usage_report_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cost_and_usage_report_service.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_cost_and_usage_report_service.types.tag_resource_response.TagResourceResponse"
]:
import capo_cost_and_usage_report_service._operations.aws_origami_service_gateway_service.tag_resource
output, http_response = (
capo_cost_and_usage_report_service._operations.aws_origami_service_gateway_service.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_cost_and_usage_report_service.types.tag_resource_request.TagResourceRequest = {
"report_name": report_name,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|