Skip to content

ECSClient#

Index > ECS > ECSClient

Auto-generated documentation for ECS type annotations stubs module mypy-boto3-ecs.

ECSClient#

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

# ECSClient usage example

from boto3.session import Session
from mypy_boto3_ecs.client import ECSClient

def get_ecs_client() -> ECSClient:
    return Session().client("ecs")

Exceptions#

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

# Exceptions.exceptions usage example

client = boto3.client("ecs")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.AttributeLimitExceededException,
    client.exceptions.BlockedException,
    client.exceptions.ClientError,
    client.exceptions.ClientException,
    client.exceptions.ClusterContainsContainerInstancesException,
    client.exceptions.ClusterContainsServicesException,
    client.exceptions.ClusterContainsTasksException,
    client.exceptions.ClusterNotFoundException,
    client.exceptions.ConflictException,
    client.exceptions.InvalidParameterException,
    client.exceptions.LimitExceededException,
    client.exceptions.MissingVersionException,
    client.exceptions.NamespaceNotFoundException,
    client.exceptions.NoUpdateAvailableException,
    client.exceptions.PlatformTaskDefinitionIncompatibilityException,
    client.exceptions.PlatformUnknownException,
    client.exceptions.ResourceInUseException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServerException,
    client.exceptions.ServiceNotActiveException,
    client.exceptions.ServiceNotFoundException,
    client.exceptions.TargetNotConnectedException,
    client.exceptions.TargetNotFoundException,
    client.exceptions.TaskSetNotFoundException,
    client.exceptions.UnsupportedFeatureException,
    client.exceptions.UpdateInProgressException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_ecs.client import Exceptions

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

Methods#

can_paginate#

Check if an operation can be paginated.

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

# can_paginate method definition

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

close#

Closes underlying endpoint connections.

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

# close method definition

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

create_capacity_provider#

Creates a new capacity provider.

Type annotations and code completion for boto3.client("ecs").create_capacity_provider method. boto3 documentation

# create_capacity_provider method definition

def create_capacity_provider(
    self,
    *,
    name: str,
    autoScalingGroupProvider: AutoScalingGroupProviderTypeDef,  # (1)
    tags: Sequence[TagTypeDef] = ...,  # (2)
) -> CreateCapacityProviderResponseTypeDef:  # (3)
    ...
  1. See AutoScalingGroupProviderTypeDef
  2. See TagTypeDef
  3. See CreateCapacityProviderResponseTypeDef
# create_capacity_provider method usage example with argument unpacking

kwargs: CreateCapacityProviderRequestRequestTypeDef = {  # (1)
    "name": ...,
    "autoScalingGroupProvider": ...,
}

parent.create_capacity_provider(**kwargs)
  1. See CreateCapacityProviderRequestRequestTypeDef

create_cluster#

Creates a new Amazon ECS cluster.

Type annotations and code completion for boto3.client("ecs").create_cluster method. boto3 documentation

# create_cluster method definition

def create_cluster(
    self,
    *,
    clusterName: str = ...,
    tags: Sequence[TagTypeDef] = ...,  # (1)
    settings: Sequence[ClusterSettingTypeDef] = ...,  # (2)
    configuration: ClusterConfigurationTypeDef = ...,  # (3)
    capacityProviders: Sequence[str] = ...,
    defaultCapacityProviderStrategy: Sequence[CapacityProviderStrategyItemTypeDef] = ...,  # (4)
    serviceConnectDefaults: ClusterServiceConnectDefaultsRequestTypeDef = ...,  # (5)
) -> CreateClusterResponseTypeDef:  # (6)
    ...
  1. See TagTypeDef
  2. See ClusterSettingTypeDef
  3. See ClusterConfigurationTypeDef
  4. See CapacityProviderStrategyItemTypeDef
  5. See ClusterServiceConnectDefaultsRequestTypeDef
  6. See CreateClusterResponseTypeDef
# create_cluster method usage example with argument unpacking

kwargs: CreateClusterRequestRequestTypeDef = {  # (1)
    "clusterName": ...,
}

parent.create_cluster(**kwargs)
  1. See CreateClusterRequestRequestTypeDef

create_service#

Runs and maintains your desired number of tasks from a specified task definition.

Type annotations and code completion for boto3.client("ecs").create_service method. boto3 documentation

# create_service method definition

def create_service(
    self,
    *,
    serviceName: str,
    cluster: str = ...,
    taskDefinition: str = ...,
    loadBalancers: Sequence[LoadBalancerTypeDef] = ...,  # (1)
    serviceRegistries: Sequence[ServiceRegistryTypeDef] = ...,  # (2)
    desiredCount: int = ...,
    clientToken: str = ...,
    launchType: LaunchTypeType = ...,  # (3)
    capacityProviderStrategy: Sequence[CapacityProviderStrategyItemTypeDef] = ...,  # (4)
    platformVersion: str = ...,
    role: str = ...,
    deploymentConfiguration: Union[DeploymentConfigurationTypeDef, DeploymentConfigurationOutputTypeDef] = ...,  # (5)
    placementConstraints: Sequence[PlacementConstraintTypeDef] = ...,  # (6)
    placementStrategy: Sequence[PlacementStrategyTypeDef] = ...,  # (7)
    networkConfiguration: Union[NetworkConfigurationTypeDef, NetworkConfigurationOutputTypeDef] = ...,  # (8)
    healthCheckGracePeriodSeconds: int = ...,
    schedulingStrategy: SchedulingStrategyType = ...,  # (9)
    deploymentController: DeploymentControllerTypeDef = ...,  # (10)
    tags: Sequence[TagTypeDef] = ...,  # (11)
    enableECSManagedTags: bool = ...,
    propagateTags: PropagateTagsType = ...,  # (12)
    enableExecuteCommand: bool = ...,
    serviceConnectConfiguration: Union[ServiceConnectConfigurationTypeDef, ServiceConnectConfigurationOutputTypeDef] = ...,  # (13)
    volumeConfigurations: Sequence[Union[ServiceVolumeConfigurationTypeDef, ServiceVolumeConfigurationOutputTypeDef]] = ...,  # (14)
) -> CreateServiceResponseTypeDef:  # (15)
    ...
  1. See LoadBalancerTypeDef
  2. See ServiceRegistryTypeDef
  3. See LaunchTypeType
  4. See CapacityProviderStrategyItemTypeDef
  5. See DeploymentConfigurationTypeDef DeploymentConfigurationOutputTypeDef
  6. See PlacementConstraintTypeDef
  7. See PlacementStrategyTypeDef
  8. See NetworkConfigurationTypeDef NetworkConfigurationOutputTypeDef
  9. See SchedulingStrategyType
  10. See DeploymentControllerTypeDef
  11. See TagTypeDef
  12. See PropagateTagsType
  13. See ServiceConnectConfigurationTypeDef ServiceConnectConfigurationOutputTypeDef
  14. See ServiceVolumeConfigurationTypeDef ServiceVolumeConfigurationOutputTypeDef
  15. See CreateServiceResponseTypeDef
# create_service method usage example with argument unpacking

kwargs: CreateServiceRequestRequestTypeDef = {  # (1)
    "serviceName": ...,
}

parent.create_service(**kwargs)
  1. See CreateServiceRequestRequestTypeDef

create_task_set#

Create a task set in the specified cluster and service.

Type annotations and code completion for boto3.client("ecs").create_task_set method. boto3 documentation

# create_task_set method definition

def create_task_set(
    self,
    *,
    service: str,
    cluster: str,
    taskDefinition: str,
    externalId: str = ...,
    networkConfiguration: Union[NetworkConfigurationTypeDef, NetworkConfigurationOutputTypeDef] = ...,  # (1)
    loadBalancers: Sequence[LoadBalancerTypeDef] = ...,  # (2)
    serviceRegistries: Sequence[ServiceRegistryTypeDef] = ...,  # (3)
    launchType: LaunchTypeType = ...,  # (4)
    capacityProviderStrategy: Sequence[CapacityProviderStrategyItemTypeDef] = ...,  # (5)
    platformVersion: str = ...,
    scale: ScaleTypeDef = ...,  # (6)
    clientToken: str = ...,
    tags: Sequence[TagTypeDef] = ...,  # (7)
) -> CreateTaskSetResponseTypeDef:  # (8)
    ...
  1. See NetworkConfigurationTypeDef NetworkConfigurationOutputTypeDef
  2. See LoadBalancerTypeDef
  3. See ServiceRegistryTypeDef
  4. See LaunchTypeType
  5. See CapacityProviderStrategyItemTypeDef
  6. See ScaleTypeDef
  7. See TagTypeDef
  8. See CreateTaskSetResponseTypeDef
# create_task_set method usage example with argument unpacking

kwargs: CreateTaskSetRequestRequestTypeDef = {  # (1)
    "service": ...,
    "cluster": ...,
    "taskDefinition": ...,
}

parent.create_task_set(**kwargs)
  1. See CreateTaskSetRequestRequestTypeDef

delete_account_setting