Skip to content

tag_resource async

tag_resource(
    report_name: ReportName,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncCostandUsageReportServiceClientConfig] = None,
) -> TagResourceResponse

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/async_costand_usage_report_service.py
async 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[AsyncCostandUsageReportServiceClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cost_and_usage_report_service.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "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,
        ) = await capo_cost_and_usage_report_service._operations.aws_origami_service_gateway_service.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output