ComputeOptimizerAutomation / Client / list_automation_rules
list_automation_rules¶
- ComputeOptimizerAutomation.Client.list_automation_rules(**kwargs)¶
Lists the automation rules that match specified filters.
See also: AWS API Documentation
Request Syntax
response = client.list_automation_rules( filters=[ { 'name': 'Name'|'RecommendedActionType'|'Status'|'RuleType'|'OrganizationConfigurationRuleApplyOrder'|'AccountId', 'values': [ 'string', ] }, ], maxResults=123, nextToken='string' )
- Parameters:
filters (list) –
The filters to apply to the list of automation rules.
(dict) –
A filter used to narrow down results based on specific criteria.
name (string) – [REQUIRED]
The name of the filter field to apply.
values (list) – [REQUIRED]
The list of values to filter by for the specified filter field.
(string) –
maxResults (integer) – The maximum number of automation rules to return in a single response. Valid range is 1-1000.
nextToken (string) – A token used for pagination to retrieve the next set of results when the response is truncated.
- Return type:
dict
- Returns:
Response Syntax
{ 'automationRules': [ { 'ruleArn': 'string', 'ruleId': 'string', 'name': 'string', 'description': 'string', 'ruleType': 'OrganizationRule'|'AccountRule', 'ruleRevision': 123, 'accountId': 'string', 'organizationConfiguration': { 'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules', 'accountIds': [ 'string', ] }, 'priority': 'string', 'recommendedActionTypes': [ 'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType', ], 'schedule': { 'scheduleExpression': 'string', 'scheduleExpressionTimezone': 'string', 'executionWindowInMinutes': 123 }, 'status': 'Active'|'Inactive', 'createdTimestamp': datetime(2015, 1, 1), 'lastUpdatedTimestamp': datetime(2015, 1, 1) }, ], 'nextToken': 'string' }
Response Structure
(dict) –
automationRules (list) –
The list of automation rules that match the specified criteria.
(dict) –
Represents a complete automation rule configuration including criteria, schedule, and execution settings.
ruleArn (string) –
The Amazon Resource Name (ARN) of the automation rule.
ruleId (string) –
The unique identifier of the automation rule.
name (string) –
The name of the automation rule.
description (string) –
A description of the automation rule.
ruleType (string) –
The type of automation rule (OrganizationRule or AccountRule).
ruleRevision (integer) –
The revision number of the automation rule.
accountId (string) –
The 12-digit Amazon Web Services account ID that owns this automation rule.
organizationConfiguration (dict) –
Configuration settings for organization-wide rules.
ruleApplyOrder (string) –
Specifies when organization rules should be applied relative to account rules.
accountIds (list) –
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(string) –
priority (string) –
A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules.
recommendedActionTypes (list) –
List of recommended action types that this rule can execute.
(string) –
Recommended action type enumeration
schedule (dict) –
The schedule configuration for when the automation rule should execute.
scheduleExpression (string) –
The expression that defines when the schedule runs.
cronexpression is supported. Acronexpression consists of six fields separated by white spaces: (minuteshoursday_of_monthmonthday_of_weekyear)Note
You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (
30 12 * * *) runs daily at 12:30 PM UTC.scheduleExpressionTimezone (string) –
The timezone to use when interpreting the schedule expression.
executionWindowInMinutes (integer) –
The time window in minutes during which the automation rule can start implementing recommended actions.
status (string) –
The current status of the automation rule (Active or Inactive).
createdTimestamp (datetime) –
The timestamp when the automation rule was created.
lastUpdatedTimestamp (datetime) –
The timestamp when the automation rule was last updated.
nextToken (string) –
A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.
Exceptions
ComputeOptimizerAutomation.Client.exceptions.InvalidParameterValueExceptionComputeOptimizerAutomation.Client.exceptions.ForbiddenExceptionComputeOptimizerAutomation.Client.exceptions.OptInRequiredExceptionComputeOptimizerAutomation.Client.exceptions.ThrottlingExceptionComputeOptimizerAutomation.Client.exceptions.AccessDeniedExceptionComputeOptimizerAutomation.Client.exceptions.InternalServerExceptionComputeOptimizerAutomation.Client.exceptions.ServiceUnavailableException