Skip to content

configure_tags

configure_tags(
    tag_keys: ConfigureTagsRequestTagKeyList,
    *,
    config_overrides: Optional[HealthClientConfig] = None,
) -> ConfigureTagsResponse

Configures which resource tag keys are tracked by Health for your account. This operation replaces the existing configuration with the specified tag keys. Only configured tag keys will appear in Health event data.

Parameters:

Raises:

Source code in docs_src/capo_health/_services/health.py
def configure_tags(
    self,
    tag_keys: "capo_health.types.configure_tags_request_tag_key_list.ConfigureTagsRequestTagKeyList",
    *,
    config_overrides: Optional[HealthClientConfig] = None,
) -> "capo_health.types.configure_tags_response.ConfigureTagsResponse":
    """<p>Configures which resource tag keys are tracked by Health for your account. This operation replaces the existing configuration with the specified tag keys. Only configured tag keys will appear in Health event data.</p>

    Args:
        tag_keys: <p>The list of resource tag keys to configure for Health event tracking.</p>

    Raises:
        capo_health.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_health.types.configure_tags_request.ConfigureTagsRequest]",
    ) -> OperationResponse[
        "capo_health.types.configure_tags_response.ConfigureTagsResponse"
    ]:
        if req.options.protocol == "awsJson1_1":
            import capo_health._operations.aws_health_20160804.aws_json1_1.configure_tags

            output, http_response = (
                capo_health._operations.aws_health_20160804.aws_json1_1.configure_tags.configure_tags(
                    req.options, req.input
                )
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_health._operations.aws_health_20160804.rpcv2_cbor.configure_tags

            output, http_response = (
                capo_health._operations.aws_health_20160804.rpcv2_cbor.configure_tags.configure_tags(
                    req.options, req.input
                )
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ConfigureTags")
    )
    input_: capo_health.types.configure_tags_request.ConfigureTagsRequest = {
        "tag_keys": tag_keys
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output