Skip to content

tag_resource

tag_resource(
    service_type: ServiceType,
    resource_arn: AmazonResourceName,
    tags: TagList,
    *,
    config_overrides: Optional[PIClientConfig] = None,
) -> TagResourceResponse

Adds metadata tags to the Amazon RDS Performance Insights resource.

Parameters:

  • service_type (ServiceType) –

    The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.

  • resource_arn (AmazonResourceName) –

    The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN).

  • tags (TagList) –

    The metadata assigned to an Amazon RDS resource consisting of a key-value pair.

Raises:

Source code in docs_src/capo_pi/_services/pi.py
def tag_resource(
    self,
    service_type: "capo_pi.types.service_type.ServiceType",
    resource_arn: "capo_pi.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_pi.types.tag_list.TagList",
    *,
    config_overrides: Optional[PIClientConfig] = None,
) -> "capo_pi.types.tag_resource_response.TagResourceResponse":
    """<p>Adds metadata tags to the Amazon RDS Performance Insights resource.</p>

    Args:
        service_type: <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid value is <code>RDS</code>.</p>
        resource_arn: <p>The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing"> Constructing an RDS Amazon Resource Name (ARN)</a>.</p>
        tags: <p>The metadata assigned to an Amazon RDS resource consisting of a key-value pair.</p>

    Raises:
        capo_pi.errors.internal_service_error.InternalServiceError: <p>The request failed due to an unknown error.</p>
        capo_pi.errors.invalid_argument_exception.InvalidArgumentException: <p>One of the arguments provided is invalid for this request.</p>
        capo_pi.errors.not_authorized_exception.NotAuthorizedException: <p>The user is not authorized to perform this request.</p>
        capo_pi.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_pi.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[
        "capo_pi.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_pi._operations.performance_insightsv20180227.tag_resource

        output, http_response = (
            capo_pi._operations.performance_insightsv20180227.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_pi.types.tag_resource_request.TagResourceRequest = {
        "service_type": service_type,
        "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