Returns a list that contains the number of managed Contributor Insights rules in your account.
Parameters:
-
resource_arn
(Optional[AmazonResourceName], default:
None
)
–
The ARN of an Amazon Web Services resource that has managed Contributor Insights rules.
-
next_token
(Optional[NextToken], default:
None
)
–
Include this value to get the next set of rules if the value was returned by the previous operation.
-
max_results
(Optional[InsightRuleMaxResults], default:
None
)
–
The maximum number of results to return in one operation. If you omit this parameter, the default number is used. The default number is 100.
Raises:
Source code in docs_src/capo_cloudwatch/_services/cloud_watch.py
| def list_managed_insight_rules(
self,
*,
config_overrides: Optional[CloudWatchClientConfig] = None,
resource_arn: Optional[
"capo_cloudwatch.types.amazon_resource_name.AmazonResourceName"
] = None,
next_token: Optional["capo_cloudwatch.types.next_token.NextToken"] = None,
max_results: Optional[
"capo_cloudwatch.types.insight_rule_max_results.InsightRuleMaxResults"
] = None,
) -> "capo_cloudwatch.types.list_managed_insight_rules_output.ListManagedInsightRulesOutput":
"""<p> Returns a list that contains the number of managed Contributor Insights rules in your account. </p>
Args:
resource_arn: <p> The ARN of an Amazon Web Services resource that has managed Contributor Insights rules. </p>
next_token: <p> Include this value to get the next set of rules if the value was returned by the previous operation. </p>
max_results: <p> The maximum number of results to return in one operation. If you omit this parameter, the default number is used. The default number is <code>100</code>. </p>
Raises:
capo_cloudwatch.errors.invalid_next_token.InvalidNextToken: <p>The next token specified is invalid.</p>
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.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch.types.list_managed_insight_rules_input.ListManagedInsightRulesInput]",
) -> OperationResponse[
"capo_cloudwatch.types.list_managed_insight_rules_output.ListManagedInsightRulesOutput"
]:
import capo_cloudwatch._operations.granite_service_version20100801.list_managed_insight_rules
output, http_response = (
capo_cloudwatch._operations.granite_service_version20100801.list_managed_insight_rules.list_managed_insight_rules(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListManagedInsightRules")
)
input_: capo_cloudwatch.types.list_managed_insight_rules_input.ListManagedInsightRulesInput = {}
if resource_arn is not None:
input_["resource_arn"] = resource_arn
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|