Skip to content

batch_put_scheduled_update_group_action

batch_put_scheduled_update_group_action(
    *,
    config_overrides: Optional[AutoScalingClientConfig] = None,
    auto_scaling_group_name: Optional[XmlStringMaxLen255] = None,
    scheduled_update_group_actions: Optional[ScheduledUpdateGroupActionRequests] = None,
) -> BatchPutScheduledUpdateGroupActionAnswer

Creates or updates one or more scheduled scaling actions for an Auto Scaling group.

Parameters:

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.

Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
def batch_put_scheduled_update_group_action(
    self,
    *,
    config_overrides: Optional[AutoScalingClientConfig] = None,
    auto_scaling_group_name: Optional[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ] = None,
    scheduled_update_group_actions: Optional[
        "capo_auto_scaling.types.scheduled_update_group_action_requests.ScheduledUpdateGroupActionRequests"
    ] = None,
) -> "capo_auto_scaling.types.batch_put_scheduled_update_group_action_answer.BatchPutScheduledUpdateGroupActionAnswer":
    """<p>Creates or updates one or more scheduled scaling actions for an Auto Scaling group.</p>

    Args:
        auto_scaling_group_name: <p>The name of the Auto Scaling group.</p>
        scheduled_update_group_actions: <p>One or more scheduled actions. The maximum number allowed is 50.</p>

    Raises:
        capo_auto_scaling.errors.already_exists_fault.AlreadyExistsFault: <p>You already have an Auto Scaling group or launch configuration with this name.</p>
        capo_auto_scaling.errors.limit_exceeded_fault.LimitExceededFault: <p>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 <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html">DescribeAccountLimits</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p>
        capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
        capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_auto_scaling.types.batch_put_scheduled_update_group_action_type.BatchPutScheduledUpdateGroupActionType]",
    ) -> OperationResponse[
        "capo_auto_scaling.types.batch_put_scheduled_update_group_action_answer.BatchPutScheduledUpdateGroupActionAnswer"
    ]:
        import capo_auto_scaling._operations.auto_scaling_2011_01_01.batch_put_scheduled_update_group_action

        output, http_response = (
            capo_auto_scaling._operations.auto_scaling_2011_01_01.batch_put_scheduled_update_group_action.batch_put_scheduled_update_group_action(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchPutScheduledUpdateGroupAction")
    )
    input_: capo_auto_scaling.types.batch_put_scheduled_update_group_action_type.BatchPutScheduledUpdateGroupActionType = {}
    if auto_scaling_group_name is not None:
        input_["auto_scaling_group_name"] = auto_scaling_group_name
    if scheduled_update_group_actions is not None:
        input_["scheduled_update_group_actions"] = scheduled_update_group_actions

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output