put_scheduled_update_group_action
¶
put_scheduled_update_group_action(
*,
config_overrides: Optional[AutoScalingClientConfig] = None,
auto_scaling_group_name: Optional[XmlStringMaxLen255] = None,
scheduled_action_name: Optional[XmlStringMaxLen255] = None,
time: Optional[TimestampType] = None,
start_time: Optional[TimestampType] = None,
end_time: Optional[TimestampType] = None,
recurrence: Optional[XmlStringMaxLen255] = None,
min_size: Optional[AutoScalingGroupMinSize] = None,
max_size: Optional[AutoScalingGroupMaxSize] = None,
desired_capacity: Optional[AutoScalingGroupDesiredCapacity] = None,
time_zone: Optional[XmlStringMaxLen255] = None,
) -> None
Creates or updates a scheduled scaling action for an Auto Scaling group.
For more information, see Scheduled scaling in the Amazon EC2 Auto Scaling User Guide.
You can view the scheduled actions for an Auto Scaling group using the DescribeScheduledActions API call. If you are no longer using a scheduled action, you can delete it by calling the DeleteScheduledAction API.
If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns an error message.
Parameters:
-
auto_scaling_group_name(Optional[XmlStringMaxLen255], default:None) –The name of the Auto Scaling group.
-
scheduled_action_name(Optional[XmlStringMaxLen255], default:None) –The name of this scaling action.
-
time(Optional[TimestampType], default:None) –This property is no longer used.
-
start_time(Optional[TimestampType], default:None) –The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example,
"2021-06-01T00:00:00Z").If you specify
RecurrenceandStartTime, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence. -
end_time(Optional[TimestampType], default:None) –The date and time for the recurring schedule to end, in UTC. For example,
"2021-06-01T00:00:00Z". -
recurrence(Optional[XmlStringMaxLen255], default:None) –The recurring schedule for this action. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example,
"30 0 1 1,6,12 *"). For more information about this format, see Crontab.When
StartTimeandEndTimeare specified withRecurrence, they form the boundaries of when the recurring action starts and stops.Cron expressions use Universal Coordinated Time (UTC) by default.
-
min_size(Optional[AutoScalingGroupMinSize], default:None) –The minimum size of the Auto Scaling group.
-
max_size(Optional[AutoScalingGroupMaxSize], default:None) –The maximum size of the Auto Scaling group.
-
desired_capacity(Optional[AutoScalingGroupDesiredCapacity], default:None) –The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions.
You must specify at least one of the following properties:
MaxSize,MinSize, orDesiredCapacity. -
time_zone(Optional[XmlStringMaxLen255], default:None) –Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default.
Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as
Etc/GMT+9orPacific/Tahiti). For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
Raises:
-
AlreadyExistsFault–You already have an Auto Scaling group or launch configuration with this name.
-
LimitExceededFault–You have already reached a limit for your Amazon EC2 Auto Scaling resources (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
-
ResourceContentionFault–You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To add a scheduled action to an Auto Scaling group This example adds the specified scheduled action to the specified Auto Scaling group.
>>> client.put_scheduled_update_group_action(auto_scaling_group_name='my-auto-scaling-group', scheduled_action_name='my-scheduled-action', start_time='2014-05-12T08:00:00Z', end_time='2014-05-12T08:00:00Z', min_size=2, max_size=6, desired_capacity=4)
Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 | |