put_scheduled_update_group_action
async
¶
put_scheduled_update_group_action(
*,
config_overrides: Optional[AsyncAutoScalingClientConfig] = 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.
>>> await 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/async_auto_scaling.py
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 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 | |