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
4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 | |