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.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. boto3 documentation

# batch_get_repository_scanning_configuration method definition

def batch_get_repository_scanning_configuration(
    self,
    *,
    repositoryNames: Sequence[str],
) -> BatchGetRepositoryScanningConfigurationResponseTypeDef:  # (1)
    ...
  1. See BatchGetRepositoryScanningConfigurationResponseTypeDef
# batch_get_repository_scanning_configuration method usage example with argument unpacking

kwargs: BatchGetRepositoryScanningConfigurationRequestRequestTypeDef = {  # (1)
    "repositoryNames": ...,
}

parent.batch_get_repository_scanning_configuration(**kwargs)
  1. See BatchGetRepositoryScanningConfigurationRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("ecr").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("ecr").close method. boto3 documentation

# close method definition

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

complete_layer_upload#

Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID.

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

# complete_layer_upload method definition

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

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

parent.complete_layer_upload(**kwargs)
  1. See CompleteLayerUploadRequestRequestTypeDef

create_pull_through_cache_rule#

Creates a pull through cache rule.

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

# create_pull_through_cache_rule method definition

def create_pull_through_cache_rule(
    self,
    *,
    ecrRepositoryPrefix: str,
    upstreamRegistryUrl: str,
    registryId: str = ...,
    upstreamRegistry: UpstreamRegistryType = ...,  # (1)
    credentialArn: str = ...,
) -> CreatePullThroughCacheRuleResponseTypeDef:  # (2)
    ...
  1. See UpstreamRegistryType
  2. See CreatePullThroughCacheRuleResponseTypeDef
# create_pull_through_cache_rule method usage example with argument unpacking

kwargs: CreatePullThroughCacheRuleRequestRequestTypeDef = {  # (1)
    "ecrRepositoryPrefix": ...,
    "upstreamRegistryUrl": ...,
}

parent.create_pull_through_cache_rule(**kwargs)
  1. See CreatePullThroughCacheRuleRequestRequestTypeDef

create_repository#

Creates a repository.

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

# create_repository method definition

def create_repository(
    self,
    *,
    repositoryName: str,
    registryId: str = ...,
    tags: Sequence[TagTypeDef] = ...,  # (1)
    imageTagMutability: ImageTagMutabilityType = ...,  # (2)
    imageScanningConfiguration: ImageScanningConfigurationTypeDef = ...,  # (3)
    encryptionConfiguration: EncryptionConfigurationTypeDef = ...,  # (4)
) -> CreateRepositoryResponseTypeDef:  # (5)
    ...
  1. See TagTypeDef
  2. See ImageTagMutabilityType
  3. See ImageScanningConfigurationTypeDef
  4. See EncryptionConfigurationTypeDef
  5. See CreateRepositoryResponseTypeDef
# create_repository method usage example with argument unpacking

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

parent.create_repository(**kwargs)
  1. See CreateRepositoryRequestRequestTypeDef

delete_lifecycle_policy#

Deletes the lifecycle policy associated with the specified repository.

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

# delete_lifecycle_policy method definition

def delete_lifecycle_policy(
    self,
    *,
    repositoryName: str,
    registryId: str = ...,
) -> DeleteLifecyclePolicyResponseTypeDef:  # (1)
    ...
  1. See DeleteLifecyclePolicyResponseTypeDef
# delete_lifecycle_policy method usage example with argument unpacking

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

parent.delete_lifecycle_policy(**kwargs)
  1. See DeleteLifecyclePolicyRequestRequestTypeDef

delete_pull_through_cache_rule#

Deletes a pull through cache rule.

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

# delete_pull_through_cache_rule method definition

def delete_pull_through_cache_rule(
    self,
    *,
    ecrRepositoryPrefix: str,
    registryId: str = ...,
) -> DeletePullThroughCacheRuleResponseTypeDef:  # (1)
    ...
  1. See DeletePullThroughCacheRuleResponseTypeDef
# delete_pull_through_cache_rule method usage example with argument unpacking

kwargs: DeletePullThroughCacheRuleRequestRequestTypeDef = {  # (1)
    "ecrRepositoryPrefix": ...,
}

parent.delete_pull_through_cache_rule(**kwargs)
  1. See DeletePullThroughCacheRuleRequestRequestTypeDef

delete_registry_policy#

Deletes the registry permissions policy.

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