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)
...
# create_capacity_provider method usage example with argument unpacking
kwargs: CreateCapacityProviderRequestRequestTypeDef = { # (1)
"name": ...,
"autoScalingGroupProvider": ...,
}
parent.create_capacity_provider(**kwargs)
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)
...
- See TagTypeDef
- See ClusterSettingTypeDef
- See ClusterConfigurationTypeDef
- See CapacityProviderStrategyItemTypeDef
- See ClusterServiceConnectDefaultsRequestTypeDef
- See CreateClusterResponseTypeDef
# create_cluster method usage example with argument unpacking
kwargs: CreateClusterRequestRequestTypeDef = { # (1)
"clusterName": ...,
}
parent.create_cluster(**kwargs)
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.