Enables the specified Contributor Insights rules. When rules are enabled, they immediately begin analyzing log data.
Parameters:
Raises:
Source code in docs_src/capo_cloudwatch/_services/cloud_watch.py
| def enable_insight_rules(
self,
*,
config_overrides: Optional[CloudWatchClientConfig] = None,
rule_names: Optional[
"capo_cloudwatch.types.insight_rule_names.InsightRuleNames"
] = None,
) -> "capo_cloudwatch.types.enable_insight_rules_output.EnableInsightRulesOutput":
"""<p>Enables the specified Contributor Insights rules. When rules are enabled, they immediately begin analyzing log data.</p>
Args:
rule_names: <p>An array of the rule names to enable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
Raises:
capo_cloudwatch.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value of an input parameter is bad or out-of-range.</p>
capo_cloudwatch.errors.limit_exceeded_exception.LimitExceededException: <p>The operation exceeded one or more limits.</p>
capo_cloudwatch.errors.missing_required_parameter_exception.MissingRequiredParameterException: <p>An input parameter that is required is missing.</p>
capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch.types.enable_insight_rules_input.EnableInsightRulesInput]",
) -> OperationResponse[
"capo_cloudwatch.types.enable_insight_rules_output.EnableInsightRulesOutput"
]:
import capo_cloudwatch._operations.granite_service_version20100801.enable_insight_rules
output, http_response = (
capo_cloudwatch._operations.granite_service_version20100801.enable_insight_rules.enable_insight_rules(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("EnableInsightRules")
)
input_: capo_cloudwatch.types.enable_insight_rules_input.EnableInsightRulesInput = {}
if rule_names is not None:
input_["rule_names"] = rule_names
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|