Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.
If you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly. For more information, see Suspend and resume Amazon EC2 Auto Scaling processes in the Amazon EC2 Auto Scaling User Guide.
To resume processes that have been suspended, call the ResumeProcesses API.
Parameters:
-
auto_scaling_group_name
(Optional[XmlStringMaxLen255], default:
None
)
–
The name of the Auto Scaling group.
-
scaling_processes
(Optional[ProcessNames], default:
None
)
–
One or more of the following processes:
-
Launch
-
Terminate
-
AddToLoadBalancer
-
AlarmNotification
-
AZRebalance
-
HealthCheck
-
InstanceRefresh
-
ReplaceUnhealthy
-
ScheduledActions
If you omit this property, all processes are specified.
Raises:
-
ResourceContentionFault
–
You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
-
ResourceInUseFault
–
The operation can't be performed because the resource is in use.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To suspend Auto Scaling processes
This example suspends the specified scaling process for the specified Auto Scaling group.
>>> await client.suspend_processes(auto_scaling_group_name='my-auto-scaling-group', scaling_processes=['AlarmNotification'])
Source code in docs_src/capo_auto_scaling/_services/async_auto_scaling.py
| async def suspend_processes(
self,
*,
config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
auto_scaling_group_name: Optional[
"capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
] = None,
scaling_processes: Optional[
"capo_auto_scaling.types.process_names.ProcessNames"
] = None,
) -> None:
"""<p>Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.</p> <p>If you suspend either the <code>Launch</code> or <code>Terminate</code> process types, it can prevent other process types from functioning properly. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html">Suspend and resume Amazon EC2 Auto Scaling processes</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>To resume processes that have been suspended, call the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_ResumeProcesses.html">ResumeProcesses</a> API.</p>
Args:
auto_scaling_group_name: <p>The name of the Auto Scaling group.</p>
scaling_processes: <p>One or more of the following processes:</p> <ul> <li> <p> <code>Launch</code> </p> </li> <li> <p> <code>Terminate</code> </p> </li> <li> <p> <code>AddToLoadBalancer</code> </p> </li> <li> <p> <code>AlarmNotification</code> </p> </li> <li> <p> <code>AZRebalance</code> </p> </li> <li> <p> <code>HealthCheck</code> </p> </li> <li> <p> <code>InstanceRefresh</code> </p> </li> <li> <p> <code>ReplaceUnhealthy</code> </p> </li> <li> <p> <code>ScheduledActions</code> </p> </li> </ul> <p>If you omit this property, all processes are specified.</p>
Raises:
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.resource_in_use_fault.ResourceInUseFault: <p>The operation can't be performed because the resource is in use.</p>
capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To suspend Auto Scaling processes
This example suspends the specified scaling process for the specified Auto Scaling group.
>>> await client.suspend_processes(auto_scaling_group_name='my-auto-scaling-group', scaling_processes=['AlarmNotification'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_auto_scaling.types.scaling_process_query.ScalingProcessQuery]",
) -> AsyncOperationResponse[None]:
import capo_auto_scaling._operations.auto_scaling_2011_01_01.suspend_processes
(
output,
http_response,
) = await capo_auto_scaling._operations.auto_scaling_2011_01_01.suspend_processes.async_suspend_processes(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("SuspendProcesses")
)
input_: capo_auto_scaling.types.scaling_process_query.ScalingProcessQuery = {}
if auto_scaling_group_name is not None:
input_["auto_scaling_group_name"] = auto_scaling_group_name
if scaling_processes is not None:
input_["scaling_processes"] = scaling_processes
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|