Skip to content

enable_tags

enable_tags(*, config_overrides: Optional[HealthClientConfig] = None) -> None

Enables the Health tags feature for your account. Once enabled, Health events will include resource tag information for affected entities. If the feature is already enabled, this operation has no effect.

Raises:

Source code in docs_src/capo_health/_services/health.py
def enable_tags(
    self, *, config_overrides: Optional[HealthClientConfig] = None
) -> None:
    """<p>Enables the Health tags feature for your account. Once enabled, Health events will include resource tag information for affected entities. If the feature is already enabled, this operation has no effect.</p>

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

    def _handler(req: "OperationRequest[None]") -> OperationResponse[None]:
        if req.options.protocol == "awsJson1_1":
            import capo_health._operations.aws_health_20160804.aws_json1_1.enable_tags

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

            output, http_response = (
                capo_health._operations.aws_health_20160804.rpcv2_cbor.enable_tags.enable_tags(
                    req.options
                )
            )
        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("EnableTags")
    )

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