aws_sdk_computeoptimizerautomation/client/
create_automation_rule.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateAutomationRule`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`name(impl Into<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_name):<br>required: **true**<br><p>The name of the automation rule.</p><br>
7    ///   - [`description(impl Into<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_description):<br>required: **false**<br><p>A description of the automation rule.</p><br>
8    ///   - [`rule_type(RuleType)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::rule_type) / [`set_rule_type(Option<RuleType>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_rule_type):<br>required: **true**<br><p>The type of rule.</p><note>  <p>Only the management account or a delegated administrator can set the ruleType to be OrganizationRule.</p> </note><br>
9    ///   - [`organization_configuration(OrganizationConfiguration)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::organization_configuration) / [`set_organization_configuration(Option<OrganizationConfiguration>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_organization_configuration):<br>required: **false**<br><p>Configuration for organization-level rules. Required for OrganizationRule type.</p><br>
10    ///   - [`priority(impl Into<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::priority) / [`set_priority(Option<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_priority):<br>required: **false**<br><p>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.</p><br>
11    ///   - [`recommended_action_types(RecommendedActionType)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::recommended_action_types) / [`set_recommended_action_types(Option<Vec::<RecommendedActionType>>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_recommended_action_types):<br>required: **true**<br><p>The types of recommended actions this rule will automate.</p><br>
12    ///   - [`criteria(Criteria)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::criteria) / [`set_criteria(Option<Criteria>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_criteria):<br>required: **false**<br><p>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.</p><br>
13    ///   - [`schedule(Schedule)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::schedule) / [`set_schedule(Option<Schedule>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_schedule):<br>required: **true**<br><p>The schedule for when the rule should run.</p><br>
14    ///   - [`status(RuleStatus)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::status) / [`set_status(Option<RuleStatus>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_status):<br>required: **true**<br><p>The status of the rule</p><br>
15    ///   - [`tags(Tag)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_tags):<br>required: **false**<br><p>The tags to associate with the rule.</p><br>
16    ///   - [`client_token(impl Into<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::set_client_token):<br>required: **false**<br><p>A unique identifier to ensure idempotency of the request.</p><br>
17    /// - On success, responds with [`CreateAutomationRuleOutput`](crate::operation::create_automation_rule::CreateAutomationRuleOutput) with field(s):
18    ///   - [`rule_arn(Option<String>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::rule_arn): <p>The Amazon Resource Name (ARN) of the created rule.</p>
19    ///   - [`rule_id(Option<String>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::rule_id): <p>The unique identifier of the created rule.</p>
20    ///   - [`name(Option<String>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::name): <p>The name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.</p>
21    ///   - [`description(Option<String>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::description): <p>A description of the automation rule. Can be up to 1024 characters long and contain alphanumeric characters, underscores, hyphens, spaces, and certain special characters.</p>
22    ///   - [`rule_type(Option<RuleType>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::rule_type): <p>The type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.</p>
23    ///   - [`rule_revision(Option<i64>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::rule_revision): <p>The revision number of the automation rule. This is incremented each time the rule is updated.</p>
24    ///   - [`organization_configuration(Option<OrganizationConfiguration>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::organization_configuration): <p>Configuration settings for organization-wide rules, including rule application order and target account IDs.</p>
25    ///   - [`priority(Option<String>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::priority): <p>The priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.</p>
26    ///   - [`recommended_action_types(Option<Vec::<RecommendedActionType>>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::recommended_action_types): <p>List of recommended action types that this rule can execute, such as SnapshotAndDeleteUnattachedEbsVolume or UpgradeEbsVolumeType.</p>
27    ///   - [`criteria(Option<Criteria>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::criteria): <p>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. You can specify up to 20 conditions per filter criteria and 20 values per condition.</p>
28    ///   - [`schedule(Option<Schedule>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::schedule): <p>The schedule configuration for when the automation rule should execute, including cron expression, timezone, and execution window.</p>
29    ///   - [`status(Option<RuleStatus>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::status): <p>The current status of the automation rule. Can be Active or Inactive.</p>
30    ///   - [`tags(Option<Vec::<Tag>>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::tags): <p>A list of key-value pairs used to categorize and organize the automation rule. Maximum of 200 tags allowed.</p>
31    ///   - [`created_timestamp(Option<DateTime>)`](crate::operation::create_automation_rule::CreateAutomationRuleOutput::created_timestamp): <p>The timestamp when the automation rule was created.</p>
32    /// - On failure, responds with [`SdkError<CreateAutomationRuleError>`](crate::operation::create_automation_rule::CreateAutomationRuleError)
33    pub fn create_automation_rule(&self) -> crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder {
34        crate::operation::create_automation_rule::builders::CreateAutomationRuleFluentBuilder::new(self.handle.clone())
35    }
36}