Skip to content

configure_tags async

configure_tags(
    tag_keys: ConfigureTagsRequestTagKeyList,
    *,
    config_overrides: Optional[AsyncHealthClientConfig] = 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/async_health.py
async def configure_tags(
    self,
    tag_keys: "capo_health.types.configure_tags_request_tag_key_list.ConfigureTagsRequestTagKeyList",
    *,
    config_overrides: Optional[AsyncHealthClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_health.types.configure_tags_request.ConfigureTagsRequest]",
    ) -> AsyncOperationResponse[
        "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,
            ) = await capo_health._operations.aws_health_20160804.aws_json1_1.configure_tags.async_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,
            ) = await capo_health._operations.aws_health_20160804.rpcv2_cbor.configure_tags.async_configure_tags(
                req.options, req.input
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output