create_automation_rule
¶
create_automation_rule(
name: RuleName,
rule_type: RuleType,
recommended_action_types: RecommendedActionTypeList,
schedule: Schedule,
status: RuleStatus,
*,
config_overrides: Optional[ComputeOptimizerAutomationClientConfig] = None,
description: Optional[RuleDescription] = None,
organization_configuration: Optional[OrganizationConfiguration] = None,
priority: Optional[str] = None,
criteria: Optional[Criteria] = None,
tags: Optional[TagList] = None,
client_token: Optional[ClientToken] = None,
) -> CreateAutomationRuleResponse
Creates a new automation rule to apply recommended actions to resources based on specified criteria.
Parameters:
-
name(RuleName) –The name of the automation rule.
-
description(Optional[RuleDescription], default:None) –A description of the automation rule.
-
rule_type(RuleType) –The type of rule.
Only the management account or a delegated administrator can set the ruleType to be OrganizationRule.
-
organization_configuration(Optional[OrganizationConfiguration], default:None) –Configuration for organization-level rules. Required for OrganizationRule type.
-
priority(Optional[str], default:None) –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.
-
recommended_action_types(RecommendedActionTypeList) –The types of recommended actions this rule will automate.
-
criteria(Optional[Criteria], default:None) –A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time.
-
schedule(Schedule) –The schedule for when the rule should run.
-
status(RuleStatus) –The status of the rule
-
tags(Optional[TagList], default:None) –The tags to associate with the rule.
-
client_token(Optional[ClientToken], default:None) –A unique identifier to ensure idempotency of the request.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
ForbiddenException–You are not authorized to perform this action.
-
IdempotencyTokenInUseException–The specified client token is already in use.
-
IdempotentParameterMismatchException–Exception thrown when the same client token is used with different parameters, indicating a mismatch in idempotent request parameters.
-
InternalServerException–An internal error occurred while processing the request.
-
InvalidParameterValueException–One or more parameter values are not valid.
-
OptInRequiredException–The account must be opted in to Compute Optimizer Automation before performing this action.
-
ResourceNotFoundException–The specified resource was not found.
-
ServiceQuotaExceededException–The request would exceed service quotas.
-
ServiceUnavailableException–The service is temporarily unavailable.
-
ThrottlingException–The request was denied due to request throttling.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_compute_optimizer_automation/_services/compute_optimizer_automation.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |