AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing ECR Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry service. Customers can use the familiar Docker CLI to push, pull, and manage images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon ECR supports private Docker repositories with resource-based permissions using AWS IAM so that specific users or Amazon EC2 instances can access repositories and images. Developers can use the Docker CLI to author and manage images.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.ECR.AmazonECRClient

Namespace: Amazon.ECR
Assembly: AWSSDK.ECR.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonECRClient : AmazonServiceClient
         IAmazonECR, IAmazonService, IDisposable

The AmazonECRClient type exposes the following members

Constructors

NameDescription
Public Method AmazonECRClient()

Constructs AmazonECRClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonECRClient(RegionEndpoint)

Constructs AmazonECRClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonECRClient(AmazonECRConfig)

Constructs AmazonECRClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonECRClient(AWSCredentials)

Constructs AmazonECRClient with AWS Credentials

Public Method AmazonECRClient(AWSCredentials, RegionEndpoint)

Constructs AmazonECRClient with AWS Credentials

Public Method AmazonECRClient(AWSCredentials, AmazonECRConfig)

Constructs AmazonECRClient with AWS Credentials and an AmazonECRClient Configuration object.

Public Method AmazonECRClient(string, string)

Constructs AmazonECRClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonECRClient(string, string, RegionEndpoint)

Constructs AmazonECRClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonECRClient(string, string, AmazonECRConfig)

Constructs AmazonECRClient with AWS Access Key ID, AWS Secret Key and an AmazonECRClient Configuration object.

Public Method AmazonECRClient(string, string, string)

Constructs AmazonECRClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonECRClient(string, string, string, RegionEndpoint)

Constructs AmazonECRClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonECRClient(string, string, string, AmazonECRConfig)

Constructs AmazonECRClient with AWS Access Key ID, AWS Secret Key and an AmazonECRClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method BatchCheckLayerAvailability(BatchCheckLayerAvailabilityRequest)

Check the availability of multiple image layers in a specified registry and repository.

This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Public Method BatchCheckLayerAvailabilityAsync(BatchCheckLayerAvailabilityRequest, CancellationToken)

Initiates the asynchronous execution of the BatchCheckLayerAvailability operation.

Public Method BatchDeleteImage(BatchDeleteImageRequest)

Deletes a list of specified images within a specified repository. Images are specified with either imageTag or imageDigest.

You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.

You can completely delete an image (and all of its tags) by specifying the image's digest in your request.

Public Method BatchDeleteImageAsync(BatchDeleteImageRequest, CancellationToken)

Initiates the asynchronous execution of the BatchDeleteImage operation.

Public Method BatchGetImage(BatchGetImageRequest)

Gets detailed information for specified images within a specified repository. Images are specified with either imageTag or imageDigest.

Public Method BatchGetImageAsync(BatchGetImageRequest, CancellationToken)

Initiates the asynchronous execution of the BatchGetImage operation.

Public Method CompleteLayerUpload(CompleteLayerUploadRequest)

Inform Amazon ECR that the image layer upload for a specified registry, repository name, and upload ID, has completed. You can optionally provide a sha256 digest of the image layer for data validation purposes.

This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Public Method CompleteLayerUploadAsync(CompleteLayerUploadRequest, CancellationToken)

Initiates the asynchronous execution of the CompleteLayerUpload operation.

Public Method CreateRepository(CreateRepositoryRequest)

Creates an image repository.

Public Method CreateRepositoryAsync(CreateRepositoryRequest, CancellationToken)

Initiates the asynchronous execution of the CreateRepository operation.

Public Method DeleteRepository(DeleteRepositoryRequest)

Deletes an existing image repository. If a repository contains images, you must use the force option to delete it.

Public Method DeleteRepositoryAsync(DeleteRepositoryRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteRepository operation.

Public Method DeleteRepositoryPolicy(DeleteRepositoryPolicyRequest)

Deletes the repository policy from a specified repository.

Public Method DeleteRepositoryPolicyAsync(DeleteRepositoryPolicyRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteRepositoryPolicy operation.

Public Method DescribeImages(DescribeImagesRequest)

Returns metadata about the images in a repository, including image size, image tags, and creation date.

Beginning with Docker version 1.9, the Docker client compresses image layers before pushing them to a V2 Docker registry. The output of the docker images command shows the uncompressed image size, so it may return a larger image size than the image sizes returned by DescribeImages.

Public Method DescribeImagesAsync(DescribeImagesRequest, CancellationToken)

Initiates the asynchronous execution of the DescribeImages operation.

Public Method DescribeRepositories(DescribeRepositoriesRequest)

Describes image repositories in a registry.

Public Method DescribeRepositoriesAsync(DescribeRepositoriesRequest, CancellationToken)

Initiates the asynchronous execution of the DescribeRepositories operation.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetAuthorizationToken(GetAuthorizationTokenRequest)

Retrieves a token that is valid for a specified registry for 12 hours. This command allows you to use the docker CLI to push and pull images with Amazon ECR. If you do not specify a registry, the default registry is assumed.

The authorizationToken returned for each registry specified is a base64 encoded string that can be decoded and used in a docker login command to authenticate to a registry. The AWS CLI offers an aws ecr get-login command that simplifies the login process.

Public Method GetAuthorizationTokenAsync(GetAuthorizationTokenRequest, CancellationToken)

Initiates the asynchronous execution of the GetAuthorizationToken operation.

Public Method GetDownloadUrlForLayer(GetDownloadUrlForLayerRequest)

Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.

This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Public Method GetDownloadUrlForLayerAsync(GetDownloadUrlForLayerRequest, CancellationToken)

Initiates the asynchronous execution of the GetDownloadUrlForLayer operation.

Public Method GetRepositoryPolicy(GetRepositoryPolicyRequest)

Retrieves the repository policy for a specified repository.

Public Method GetRepositoryPolicyAsync(GetRepositoryPolicyRequest, CancellationToken)

Initiates the asynchronous execution of the GetRepositoryPolicy operation.

Public Method InitiateLayerUpload(InitiateLayerUploadRequest)

Notify Amazon ECR that you intend to upload an image layer.

This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Public Method InitiateLayerUploadAsync(InitiateLayerUploadRequest, CancellationToken)

Initiates the asynchronous execution of the InitiateLayerUpload operation.

Public Method ListImages(ListImagesRequest)

Lists all the image IDs for a given repository.

You can filter images based on whether or not they are tagged by setting the tagStatus parameter to TAGGED or UNTAGGED. For example, you can filter your results to return only UNTAGGED images and then pipe that result to a BatchDeleteImage operation to delete them. Or, you can filter your results to return only TAGGED images to list all of the tags in your repository.

Public Method ListImagesAsync(ListImagesRequest, CancellationToken)

Initiates the asynchronous execution of the ListImages operation.

Public Method PutImage(PutImageRequest)

Creates or updates the image manifest and tags associated with an image.

This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Public Method PutImageAsync(PutImageRequest, CancellationToken)

Initiates the asynchronous execution of the PutImage operation.

Public Method SetRepositoryPolicy(SetRepositoryPolicyRequest)

Applies a repository policy on a specified repository to control access permissions.

Public Method SetRepositoryPolicyAsync(SetRepositoryPolicyRequest, CancellationToken)

Initiates the asynchronous execution of the SetRepositoryPolicy operation.

Public Method UploadLayerPart(UploadLayerPartRequest)

Uploads an image layer part to Amazon ECR.

This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Public Method UploadLayerPartAsync(UploadLayerPartRequest, CancellationToken)

Initiates the asynchronous execution of the UploadLayerPart operation.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms