All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ecr.AmazonECRClient Maven / Gradle / Ivy

/*
 * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.ecr;

import org.w3c.dom.*;

import java.net.*;
import java.util.*;

import javax.annotation.Generated;

import org.apache.commons.logging.*;

import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;

import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.services.ecr.AmazonECRClientBuilder;

import com.amazonaws.AmazonServiceException;

import com.amazonaws.services.ecr.model.*;
import com.amazonaws.services.ecr.model.transform.*;

/**
 * Client for accessing Amazon ECR. All service calls made using this client are blocking, and will not return until the
 * service call completes.
 * 

*

* 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. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonECRClient extends AmazonWebServiceClient implements AmazonECR { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AmazonECR.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "ecr"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LayerPartTooSmallException").withModeledClass( com.amazonaws.services.ecr.model.LayerPartTooSmallException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidLayerPartException").withModeledClass( com.amazonaws.services.ecr.model.InvalidLayerPartException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidParameterException").withModeledClass( com.amazonaws.services.ecr.model.InvalidParameterException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ServerException").withModeledClass( com.amazonaws.services.ecr.model.ServerException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("RepositoryNotEmptyException").withModeledClass( com.amazonaws.services.ecr.model.RepositoryNotEmptyException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LayerAlreadyExistsException").withModeledClass( com.amazonaws.services.ecr.model.LayerAlreadyExistsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("EmptyUploadException").withModeledClass( com.amazonaws.services.ecr.model.EmptyUploadException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ImageNotFoundException").withModeledClass( com.amazonaws.services.ecr.model.ImageNotFoundException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LayersNotFoundException").withModeledClass( com.amazonaws.services.ecr.model.LayersNotFoundException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidLayerException").withModeledClass( com.amazonaws.services.ecr.model.InvalidLayerException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("RepositoryNotFoundException").withModeledClass( com.amazonaws.services.ecr.model.RepositoryNotFoundException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("RepositoryAlreadyExistsException").withModeledClass( com.amazonaws.services.ecr.model.RepositoryAlreadyExistsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("RepositoryPolicyNotFoundException").withModeledClass( com.amazonaws.services.ecr.model.RepositoryPolicyNotFoundException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ImageAlreadyExistsException").withModeledClass( com.amazonaws.services.ecr.model.ImageAlreadyExistsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LayerInaccessibleException").withModeledClass( com.amazonaws.services.ecr.model.LayerInaccessibleException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withModeledClass( com.amazonaws.services.ecr.model.LimitExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("UploadNotFoundException").withModeledClass( com.amazonaws.services.ecr.model.UploadNotFoundException.class)) .withBaseServiceExceptionClass(com.amazonaws.services.ecr.model.AmazonECRException.class)); /** * Constructs a new client to invoke service methods on Amazon ECR. A credentials provider chain will be used that * searches for credentials in this order: *
    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
* *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @see DefaultAWSCredentialsProviderChain * @deprecated use {@link AmazonECRClientBuilder#defaultClient()} */ @Deprecated public AmazonECRClient() { this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on Amazon ECR. A credentials provider chain will be used that * searches for credentials in this order: *

    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
* *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientConfiguration * The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings, * retry counts, etc.). * * @see DefaultAWSCredentialsProviderChain * @deprecated use {@link AmazonECRClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AmazonECRClient(ClientConfiguration clientConfiguration) { this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration); } /** * Constructs a new client to invoke service methods on Amazon ECR using the specified AWS account credentials. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @deprecated use {@link AmazonECRClientBuilder#withCredentials(AWSCredentialsProvider)} for example: * {@code AmazonECRClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();} */ @Deprecated public AmazonECRClient(AWSCredentials awsCredentials) { this(awsCredentials, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on Amazon ECR using the specified AWS account credentials and * client configuration options. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings, * retry counts, etc.). * @deprecated use {@link AmazonECRClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AmazonECRClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AmazonECRClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials); init(); } /** * Constructs a new client to invoke service methods on Amazon ECR using the specified AWS account credentials * provider. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @deprecated use {@link AmazonECRClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on Amazon ECR using the specified AWS account credentials * provider and client configuration options. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings, * retry counts, etc.). * @deprecated use {@link AmazonECRClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AmazonECRClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, null); } /** * Constructs a new client to invoke service methods on Amazon ECR using the specified AWS account credentials * provider, client configuration options, and request metric collector. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings, * retry counts, etc.). * @param requestMetricCollector * optional request metric collector * @deprecated use {@link AmazonECRClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AmazonECRClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AmazonECRClientBuilder#withMetricsCollector(RequestMetricCollector)} */ @Deprecated public AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(clientConfiguration, requestMetricCollector); this.awsCredentialsProvider = awsCredentialsProvider; init(); } public static AmazonECRClientBuilder builder() { return AmazonECRClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on Amazon ECR using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AmazonECRClient(AwsSyncClientParams clientParams) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("ecr.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/ecr/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/ecr/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *

* 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. *

*
* * @param batchCheckLayerAvailabilityRequest * @return Result of the BatchCheckLayerAvailability operation returned by the service. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws ServerException * These errors are usually caused by a server-side issue. * @sample AmazonECR.BatchCheckLayerAvailability * @see AWS API Documentation */ @Override public BatchCheckLayerAvailabilityResult batchCheckLayerAvailability(BatchCheckLayerAvailabilityRequest request) { request = beforeClientExecution(request); return executeBatchCheckLayerAvailability(request); } @SdkInternalApi final BatchCheckLayerAvailabilityResult executeBatchCheckLayerAvailability(BatchCheckLayerAvailabilityRequest batchCheckLayerAvailabilityRequest) { ExecutionContext executionContext = createExecutionContext(batchCheckLayerAvailabilityRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new BatchCheckLayerAvailabilityRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(batchCheckLayerAvailabilityRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchCheckLayerAvailabilityResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

* * @param batchDeleteImageRequest * Deletes specified images within a specified repository. Images are specified with either the * imageTag or imageDigest. * @return Result of the BatchDeleteImage operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.BatchDeleteImage * @see AWS API * Documentation */ @Override public BatchDeleteImageResult batchDeleteImage(BatchDeleteImageRequest request) { request = beforeClientExecution(request); return executeBatchDeleteImage(request); } @SdkInternalApi final BatchDeleteImageResult executeBatchDeleteImage(BatchDeleteImageRequest batchDeleteImageRequest) { ExecutionContext executionContext = createExecutionContext(batchDeleteImageRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new BatchDeleteImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchDeleteImageRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchDeleteImageResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

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

* * @param batchGetImageRequest * @return Result of the BatchGetImage operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.BatchGetImage * @see AWS API * Documentation */ @Override public BatchGetImageResult batchGetImage(BatchGetImageRequest request) { request = beforeClientExecution(request); return executeBatchGetImage(request); } @SdkInternalApi final BatchGetImageResult executeBatchGetImage(BatchGetImageRequest batchGetImageRequest) { ExecutionContext executionContext = createExecutionContext(batchGetImageRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new BatchGetImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetImageRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchGetImageResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

*
* * @param completeLayerUploadRequest * @return Result of the CompleteLayerUpload operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws UploadNotFoundException * The upload could not be found, or the specified upload id is not valid for this repository. * @throws InvalidLayerException * The layer digest calculation performed by Amazon ECR upon receipt of the image layer does not match the * digest specified. * @throws LayerPartTooSmallException * Layer parts must be at least 5 MiB in size. * @throws LayerAlreadyExistsException * The image layer already exists in the associated repository. * @throws EmptyUploadException * The specified layer upload does not contain any layer parts. * @sample AmazonECR.CompleteLayerUpload * @see AWS API * Documentation */ @Override public CompleteLayerUploadResult completeLayerUpload(CompleteLayerUploadRequest request) { request = beforeClientExecution(request); return executeCompleteLayerUpload(request); } @SdkInternalApi final CompleteLayerUploadResult executeCompleteLayerUpload(CompleteLayerUploadRequest completeLayerUploadRequest) { ExecutionContext executionContext = createExecutionContext(completeLayerUploadRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CompleteLayerUploadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(completeLayerUploadRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CompleteLayerUploadResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates an image repository. *

* * @param createRepositoryRequest * @return Result of the CreateRepository operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryAlreadyExistsException * The specified repository already exists in the specified registry. * @throws LimitExceededException * The operation did not succeed because it would have exceeded a service limit for your account. For more * information, see Amazon ECR Default * Service Limits in the Amazon EC2 Container Registry User Guide. * @sample AmazonECR.CreateRepository * @see AWS API * Documentation */ @Override public CreateRepositoryResult createRepository(CreateRepositoryRequest request) { request = beforeClientExecution(request); return executeCreateRepository(request); } @SdkInternalApi final CreateRepositoryResult executeCreateRepository(CreateRepositoryRequest createRepositoryRequest) { ExecutionContext executionContext = createExecutionContext(createRepositoryRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateRepositoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRepositoryRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRepositoryResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

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

* * @param deleteRepositoryRequest * @return Result of the DeleteRepository operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws RepositoryNotEmptyException * The specified repository contains images. To delete a repository that contains images, you must force the * deletion with the force parameter. * @sample AmazonECR.DeleteRepository * @see AWS API * Documentation */ @Override public DeleteRepositoryResult deleteRepository(DeleteRepositoryRequest request) { request = beforeClientExecution(request); return executeDeleteRepository(request); } @SdkInternalApi final DeleteRepositoryResult executeDeleteRepository(DeleteRepositoryRequest deleteRepositoryRequest) { ExecutionContext executionContext = createExecutionContext(deleteRepositoryRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteRepositoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRepositoryRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRepositoryResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes the repository policy from a specified repository. *

* * @param deleteRepositoryPolicyRequest * @return Result of the DeleteRepositoryPolicy operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws RepositoryPolicyNotFoundException * The specified repository and registry combination does not have an associated repository policy. * @sample AmazonECR.DeleteRepositoryPolicy * @see AWS API * Documentation */ @Override public DeleteRepositoryPolicyResult deleteRepositoryPolicy(DeleteRepositoryPolicyRequest request) { request = beforeClientExecution(request); return executeDeleteRepositoryPolicy(request); } @SdkInternalApi final DeleteRepositoryPolicyResult executeDeleteRepositoryPolicy(DeleteRepositoryPolicyRequest deleteRepositoryPolicyRequest) { ExecutionContext executionContext = createExecutionContext(deleteRepositoryPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteRepositoryPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRepositoryPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRepositoryPolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

*
* * @param describeImagesRequest * @return Result of the DescribeImages operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws ImageNotFoundException * The image requested does not exist in the specified repository. * @sample AmazonECR.DescribeImages * @see AWS API * Documentation */ @Override public DescribeImagesResult describeImages(DescribeImagesRequest request) { request = beforeClientExecution(request); return executeDescribeImages(request); } @SdkInternalApi final DescribeImagesResult executeDescribeImages(DescribeImagesRequest describeImagesRequest) { ExecutionContext executionContext = createExecutionContext(describeImagesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeImagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeImagesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeImagesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Describes image repositories in a registry. *

* * @param describeRepositoriesRequest * @return Result of the DescribeRepositories operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.DescribeRepositories * @see AWS API * Documentation */ @Override public DescribeRepositoriesResult describeRepositories(DescribeRepositoriesRequest request) { request = beforeClientExecution(request); return executeDescribeRepositories(request); } @SdkInternalApi final DescribeRepositoriesResult executeDescribeRepositories(DescribeRepositoriesRequest describeRepositoriesRequest) { ExecutionContext executionContext = createExecutionContext(describeRepositoriesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeRepositoriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRepositoriesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRepositoriesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

* * @param getAuthorizationTokenRequest * @return Result of the GetAuthorizationToken operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @sample AmazonECR.GetAuthorizationToken * @see AWS API * Documentation */ @Override public GetAuthorizationTokenResult getAuthorizationToken(GetAuthorizationTokenRequest request) { request = beforeClientExecution(request); return executeGetAuthorizationToken(request); } @SdkInternalApi final GetAuthorizationTokenResult executeGetAuthorizationToken(GetAuthorizationTokenRequest getAuthorizationTokenRequest) { ExecutionContext executionContext = createExecutionContext(getAuthorizationTokenRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetAuthorizationTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAuthorizationTokenRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAuthorizationTokenResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

*
* * @param getDownloadUrlForLayerRequest * @return Result of the GetDownloadUrlForLayer operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws LayersNotFoundException * The specified layers could not be found, or the specified layer is not valid for this repository. * @throws LayerInaccessibleException * The specified layer is not available because it is not associated with an image. Unassociated image * layers may be cleaned up at any time. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.GetDownloadUrlForLayer * @see AWS API * Documentation */ @Override public GetDownloadUrlForLayerResult getDownloadUrlForLayer(GetDownloadUrlForLayerRequest request) { request = beforeClientExecution(request); return executeGetDownloadUrlForLayer(request); } @SdkInternalApi final GetDownloadUrlForLayerResult executeGetDownloadUrlForLayer(GetDownloadUrlForLayerRequest getDownloadUrlForLayerRequest) { ExecutionContext executionContext = createExecutionContext(getDownloadUrlForLayerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetDownloadUrlForLayerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDownloadUrlForLayerRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDownloadUrlForLayerResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Retrieves the repository policy for a specified repository. *

* * @param getRepositoryPolicyRequest * @return Result of the GetRepositoryPolicy operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws RepositoryPolicyNotFoundException * The specified repository and registry combination does not have an associated repository policy. * @sample AmazonECR.GetRepositoryPolicy * @see AWS API * Documentation */ @Override public GetRepositoryPolicyResult getRepositoryPolicy(GetRepositoryPolicyRequest request) { request = beforeClientExecution(request); return executeGetRepositoryPolicy(request); } @SdkInternalApi final GetRepositoryPolicyResult executeGetRepositoryPolicy(GetRepositoryPolicyRequest getRepositoryPolicyRequest) { ExecutionContext executionContext = createExecutionContext(getRepositoryPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetRepositoryPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRepositoryPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRepositoryPolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

*
* * @param initiateLayerUploadRequest * @return Result of the InitiateLayerUpload operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.InitiateLayerUpload * @see AWS API * Documentation */ @Override public InitiateLayerUploadResult initiateLayerUpload(InitiateLayerUploadRequest request) { request = beforeClientExecution(request); return executeInitiateLayerUpload(request); } @SdkInternalApi final InitiateLayerUploadResult executeInitiateLayerUpload(InitiateLayerUploadRequest initiateLayerUploadRequest) { ExecutionContext executionContext = createExecutionContext(initiateLayerUploadRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new InitiateLayerUploadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(initiateLayerUploadRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new InitiateLayerUploadResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

* * @param listImagesRequest * @return Result of the ListImages operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.ListImages * @see AWS API * Documentation */ @Override public ListImagesResult listImages(ListImagesRequest request) { request = beforeClientExecution(request); return executeListImages(request); } @SdkInternalApi final ListImagesResult executeListImages(ListImagesRequest listImagesRequest) { ExecutionContext executionContext = createExecutionContext(listImagesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListImagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listImagesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListImagesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

*
* * @param putImageRequest * @return Result of the PutImage operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws ImageAlreadyExistsException * The specified image has already been pushed, and there are no changes to the manifest or image tag since * the last push. * @throws LayersNotFoundException * The specified layers could not be found, or the specified layer is not valid for this repository. * @throws LimitExceededException * The operation did not succeed because it would have exceeded a service limit for your account. For more * information, see Amazon ECR Default * Service Limits in the Amazon EC2 Container Registry User Guide. * @sample AmazonECR.PutImage * @see AWS API * Documentation */ @Override public PutImageResult putImage(PutImageRequest request) { request = beforeClientExecution(request); return executePutImage(request); } @SdkInternalApi final PutImageResult executePutImage(PutImageRequest putImageRequest) { ExecutionContext executionContext = createExecutionContext(putImageRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new PutImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putImageRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutImageResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

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

* * @param setRepositoryPolicyRequest * @return Result of the SetRepositoryPolicy operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @sample AmazonECR.SetRepositoryPolicy * @see AWS API * Documentation */ @Override public SetRepositoryPolicyResult setRepositoryPolicy(SetRepositoryPolicyRequest request) { request = beforeClientExecution(request); return executeSetRepositoryPolicy(request); } @SdkInternalApi final SetRepositoryPolicyResult executeSetRepositoryPolicy(SetRepositoryPolicyRequest setRepositoryPolicyRequest) { ExecutionContext executionContext = createExecutionContext(setRepositoryPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetRepositoryPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setRepositoryPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetRepositoryPolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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. *

*
* * @param uploadLayerPartRequest * @return Result of the UploadLayerPart operation returned by the service. * @throws ServerException * These errors are usually caused by a server-side issue. * @throws InvalidParameterException * The specified parameter is invalid. Review the available parameters for the API request. * @throws InvalidLayerPartException * The layer part size is not valid, or the first byte specified is not consecutive to the last byte of a * previous layer part upload. * @throws RepositoryNotFoundException * The specified repository could not be found. Check the spelling of the specified repository and ensure * that you are performing operations on the correct registry. * @throws UploadNotFoundException * The upload could not be found, or the specified upload id is not valid for this repository. * @throws LimitExceededException * The operation did not succeed because it would have exceeded a service limit for your account. For more * information, see Amazon ECR Default * Service Limits in the Amazon EC2 Container Registry User Guide. * @sample AmazonECR.UploadLayerPart * @see AWS API * Documentation */ @Override public UploadLayerPartResult uploadLayerPart(UploadLayerPartRequest request) { request = beforeClientExecution(request); return executeUploadLayerPart(request); } @SdkInternalApi final UploadLayerPartResult executeUploadLayerPart(UploadLayerPartRequest uploadLayerPartRequest) { ExecutionContext executionContext = createExecutionContext(uploadLayerPartRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UploadLayerPartRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(uploadLayerPartRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UploadLayerPartResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * Returns additional metadata for a previously executed successful, request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. *

* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic * information for an executed request, you should use this method to retrieve it as soon as possible after * executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none is available. */ public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext); } /** * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will * be ignored for this operation. **/ private Response anonymousInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext); } /** * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the * ExecutionContext beforehand. **/ private Response doInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { request.setEndpoint(endpoint); request.setTimeOffset(timeOffset); HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy