Creates a managed Contributor Insights rule for a specified Amazon Web Services resource. When you enable a managed rule, you create a Contributor Insights rule that collects data from Amazon Web Services services. You cannot edit these rules with PutInsightRule. The rules can be enabled, disabled, and deleted using EnableInsightRules, DisableInsightRules, and DeleteInsightRules. If a previously created managed rule is currently disabled, a subsequent call to this API will re-enable it. Use ListManagedInsightRules to describe all available rules.
Parameters:
Raises:
Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
| async def put_managed_insight_rules(
self,
*,
config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
managed_rules: Optional[
"capo_cloudwatch.types.managed_rules.ManagedRules"
] = None,
) -> "capo_cloudwatch.types.put_managed_insight_rules_output.PutManagedInsightRulesOutput":
"""<p> Creates a managed Contributor Insights rule for a specified Amazon Web Services resource. When you enable a managed rule, you create a Contributor Insights rule that collects data from Amazon Web Services services. You cannot edit these rules with <code>PutInsightRule</code>. The rules can be enabled, disabled, and deleted using <code>EnableInsightRules</code>, <code>DisableInsightRules</code>, and <code>DeleteInsightRules</code>. If a previously created managed rule is currently disabled, a subsequent call to this API will re-enable it. Use <code>ListManagedInsightRules</code> to describe all available rules. </p>
Args:
managed_rules: <p> A list of <code>ManagedRules</code> to enable. </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.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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch.types.put_managed_insight_rules_input.PutManagedInsightRulesInput]",
) -> AsyncOperationResponse[
"capo_cloudwatch.types.put_managed_insight_rules_output.PutManagedInsightRulesOutput"
]:
import capo_cloudwatch._operations.granite_service_version20100801.put_managed_insight_rules
(
output,
http_response,
) = await capo_cloudwatch._operations.granite_service_version20100801.put_managed_insight_rules.async_put_managed_insight_rules(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutManagedInsightRules")
)
input_: capo_cloudwatch.types.put_managed_insight_rules_input.PutManagedInsightRulesInput = {}
if managed_rules is not None:
input_["managed_rules"] = managed_rules
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|