Skip to content

AutoScalingClient#

Index > AutoScaling > AutoScalingClient

Auto-generated documentation for AutoScaling type annotations stubs module mypy-boto3-autoscaling.

AutoScalingClient#

Type annotations and code completion for boto3.client("autoscaling"). boto3 documentation

# AutoScalingClient usage example

from boto3.session import Session
from mypy_boto3_autoscaling.client import AutoScalingClient

def get_autoscaling_client() -> AutoScalingClient:
    return Session().client("autoscaling")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("autoscaling").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("autoscaling")

try:
    do_something(client)
except (
    client.exceptions.ActiveInstanceRefreshNotFoundFault,
    client.exceptions.AlreadyExistsFault,
    client.exceptions.ClientError,
    client.exceptions.InstanceRefreshInProgressFault,
    client.exceptions.InvalidNextToken,
    client.exceptions.IrreversibleInstanceRefreshFault,
    client.exceptions.LimitExceededFault,
    client.exceptions.ResourceContentionFault,
    client.exceptions.ResourceInUseFault,
    client.exceptions.ScalingActivityInProgressFault,
    client.exceptions.ServiceLinkedRoleFailure,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_autoscaling.client import Exceptions

def handle_error(exc: Exceptions.ActiveInstanceRefreshNotFoundFault) -> None:
    ...

Methods#

attach_instances#

Attaches one or more EC2 instances to the specified Auto Scaling group.

Type annotations and code completion for boto3.client("autoscaling").attach_instances method. boto3 documentation

# attach_instances method definition

def attach_instances(
    self,
    *,
    AutoScalingGroupName: str,
    InstanceIds: Sequence[str] = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# attach_instances method usage example with argument unpacking

kwargs: AttachInstancesQueryRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
}

parent.attach_instances(**kwargs)
  1. See AttachInstancesQueryRequestTypeDef

attach_load_balancer_target_groups#

.

Type annotations and code completion for boto3.client("autoscaling").attach_load_balancer_target_groups method. boto3 documentation

# attach_load_balancer_target_groups method definition

def attach_load_balancer_target_groups(
    self,
    *,
    AutoScalingGroupName: str,
    TargetGroupARNs: Sequence[str],
) -> Dict[str, Any]:
    ...
# attach_load_balancer_target_groups method usage example with argument unpacking

kwargs: AttachLoadBalancerTargetGroupsTypeRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
    "TargetGroupARNs": ...,
}

parent.attach_load_balancer_target_groups(**kwargs)
  1. See AttachLoadBalancerTargetGroupsTypeRequestTypeDef

attach_load_balancers#

.

Type annotations and code completion for boto3.client("autoscaling").attach_load_balancers method. boto3 documentation

# attach_load_balancers method definition

def attach_load_balancers(
    self,
    *,
    AutoScalingGroupName: str,
    LoadBalancerNames: Sequence[str],
) -> Dict[str, Any]:
    ...
# attach_load_balancers method usage example with argument unpacking

kwargs: AttachLoadBalancersTypeRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
    "LoadBalancerNames": ...,
}

parent.attach_load_balancers(**kwargs)
  1. See AttachLoadBalancersTypeRequestTypeDef

attach_traffic_sources#

Attaches one or more traffic sources to the specified Auto Scaling group.

Type annotations and code completion for boto3.client("autoscaling").attach_traffic_sources method. boto3 documentation

# attach_traffic_sources method definition

def attach_traffic_sources(
    self,
    *,
    AutoScalingGroupName: str,
    TrafficSources: Sequence[TrafficSourceIdentifierTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TrafficSourceIdentifierTypeDef
# attach_traffic_sources method usage example with argument unpacking

kwargs: AttachTrafficSourcesTypeRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
    "TrafficSources": ...,
}

parent.attach_traffic_sources(**kwargs)
  1. See AttachTrafficSourcesTypeRequestTypeDef

batch_delete_scheduled_action#

Deletes one or more scheduled actions for the specified Auto Scaling group.

Type annotations and code completion for boto3.client("autoscaling").batch_delete_scheduled_action method. boto3 documentation

# batch_delete_scheduled_action method definition

def batch_delete_scheduled_action(
    self,
    *,
    AutoScalingGroupName: str,
    ScheduledActionNames: Sequence[str],
) -> BatchDeleteScheduledActionAnswerTypeDef:  # (1)
    ...
  1. See BatchDeleteScheduledActionAnswerTypeDef
# batch_delete_scheduled_action method usage example with argument unpacking

kwargs: BatchDeleteScheduledActionTypeRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
    "ScheduledActionNames": ...,
}

parent.batch_delete_scheduled_action(**kwargs)
  1. See BatchDeleteScheduledActionTypeRequestTypeDef

batch_put_scheduled_update_group_action#

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

Type annotations and code completion for boto3.client("autoscaling").batch_put_scheduled_update_group_action method. boto3 documentation

# batch_put_scheduled_update_group_action method definition

def batch_put_scheduled_update_group_action(
    self,
    *,
    AutoScalingGroupName: str,
    ScheduledUpdateGroupActions: Sequence[ScheduledUpdateGroupActionRequestTypeDef],  # (1)
) -> BatchPutScheduledUpdateGroupActionAnswerTypeDef:  # (2)
    ...
  1. See ScheduledUpdateGroupActionRequestTypeDef
  2. See BatchPutScheduledUpdateGroupActionAnswerTypeDef
# batch_put_scheduled_update_group_action method usage example with argument unpacking

kwargs: BatchPutScheduledUpdateGroupActionTypeRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
    "ScheduledUpdateGroupActions": ...,
}

parent.batch_put_scheduled_update_group_action(**kwargs)
  1. See BatchPutScheduledUpdateGroupActionTypeRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("autoscaling").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

cancel_instance_refresh#

Cancels an instance refresh or rollback that is in progress.

Type annotations and code completion for boto3.client("autoscaling").cancel_instance_refresh method. boto3 documentation

# cancel_instance_refresh method definition

def cancel_instance_refresh(
    self,
    *,
    AutoScalingGroupName: str,
) -> CancelInstanceRefreshAnswerTypeDef:  # (1)
    ...
  1. See CancelInstanceRefreshAnswerTypeDef
# cancel_instance_refresh method usage example with argument unpacking

kwargs: CancelInstanceRefreshTypeRequestTypeDef = {  # (1)
    "AutoScalingGroupName": ...,
}

parent.cancel_instance_refresh(**kwargs)
  1. See CancelInstanceRefreshTypeRequestTypeDef

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("autoscaling").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

complete_lifecycle_action#

Completes the lifecycle action for the specified token or instance with the specified result.

Type annotations and code completion for boto3.client("autoscaling").complete_lifecycle_action method. boto3 documentation

# complete_lifecycle_action method definition

def complete_lifecycle_action(
    self,
    *,
    LifecycleHookName: str,
    AutoScalingGroupName: str,
    LifecycleActionResult: str,
    LifecycleActionToken: str = ...,
    InstanceId: str = ...,
) -> Dict[str, Any]:
    ...
# complete_lifecycle_action method usage example with argument unpacking

kwargs: CompleteLifecycleAction