Skip to content

ECRClient#

Index > ECR > ECRClient

Auto-generated documentation for ECR type annotations stubs module mypy-boto3-ecr.

ECRClient#

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

# ECRClient usage example

from boto3.session import Session
from mypy_boto3_ecr.client import ECRClient

def get_ecr_client() -> ECRClient:
    return Session().client("ecr")

Exceptions#

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

# Exceptions.exceptions usage example

client = boto3.client("ecr")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.EmptyUploadException,
    client.exceptions.ImageAlreadyExistsException,
    client.exceptions.ImageDigestDoesNotMatchException,
    client.exceptions.ImageNotFoundException,
    client.exceptions.ImageTagAlreadyExistsException,
    client.exceptions.InvalidLayerException,
    client.exceptions.InvalidLayerPartException,
    client.exceptions.InvalidParameterException,
    client.exceptions.InvalidTagParameterException,
    client.exceptions.KmsException,
    client.exceptions.LayerAlreadyExistsException,
    client.exceptions.LayerInaccessibleException,
    client.exceptions.LayerPartTooSmallException,
    client.exceptions.LayersNotFoundException,
    client.exceptions.LifecyclePolicyNotFoundException,
    client.exceptions.LifecyclePolicyPreviewInProgressException,
    client.exceptions.LifecyclePolicyPreviewNotFoundException,
    client.exceptions.LimitExceededException,
    client.exceptions.PullThroughCacheRuleAlreadyExistsException,
    client.exceptions.PullThroughCacheRuleNotFoundException,
    client.exceptions.ReferencedImagesNotFoundException,
    client.exceptions.RegistryPolicyNotFoundException,
    client.exceptions.RepositoryAlreadyExistsException,
    client.exceptions.RepositoryNotEmptyException,
    client.exceptions.RepositoryNotFoundException,
    client.exceptions.RepositoryPolicyNotFoundException,
    client.exceptions.ScanNotFoundException,
    client.exceptions.SecretNotFoundException,
    client.exceptions.ServerException,
    client.exceptions.TemplateAlreadyExistsException,
    client.exceptions.TemplateNotFoundException,
    client.exceptions.TooManyTagsException,
    client.exceptions.UnableToAccessSecretException,
    client.exceptions.UnableToDecryptSecretValueException,
    client.exceptions.UnableToGetUpstreamImageException,
    client.exceptions.UnableToGetUpstreamLayerException,
    client.exceptions.UnsupportedImageTypeException,
    client.exceptions.UnsupportedUpstreamRegistryException,
    client.exceptions.UploadNotFoundException,
    client.exceptions.ValidationException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_ecr.client import Exceptions

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

Methods#

batch_check_layer_availability#

Checks the availability of one or more image layers in a repository.

Type annotations and code completion for boto3.client("ecr").batch_check_layer_availability method. boto3 documentation

# batch_check_layer_availability method definition

def batch_check_layer_availability(
    self,
    *,
    repositoryName: str,
    layerDigests: Sequence[str],
    registryId: str = ...,
) -> BatchCheckLayerAvailabilityResponseTypeDef:  # (1)
    ...
  1. See BatchCheckLayerAvailabilityResponseTypeDef
# batch_check_layer_availability method usage example with argument unpacking

kwargs: BatchCheckLayerAvailabilityRequestRequestTypeDef = {  # (1)
    "repositoryName": ...,
    "layerDigests": ...,
}

parent.batch_check_layer_availability(**kwargs)
  1. See BatchCheckLayerAvailabilityRequestRequestTypeDef

batch_delete_image#

Deletes a list of specified images within a repository.

Type annotations and code completion for boto3.client("ecr").batch_delete_image method. boto3 documentation

# batch_delete_image method definition

def batch_delete_image(
    self,
    *,
    repositoryName: str,
    imageIds: Sequence[ImageIdentifierTypeDef],  # (1)
    registryId: str = ...,
) -> BatchDeleteImageResponseTypeDef:  # (2)
    ...
  1. See ImageIdentifierTypeDef
  2. See BatchDeleteImageResponseTypeDef
# batch_delete_image method usage example with argument unpacking

kwargs: BatchDeleteImageRequestRequestTypeDef = {  # (1)
    "repositoryName": ...,
    "imageIds": ...,
}

parent.batch_delete_image(**kwargs)
  1. See BatchDeleteImageRequestRequestTypeDef

batch_get_image#

Gets detailed information for an image.

Type annotations and code completion for boto3.client("ecr").batch_get_image method. boto3 documentation

# batch_get_image method definition

def batch_get_image(
    self,
    *,
    repositoryName: str,
    imageIds: Sequence[ImageIdentifierTypeDef],  # (1)
    registryId: str = ...,
    acceptedMediaTypes: Sequence[str] = ...,
) -> BatchGetImageResponseTypeDef:  # (2)
    ...
  1. See ImageIdentifierTypeDef
  2. See BatchGetImageResponseTypeDef
# batch_get_image method usage example with argument unpacking

kwargs: BatchGetImageRequestRequestTypeDef = {  # (1)
    "repositoryName": ...,
    "imageIds": ...,
}

parent.batch_get_image(**kwargs)
  1. See BatchGetImageRequestRequestTypeDef

batch_get_repository_scanning_configuration#

Gets the scanning configuration for one or more repositories.

Type annotations and code completion for boto3.client("ecr").batch_get_repository_scanning_configuration method.