com.amazonaws.services.ec2.AmazonEC2Client Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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.ec2;
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.client.builder.AdvancedConfig;
import com.amazonaws.services.ec2.AmazonEC2ClientBuilder;
import com.amazonaws.services.ec2.waiters.AmazonEC2Waiters;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.services.ec2.model.transform.*;
/**
* Client for accessing Amazon EC2. All service calls made using this client are blocking, and will not return until the
* service call completes.
*
* Amazon Elastic Compute Cloud
*
* Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing capacity in the Amazon Web Services
* Cloud. Using Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and deploy
* applications faster. Amazon Virtual Private Cloud (Amazon VPC) enables you to provision a logically isolated section
* of the Amazon Web Services Cloud where you can launch Amazon Web Services resources in a virtual network that you've
* defined. Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with EC2 instances. EBS
* volumes are highly available and reliable storage volumes that can be attached to any running instance and used like
* a hard drive.
*
*
* To learn more, see the following resources:
*
*
* -
*
* Amazon EC2: Amazon EC2 product page, Amazon EC2 documentation
*
*
* -
*
* Amazon EBS: Amazon EBS product page, Amazon EBS documentation
*
*
* -
*
* Amazon VPC: Amazon VPC product page, Amazon VPC documentation
*
*
* -
*
* VPN: VPN product page, VPN documentation
*
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonEC2Client extends AmazonWebServiceClient implements AmazonEC2 {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AmazonEC2.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "ec2";
private volatile AmazonEC2Waiters waiters;
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
/**
* Map of exception unmarshallers for all modeled exceptions
*/
private final Map> exceptionUnmarshallersMap = new HashMap>();
/**
* List of exception unmarshallers for all modeled exceptions Even though this exceptionUnmarshallers is not used in
* Clients, this is not removed since this was directly used by Client extended classes. Using this list can cause
* performance impact.
*/
protected final List> exceptionUnmarshallers = new ArrayList>();
protected Unmarshaller defaultUnmarshaller;
/**
* Constructs a new client to invoke service methods on Amazon EC2. 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 AmazonEC2ClientBuilder#defaultClient()}
*/
@Deprecated
public AmazonEC2Client() {
this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on Amazon EC2. 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 EC2 (ex: proxy settings,
* retry counts, etc.).
*
* @see DefaultAWSCredentialsProviderChain
* @deprecated use {@link AmazonEC2ClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonEC2Client(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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 AmazonEC2ClientBuilder#withCredentials(AWSCredentialsProvider)} for example:
* {@code AmazonEC2ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();}
*/
@Deprecated
public AmazonEC2Client(AWSCredentials awsCredentials) {
this(awsCredentials, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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 EC2 (ex: proxy settings,
* retry counts, etc.).
* @deprecated use {@link AmazonEC2ClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2ClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonEC2Client(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);
this.advancedConfig = AdvancedConfig.EMPTY;
init();
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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 AmazonEC2ClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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 EC2 (ex: proxy settings,
* retry counts, etc.).
* @deprecated use {@link AmazonEC2ClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2ClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, null);
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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 EC2 (ex: proxy settings,
* retry counts, etc.).
* @param requestMetricCollector
* optional request metric collector
* @deprecated use {@link AmazonEC2ClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2ClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonEC2ClientBuilder#withMetricsCollector(RequestMetricCollector)}
*/
@Deprecated
public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) {
super(clientConfiguration, requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
this.advancedConfig = AdvancedConfig.EMPTY;
init();
}
public static AmazonEC2ClientBuilder builder() {
return AmazonEC2ClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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.
*/
AmazonEC2Client(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on Amazon EC2 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.
*/
AmazonEC2Client(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
defaultUnmarshaller = new LegacyErrorUnmarshaller(com.amazonaws.services.ec2.model.AmazonEC2Exception.class);
exceptionUnmarshallers.add(new LegacyErrorUnmarshaller(com.amazonaws.services.ec2.model.AmazonEC2Exception.class));
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
this.setEndpoint("https://ec2.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/ec2/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/ec2/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Accepts an Elastic IP address transfer. For more information, see Accept a transferred Elastic IP address in the Amazon Virtual Private Cloud User Guide.
*
*
* @param acceptAddressTransferRequest
* @return Result of the AcceptAddressTransfer operation returned by the service.
* @sample AmazonEC2.AcceptAddressTransfer
* @see AWS API
* Documentation
*/
@Override
public AcceptAddressTransferResult acceptAddressTransfer(AcceptAddressTransferRequest request) {
request = beforeClientExecution(request);
return executeAcceptAddressTransfer(request);
}
@SdkInternalApi
final AcceptAddressTransferResult executeAcceptAddressTransfer(AcceptAddressTransferRequest acceptAddressTransferRequest) {
ExecutionContext executionContext = createExecutionContext(acceptAddressTransferRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptAddressTransferRequestMarshaller().marshall(super.beforeMarshalling(acceptAddressTransferRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptAddressTransfer");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptAddressTransferResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Accepts the Convertible Reserved Instance exchange quote described in the
* GetReservedInstancesExchangeQuote call.
*
*
* @param acceptReservedInstancesExchangeQuoteRequest
* Contains the parameters for accepting the quote.
* @return Result of the AcceptReservedInstancesExchangeQuote operation returned by the service.
* @sample AmazonEC2.AcceptReservedInstancesExchangeQuote
* @see AWS API Documentation
*/
@Override
public AcceptReservedInstancesExchangeQuoteResult acceptReservedInstancesExchangeQuote(AcceptReservedInstancesExchangeQuoteRequest request) {
request = beforeClientExecution(request);
return executeAcceptReservedInstancesExchangeQuote(request);
}
@SdkInternalApi
final AcceptReservedInstancesExchangeQuoteResult executeAcceptReservedInstancesExchangeQuote(
AcceptReservedInstancesExchangeQuoteRequest acceptReservedInstancesExchangeQuoteRequest) {
ExecutionContext executionContext = createExecutionContext(acceptReservedInstancesExchangeQuoteRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptReservedInstancesExchangeQuoteRequestMarshaller().marshall(super
.beforeMarshalling(acceptReservedInstancesExchangeQuoteRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptReservedInstancesExchangeQuote");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptReservedInstancesExchangeQuoteResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Accepts a request to associate subnets with a transit gateway multicast domain.
*
*
* @param acceptTransitGatewayMulticastDomainAssociationsRequest
* @return Result of the AcceptTransitGatewayMulticastDomainAssociations operation returned by the service.
* @sample AmazonEC2.AcceptTransitGatewayMulticastDomainAssociations
* @see AWS API Documentation
*/
@Override
public AcceptTransitGatewayMulticastDomainAssociationsResult acceptTransitGatewayMulticastDomainAssociations(
AcceptTransitGatewayMulticastDomainAssociationsRequest request) {
request = beforeClientExecution(request);
return executeAcceptTransitGatewayMulticastDomainAssociations(request);
}
@SdkInternalApi
final AcceptTransitGatewayMulticastDomainAssociationsResult executeAcceptTransitGatewayMulticastDomainAssociations(
AcceptTransitGatewayMulticastDomainAssociationsRequest acceptTransitGatewayMulticastDomainAssociationsRequest) {
ExecutionContext executionContext = createExecutionContext(acceptTransitGatewayMulticastDomainAssociationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptTransitGatewayMulticastDomainAssociationsRequestMarshaller().marshall(super
.beforeMarshalling(acceptTransitGatewayMulticastDomainAssociationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptTransitGatewayMulticastDomainAssociations");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptTransitGatewayMulticastDomainAssociationsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Accepts a transit gateway peering attachment request. The peering attachment must be in the
* pendingAcceptance
state.
*
*
* @param acceptTransitGatewayPeeringAttachmentRequest
* @return Result of the AcceptTransitGatewayPeeringAttachment operation returned by the service.
* @sample AmazonEC2.AcceptTransitGatewayPeeringAttachment
* @see AWS API Documentation
*/
@Override
public AcceptTransitGatewayPeeringAttachmentResult acceptTransitGatewayPeeringAttachment(AcceptTransitGatewayPeeringAttachmentRequest request) {
request = beforeClientExecution(request);
return executeAcceptTransitGatewayPeeringAttachment(request);
}
@SdkInternalApi
final AcceptTransitGatewayPeeringAttachmentResult executeAcceptTransitGatewayPeeringAttachment(
AcceptTransitGatewayPeeringAttachmentRequest acceptTransitGatewayPeeringAttachmentRequest) {
ExecutionContext executionContext = createExecutionContext(acceptTransitGatewayPeeringAttachmentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptTransitGatewayPeeringAttachmentRequestMarshaller().marshall(super
.beforeMarshalling(acceptTransitGatewayPeeringAttachmentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptTransitGatewayPeeringAttachment");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptTransitGatewayPeeringAttachmentResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Accepts a request to attach a VPC to a transit gateway.
*
*
* The VPC attachment must be in the pendingAcceptance
state. Use
* DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use
* RejectTransitGatewayVpcAttachment to reject a VPC attachment request.
*
*
* @param acceptTransitGatewayVpcAttachmentRequest
* @return Result of the AcceptTransitGatewayVpcAttachment operation returned by the service.
* @sample AmazonEC2.AcceptTransitGatewayVpcAttachment
* @see AWS API Documentation
*/
@Override
public AcceptTransitGatewayVpcAttachmentResult acceptTransitGatewayVpcAttachment(AcceptTransitGatewayVpcAttachmentRequest request) {
request = beforeClientExecution(request);
return executeAcceptTransitGatewayVpcAttachment(request);
}
@SdkInternalApi
final AcceptTransitGatewayVpcAttachmentResult executeAcceptTransitGatewayVpcAttachment(
AcceptTransitGatewayVpcAttachmentRequest acceptTransitGatewayVpcAttachmentRequest) {
ExecutionContext executionContext = createExecutionContext(acceptTransitGatewayVpcAttachmentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptTransitGatewayVpcAttachmentRequestMarshaller().marshall(super.beforeMarshalling(acceptTransitGatewayVpcAttachmentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptTransitGatewayVpcAttachment");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptTransitGatewayVpcAttachmentResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Accepts connection requests to your VPC endpoint service.
*
*
* @param acceptVpcEndpointConnectionsRequest
* @return Result of the AcceptVpcEndpointConnections operation returned by the service.
* @sample AmazonEC2.AcceptVpcEndpointConnections
* @see AWS API Documentation
*/
@Override
public AcceptVpcEndpointConnectionsResult acceptVpcEndpointConnections(AcceptVpcEndpointConnectionsRequest request) {
request = beforeClientExecution(request);
return executeAcceptVpcEndpointConnections(request);
}
@SdkInternalApi
final AcceptVpcEndpointConnectionsResult executeAcceptVpcEndpointConnections(AcceptVpcEndpointConnectionsRequest acceptVpcEndpointConnectionsRequest) {
ExecutionContext executionContext = createExecutionContext(acceptVpcEndpointConnectionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptVpcEndpointConnectionsRequestMarshaller().marshall(super.beforeMarshalling(acceptVpcEndpointConnectionsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptVpcEndpointConnections");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptVpcEndpointConnectionsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the
* pending-acceptance
state, and you must be the owner of the peer VPC. Use
* DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.
*
*
* For an inter-Region VPC peering connection request, you must accept the VPC peering connection in the Region of
* the accepter VPC.
*
*
* @param acceptVpcPeeringConnectionRequest
* @return Result of the AcceptVpcPeeringConnection operation returned by the service.
* @sample AmazonEC2.AcceptVpcPeeringConnection
* @see AWS
* API Documentation
*/
@Override
public AcceptVpcPeeringConnectionResult acceptVpcPeeringConnection(AcceptVpcPeeringConnectionRequest request) {
request = beforeClientExecution(request);
return executeAcceptVpcPeeringConnection(request);
}
@SdkInternalApi
final AcceptVpcPeeringConnectionResult executeAcceptVpcPeeringConnection(AcceptVpcPeeringConnectionRequest acceptVpcPeeringConnectionRequest) {
ExecutionContext executionContext = createExecutionContext(acceptVpcPeeringConnectionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptVpcPeeringConnectionRequestMarshaller().marshall(super.beforeMarshalling(acceptVpcPeeringConnectionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptVpcPeeringConnection");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AcceptVpcPeeringConnectionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public AcceptVpcPeeringConnectionResult acceptVpcPeeringConnection() {
return acceptVpcPeeringConnection(new AcceptVpcPeeringConnectionRequest());
}
/**
*
* Advertises an IPv4 or IPv6 address range that is provisioned for use with your Amazon Web Services resources
* through bring your own IP addresses (BYOIP).
*
*
* You can perform this operation at most once every 10 seconds, even if you specify different address ranges each
* time.
*
*
* We recommend that you stop advertising the BYOIP CIDR from other locations when you advertise it from Amazon Web
* Services. To minimize down time, you can configure your Amazon Web Services resources to use an address from a
* BYOIP CIDR before it is advertised, and then simultaneously stop advertising it from the current location and
* start advertising it through Amazon Web Services.
*
*
* It can take a few minutes before traffic to the specified addresses starts routing to Amazon Web Services because
* of BGP propagation delays.
*
*
* To stop advertising the BYOIP CIDR, use WithdrawByoipCidr.
*
*
* @param advertiseByoipCidrRequest
* @return Result of the AdvertiseByoipCidr operation returned by the service.
* @sample AmazonEC2.AdvertiseByoipCidr
* @see AWS API
* Documentation
*/
@Override
public AdvertiseByoipCidrResult advertiseByoipCidr(AdvertiseByoipCidrRequest request) {
request = beforeClientExecution(request);
return executeAdvertiseByoipCidr(request);
}
@SdkInternalApi
final AdvertiseByoipCidrResult executeAdvertiseByoipCidr(AdvertiseByoipCidrRequest advertiseByoipCidrRequest) {
ExecutionContext executionContext = createExecutionContext(advertiseByoipCidrRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AdvertiseByoipCidrRequestMarshaller().marshall(super.beforeMarshalling(advertiseByoipCidrRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AdvertiseByoipCidr");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AdvertiseByoipCidrResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Allocates an Elastic IP address to your Amazon Web Services account. After you allocate the Elastic IP address
* you can associate it with an instance or network interface. After you release an Elastic IP address, it is
* released to the IP address pool and can be allocated to a different Amazon Web Services account.
*
*
* You can allocate an Elastic IP address from an address pool owned by Amazon Web Services or from an address pool
* created from a public IPv4 address range that you have brought to Amazon Web Services for use with your Amazon
* Web Services resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP)
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* If you release an Elastic IP address, you might be able to recover it. You cannot recover an Elastic IP address
* that you released after it is allocated to another Amazon Web Services account. To attempt to recover an Elastic
* IP address that you released, specify it in this operation.
*
*
* For more information, see Elastic IP Addresses
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* You can allocate a carrier IP address which is a public IP address from a telecommunication carrier, to a network
* interface which resides in a subnet in a Wavelength Zone (for example an EC2 instance).
*
*
* @param allocateAddressRequest
* @return Result of the AllocateAddress operation returned by the service.
* @sample AmazonEC2.AllocateAddress
* @see AWS API
* Documentation
*/
@Override
public AllocateAddressResult allocateAddress(AllocateAddressRequest request) {
request = beforeClientExecution(request);
return executeAllocateAddress(request);
}
@SdkInternalApi
final AllocateAddressResult executeAllocateAddress(AllocateAddressRequest allocateAddressRequest) {
ExecutionContext executionContext = createExecutionContext(allocateAddressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AllocateAddressRequestMarshaller().marshall(super.beforeMarshalling(allocateAddressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AllocateAddress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AllocateAddressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public AllocateAddressResult allocateAddress() {
return allocateAddress(new AllocateAddressRequest());
}
/**
*
* Allocates a Dedicated Host to your account. At a minimum, specify the supported instance type or instance family,
* the Availability Zone in which to allocate the host, and the number of hosts to allocate.
*
*
* @param allocateHostsRequest
* @return Result of the AllocateHosts operation returned by the service.
* @sample AmazonEC2.AllocateHosts
* @see AWS API
* Documentation
*/
@Override
public AllocateHostsResult allocateHosts(AllocateHostsRequest request) {
request = beforeClientExecution(request);
return executeAllocateHosts(request);
}
@SdkInternalApi
final AllocateHostsResult executeAllocateHosts(AllocateHostsRequest allocateHostsRequest) {
ExecutionContext executionContext = createExecutionContext(allocateHostsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AllocateHostsRequestMarshaller().marshall(super.beforeMarshalling(allocateHostsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AllocateHosts");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new AllocateHostsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Allocate a CIDR from an IPAM pool. The Region you use should be the IPAM pool locale. The locale is the Amazon
* Web Services Region where this IPAM pool is available for allocations.
*
*
* In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM pool or to a resource. For more
* information, see Allocate
* CIDRs in the Amazon VPC IPAM User Guide.
*
*
*
* This action creates an allocation with strong consistency. The returned CIDR will not overlap with any other
* allocations from the same pool.
*
*
*
* @param allocateIpamPoolCidrRequest
* @return Result of the AllocateIpamPoolCidr operation returned by the service.
* @sample AmazonEC2.AllocateIpamPoolCidr
* @see AWS API
* Documentation
*/
@Override
public AllocateIpamPoolCidrResult allocateIpamPoolCidr(AllocateIpamPoolCidrRequest request) {
request = beforeClientExecution(request);
return executeAllocateIpamPoolCidr(request);
}
@SdkInternalApi
final AllocateIpamPoolCidrResult executeAllocateIpamPoolCidr(AllocateIpamPoolCidrRequest allocateIpamPoolCidrRequest) {
ExecutionContext executionContext = createExecutionContext(allocateIpamPoolCidrRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AllocateIpamPoolCidrRequestMarshaller().marshall(super.beforeMarshalling(allocateIpamPoolCidrRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AllocateIpamPoolCidr");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AllocateIpamPoolCidrResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Applies a security group to the association between the target network and the Client VPN endpoint. This action
* replaces the existing security groups with the specified security groups.
*
*
* @param applySecurityGroupsToClientVpnTargetNetworkRequest
* @return Result of the ApplySecurityGroupsToClientVpnTargetNetwork operation returned by the service.
* @sample AmazonEC2.ApplySecurityGroupsToClientVpnTargetNetwork
* @see AWS API Documentation
*/
@Override
public ApplySecurityGroupsToClientVpnTargetNetworkResult applySecurityGroupsToClientVpnTargetNetwork(
ApplySecurityGroupsToClientVpnTargetNetworkRequest request) {
request = beforeClientExecution(request);
return executeApplySecurityGroupsToClientVpnTargetNetwork(request);
}
@SdkInternalApi
final ApplySecurityGroupsToClientVpnTargetNetworkResult executeApplySecurityGroupsToClientVpnTargetNetwork(
ApplySecurityGroupsToClientVpnTargetNetworkRequest applySecurityGroupsToClientVpnTargetNetworkRequest) {
ExecutionContext executionContext = createExecutionContext(applySecurityGroupsToClientVpnTargetNetworkRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ApplySecurityGroupsToClientVpnTargetNetworkRequestMarshaller().marshall(super
.beforeMarshalling(applySecurityGroupsToClientVpnTargetNetworkRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ApplySecurityGroupsToClientVpnTargetNetwork");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new ApplySecurityGroupsToClientVpnTargetNetworkResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Assigns one or more IPv6 addresses to the specified network interface. You can specify one or more specific IPv6
* addresses, or you can specify the number of IPv6 addresses to be automatically assigned from within the subnet's
* IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private
* IPv4 addresses, and the limit varies per instance type. For information, see IP Addresses Per
* Network Interface Per Instance Type in the Amazon Elastic Compute Cloud User Guide.
*
*
* You must specify either the IPv6 addresses or the IPv6 address count in the request.
*
*
* You can optionally use Prefix Delegation on the network interface. You must specify either the IPV6 Prefix
* Delegation prefixes, or the IPv6 Prefix Delegation count. For information, see Assigning prefixes to Amazon EC2
* network interfaces in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param assignIpv6AddressesRequest
* @return Result of the AssignIpv6Addresses operation returned by the service.
* @sample AmazonEC2.AssignIpv6Addresses
* @see AWS API
* Documentation
*/
@Override
public AssignIpv6AddressesResult assignIpv6Addresses(AssignIpv6AddressesRequest request) {
request = beforeClientExecution(request);
return executeAssignIpv6Addresses(request);
}
@SdkInternalApi
final AssignIpv6AddressesResult executeAssignIpv6Addresses(AssignIpv6AddressesRequest assignIpv6AddressesRequest) {
ExecutionContext executionContext = createExecutionContext(assignIpv6AddressesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssignIpv6AddressesRequestMarshaller().marshall(super.beforeMarshalling(assignIpv6AddressesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssignIpv6Addresses");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssignIpv6AddressesResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Assigns one or more secondary private IP addresses to the specified network interface.
*
*
* You can specify one or more specific secondary IP addresses, or you can specify the number of secondary IP
* addresses to be automatically assigned within the subnet's CIDR block range. The number of secondary IP addresses
* that you can assign to an instance varies by instance type. For information about instance types, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide. For more information about Elastic IP addresses, see Elastic IP Addresses
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* When you move a secondary private IP address to another network interface, any Elastic IP address that is
* associated with the IP address is also moved.
*
*
* Remapping an IP address is an asynchronous operation. When you move an IP address from one network interface to
* another, check network/interfaces/macs/mac/local-ipv4s
in the instance metadata to confirm that the
* remapping is complete.
*
*
* You must specify either the IP addresses or the IP address count in the request.
*
*
* You can optionally use Prefix Delegation on the network interface. You must specify either the IPv4 Prefix
* Delegation prefixes, or the IPv4 Prefix Delegation count. For information, see Assigning prefixes to Amazon EC2
* network interfaces in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param assignPrivateIpAddressesRequest
* Contains the parameters for AssignPrivateIpAddresses.
* @return Result of the AssignPrivateIpAddresses operation returned by the service.
* @sample AmazonEC2.AssignPrivateIpAddresses
* @see AWS
* API Documentation
*/
@Override
public AssignPrivateIpAddressesResult assignPrivateIpAddresses(AssignPrivateIpAddressesRequest request) {
request = beforeClientExecution(request);
return executeAssignPrivateIpAddresses(request);
}
@SdkInternalApi
final AssignPrivateIpAddressesResult executeAssignPrivateIpAddresses(AssignPrivateIpAddressesRequest assignPrivateIpAddressesRequest) {
ExecutionContext executionContext = createExecutionContext(assignPrivateIpAddressesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssignPrivateIpAddressesRequestMarshaller().marshall(super.beforeMarshalling(assignPrivateIpAddressesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssignPrivateIpAddresses");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssignPrivateIpAddressesResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Assigns one or more private IPv4 addresses to a private NAT gateway. For more information, see Work with
* NAT gateways in the Amazon VPC User Guide.
*
*
* @param assignPrivateNatGatewayAddressRequest
* @return Result of the AssignPrivateNatGatewayAddress operation returned by the service.
* @sample AmazonEC2.AssignPrivateNatGatewayAddress
* @see AWS API Documentation
*/
@Override
public AssignPrivateNatGatewayAddressResult assignPrivateNatGatewayAddress(AssignPrivateNatGatewayAddressRequest request) {
request = beforeClientExecution(request);
return executeAssignPrivateNatGatewayAddress(request);
}
@SdkInternalApi
final AssignPrivateNatGatewayAddressResult executeAssignPrivateNatGatewayAddress(AssignPrivateNatGatewayAddressRequest assignPrivateNatGatewayAddressRequest) {
ExecutionContext executionContext = createExecutionContext(assignPrivateNatGatewayAddressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssignPrivateNatGatewayAddressRequestMarshaller().marshall(super.beforeMarshalling(assignPrivateNatGatewayAddressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssignPrivateNatGatewayAddress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssignPrivateNatGatewayAddressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates an Elastic IP address, or carrier IP address (for instances that are in subnets in Wavelength Zones)
* with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your
* account.
*
*
* If the Elastic IP address is already associated with a different instance, it is disassociated from that instance
* and associated with the specified instance. If you associate an Elastic IP address with an instance that has an
* existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to
* your account.
*
*
* [Subnets in Wavelength Zones] You can associate an IP address from the telecommunication carrier to the instance
* or network interface.
*
*
* You cannot associate an Elastic IP address with an interface in a different network border group.
*
*
*
* This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error,
* and you may be charged for each time the Elastic IP address is remapped to the same instance. For more
* information, see the Elastic IP Addresses section of Amazon
* EC2 Pricing.
*
*
*
* @param associateAddressRequest
* @return Result of the AssociateAddress operation returned by the service.
* @sample AmazonEC2.AssociateAddress
* @see AWS API
* Documentation
*/
@Override
public AssociateAddressResult associateAddress(AssociateAddressRequest request) {
request = beforeClientExecution(request);
return executeAssociateAddress(request);
}
@SdkInternalApi
final AssociateAddressResult executeAssociateAddress(AssociateAddressRequest associateAddressRequest) {
ExecutionContext executionContext = createExecutionContext(associateAddressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateAddressRequestMarshaller().marshall(super.beforeMarshalling(associateAddressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateAddress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateAddressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate
* multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each
* Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy.
*
*
* If you specified a VPC when you created the Client VPN endpoint or if you have previous subnet associations, the
* specified subnet must be in the same VPC. To specify a subnet that's in a different VPC, you must first modify
* the Client VPN endpoint (ModifyClientVpnEndpoint) and change the VPC that's associated with it.
*
*
* @param associateClientVpnTargetNetworkRequest
* @return Result of the AssociateClientVpnTargetNetwork operation returned by the service.
* @sample AmazonEC2.AssociateClientVpnTargetNetwork
* @see AWS API Documentation
*/
@Override
public AssociateClientVpnTargetNetworkResult associateClientVpnTargetNetwork(AssociateClientVpnTargetNetworkRequest request) {
request = beforeClientExecution(request);
return executeAssociateClientVpnTargetNetwork(request);
}
@SdkInternalApi
final AssociateClientVpnTargetNetworkResult executeAssociateClientVpnTargetNetwork(
AssociateClientVpnTargetNetworkRequest associateClientVpnTargetNetworkRequest) {
ExecutionContext executionContext = createExecutionContext(associateClientVpnTargetNetworkRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateClientVpnTargetNetworkRequestMarshaller().marshall(super.beforeMarshalling(associateClientVpnTargetNetworkRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateClientVpnTargetNetwork");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateClientVpnTargetNetworkResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP
* options with the VPC.
*
*
* After you associate the options with the VPC, any existing instances and all new instances that you launch in
* that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the
* changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly
* renew the lease using the operating system on the instance.
*
*
* For more information, see DHCP
* options sets in the Amazon VPC User Guide.
*
*
* @param associateDhcpOptionsRequest
* @return Result of the AssociateDhcpOptions operation returned by the service.
* @sample AmazonEC2.AssociateDhcpOptions
* @see AWS API
* Documentation
*/
@Override
public AssociateDhcpOptionsResult associateDhcpOptions(AssociateDhcpOptionsRequest request) {
request = beforeClientExecution(request);
return executeAssociateDhcpOptions(request);
}
@SdkInternalApi
final AssociateDhcpOptionsResult executeAssociateDhcpOptions(AssociateDhcpOptionsRequest associateDhcpOptionsRequest) {
ExecutionContext executionContext = createExecutionContext(associateDhcpOptionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateDhcpOptionsRequestMarshaller().marshall(super.beforeMarshalling(associateDhcpOptionsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateDhcpOptions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateDhcpOptionsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates an Identity and Access Management (IAM) role with an Certificate Manager (ACM) certificate. This
* enables the certificate to be used by the ACM for Nitro Enclaves application inside an enclave. For more
* information, see Certificate
* Manager for Nitro Enclaves in the Amazon Web Services Nitro Enclaves User Guide.
*
*
* When the IAM role is associated with the ACM certificate, the certificate, certificate chain, and encrypted
* private key are placed in an Amazon S3 location that only the associated IAM role can access. The private key of
* the certificate is encrypted with an Amazon Web Services managed key that has an attached attestation-based key
* policy.
*
*
* To enable the IAM role to access the Amazon S3 object, you must grant it permission to call
* s3:GetObject
on the Amazon S3 bucket returned by the command. To enable the IAM role to access the
* KMS key, you must grant it permission to call kms:Decrypt
on the KMS key returned by the command.
* For more information, see Grant the role
* permission to access the certificate and encryption key in the Amazon Web Services Nitro Enclaves User
* Guide.
*
*
* @param associateEnclaveCertificateIamRoleRequest
* @return Result of the AssociateEnclaveCertificateIamRole operation returned by the service.
* @sample AmazonEC2.AssociateEnclaveCertificateIamRole
* @see AWS API Documentation
*/
@Override
public AssociateEnclaveCertificateIamRoleResult associateEnclaveCertificateIamRole(AssociateEnclaveCertificateIamRoleRequest request) {
request = beforeClientExecution(request);
return executeAssociateEnclaveCertificateIamRole(request);
}
@SdkInternalApi
final AssociateEnclaveCertificateIamRoleResult executeAssociateEnclaveCertificateIamRole(
AssociateEnclaveCertificateIamRoleRequest associateEnclaveCertificateIamRoleRequest) {
ExecutionContext executionContext = createExecutionContext(associateEnclaveCertificateIamRoleRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateEnclaveCertificateIamRoleRequestMarshaller()
.marshall(super.beforeMarshalling(associateEnclaveCertificateIamRoleRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateEnclaveCertificateIamRole");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateEnclaveCertificateIamRoleResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM
* instance profile with an instance.
*
*
* @param associateIamInstanceProfileRequest
* @return Result of the AssociateIamInstanceProfile operation returned by the service.
* @sample AmazonEC2.AssociateIamInstanceProfile
* @see AWS API Documentation
*/
@Override
public AssociateIamInstanceProfileResult associateIamInstanceProfile(AssociateIamInstanceProfileRequest request) {
request = beforeClientExecution(request);
return executeAssociateIamInstanceProfile(request);
}
@SdkInternalApi
final AssociateIamInstanceProfileResult executeAssociateIamInstanceProfile(AssociateIamInstanceProfileRequest associateIamInstanceProfileRequest) {
ExecutionContext executionContext = createExecutionContext(associateIamInstanceProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateIamInstanceProfileRequestMarshaller().marshall(super.beforeMarshalling(associateIamInstanceProfileRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateIamInstanceProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateIamInstanceProfileResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates one or more targets with an event window. Only one type of target (instance IDs, Dedicated Host IDs,
* or tags) can be specified with an event window.
*
*
* For more information, see Define
* event windows for scheduled events in the Amazon EC2 User Guide.
*
*
* @param associateInstanceEventWindowRequest
* @return Result of the AssociateInstanceEventWindow operation returned by the service.
* @sample AmazonEC2.AssociateInstanceEventWindow
* @see AWS API Documentation
*/
@Override
public AssociateInstanceEventWindowResult associateInstanceEventWindow(AssociateInstanceEventWindowRequest request) {
request = beforeClientExecution(request);
return executeAssociateInstanceEventWindow(request);
}
@SdkInternalApi
final AssociateInstanceEventWindowResult executeAssociateInstanceEventWindow(AssociateInstanceEventWindowRequest associateInstanceEventWindowRequest) {
ExecutionContext executionContext = createExecutionContext(associateInstanceEventWindowRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateInstanceEventWindowRequestMarshaller().marshall(super.beforeMarshalling(associateInstanceEventWindowRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateInstanceEventWindow");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateInstanceEventWindowResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates your Autonomous System Number (ASN) with a BYOIP CIDR that you own in the same Amazon Web Services
* Region. For more information, see Tutorial: Bring your ASN to IPAM in
* the Amazon VPC IPAM guide.
*
*
* After the association succeeds, the ASN is eligible for advertisement. You can view the association with DescribeByoipCidrs.
* You can advertise the CIDR with AdvertiseByoipCidr.
*
*
* @param associateIpamByoasnRequest
* @return Result of the AssociateIpamByoasn operation returned by the service.
* @sample AmazonEC2.AssociateIpamByoasn
* @see AWS API
* Documentation
*/
@Override
public AssociateIpamByoasnResult associateIpamByoasn(AssociateIpamByoasnRequest request) {
request = beforeClientExecution(request);
return executeAssociateIpamByoasn(request);
}
@SdkInternalApi
final AssociateIpamByoasnResult executeAssociateIpamByoasn(AssociateIpamByoasnRequest associateIpamByoasnRequest) {
ExecutionContext executionContext = createExecutionContext(associateIpamByoasnRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateIpamByoasnRequestMarshaller().marshall(super.beforeMarshalling(associateIpamByoasnRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateIpamByoasn");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateIpamByoasnResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates an IPAM resource discovery with an Amazon VPC IPAM. A resource discovery is an IPAM component that
* enables IPAM to manage and monitor resources that belong to the owning account.
*
*
* @param associateIpamResourceDiscoveryRequest
* @return Result of the AssociateIpamResourceDiscovery operation returned by the service.
* @sample AmazonEC2.AssociateIpamResourceDiscovery
* @see AWS API Documentation
*/
@Override
public AssociateIpamResourceDiscoveryResult associateIpamResourceDiscovery(AssociateIpamResourceDiscoveryRequest request) {
request = beforeClientExecution(request);
return executeAssociateIpamResourceDiscovery(request);
}
@SdkInternalApi
final AssociateIpamResourceDiscoveryResult executeAssociateIpamResourceDiscovery(AssociateIpamResourceDiscoveryRequest associateIpamResourceDiscoveryRequest) {
ExecutionContext executionContext = createExecutionContext(associateIpamResourceDiscoveryRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateIpamResourceDiscoveryRequestMarshaller().marshall(super.beforeMarshalling(associateIpamResourceDiscoveryRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateIpamResourceDiscovery");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateIpamResourceDiscoveryResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more
* information, see Work with
* NAT gateways in the Amazon VPC User Guide.
*
*
* By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by
* requesting a quota adjustment. For more information, see Elastic IP address
* quotas in the Amazon VPC User Guide.
*
*
*
* When you associate an EIP or secondary EIPs with a public NAT gateway, the network border group of the EIPs must
* match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the
* same, the EIP will fail to associate. You can see the network border group for the subnet's AZ by viewing the
* details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the
* EIP address. For more information about network border groups and EIPs, see Allocate an Elastic IP
* address in the Amazon VPC User Guide.
*
*
*
* @param associateNatGatewayAddressRequest
* @return Result of the AssociateNatGatewayAddress operation returned by the service.
* @sample AmazonEC2.AssociateNatGatewayAddress
* @see AWS
* API Documentation
*/
@Override
public AssociateNatGatewayAddressResult associateNatGatewayAddress(AssociateNatGatewayAddressRequest request) {
request = beforeClientExecution(request);
return executeAssociateNatGatewayAddress(request);
}
@SdkInternalApi
final AssociateNatGatewayAddressResult executeAssociateNatGatewayAddress(AssociateNatGatewayAddressRequest associateNatGatewayAddressRequest) {
ExecutionContext executionContext = createExecutionContext(associateNatGatewayAddressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateNatGatewayAddressRequestMarshaller().marshall(super.beforeMarshalling(associateNatGatewayAddressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateNatGatewayAddress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateNatGatewayAddressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates a subnet in your VPC or an internet gateway or virtual private gateway attached to your VPC with a
* route table in your VPC. This association causes traffic from the subnet or gateway to be routed according to the
* routes in the route table. The action returns an association ID, which you need in order to disassociate the
* route table later. A route table can be associated with multiple subnets.
*
*
* For more information, see Route
* tables in the Amazon VPC User Guide.
*
*
* @param associateRouteTableRequest
* @return Result of the AssociateRouteTable operation returned by the service.
* @sample AmazonEC2.AssociateRouteTable
* @see AWS API
* Documentation
*/
@Override
public AssociateRouteTableResult associateRouteTable(AssociateRouteTableRequest request) {
request = beforeClientExecution(request);
return executeAssociateRouteTable(request);
}
@SdkInternalApi
final AssociateRouteTableResult executeAssociateRouteTable(AssociateRouteTableRequest associateRouteTableRequest) {
ExecutionContext executionContext = createExecutionContext(associateRouteTableRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateRouteTableRequestMarshaller().marshall(super.beforeMarshalling(associateRouteTableRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateRouteTable");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateRouteTableResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates a CIDR block with your subnet. You can only associate a single IPv6 CIDR block with your subnet.
*
*
* @param associateSubnetCidrBlockRequest
* @return Result of the AssociateSubnetCidrBlock operation returned by the service.
* @sample AmazonEC2.AssociateSubnetCidrBlock
* @see AWS
* API Documentation
*/
@Override
public AssociateSubnetCidrBlockResult associateSubnetCidrBlock(AssociateSubnetCidrBlockRequest request) {
request = beforeClientExecution(request);
return executeAssociateSubnetCidrBlock(request);
}
@SdkInternalApi
final AssociateSubnetCidrBlockResult executeAssociateSubnetCidrBlock(AssociateSubnetCidrBlockRequest associateSubnetCidrBlockRequest) {
ExecutionContext executionContext = createExecutionContext(associateSubnetCidrBlockRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateSubnetCidrBlockRequestMarshaller().marshall(super.beforeMarshalling(associateSubnetCidrBlockRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateSubnetCidrBlock");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateSubnetCidrBlockResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates the specified subnets and transit gateway attachments with the specified transit gateway multicast
* domain.
*
*
* The transit gateway attachment must be in the available state before you can add a resource. Use DescribeTransitGatewayAttachments to see the state of the attachment.
*
*
* @param associateTransitGatewayMulticastDomainRequest
* @return Result of the AssociateTransitGatewayMulticastDomain operation returned by the service.
* @sample AmazonEC2.AssociateTransitGatewayMulticastDomain
* @see AWS API Documentation
*/
@Override
public AssociateTransitGatewayMulticastDomainResult associateTransitGatewayMulticastDomain(AssociateTransitGatewayMulticastDomainRequest request) {
request = beforeClientExecution(request);
return executeAssociateTransitGatewayMulticastDomain(request);
}
@SdkInternalApi
final AssociateTransitGatewayMulticastDomainResult executeAssociateTransitGatewayMulticastDomain(
AssociateTransitGatewayMulticastDomainRequest associateTransitGatewayMulticastDomainRequest) {
ExecutionContext executionContext = createExecutionContext(associateTransitGatewayMulticastDomainRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateTransitGatewayMulticastDomainRequestMarshaller().marshall(super
.beforeMarshalling(associateTransitGatewayMulticastDomainRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateTransitGatewayMulticastDomain");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateTransitGatewayMulticastDomainResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates the specified transit gateway attachment with a transit gateway policy table.
*
*
* @param associateTransitGatewayPolicyTableRequest
* @return Result of the AssociateTransitGatewayPolicyTable operation returned by the service.
* @sample AmazonEC2.AssociateTransitGatewayPolicyTable
* @see AWS API Documentation
*/
@Override
public AssociateTransitGatewayPolicyTableResult associateTransitGatewayPolicyTable(AssociateTransitGatewayPolicyTableRequest request) {
request = beforeClientExecution(request);
return executeAssociateTransitGatewayPolicyTable(request);
}
@SdkInternalApi
final AssociateTransitGatewayPolicyTableResult executeAssociateTransitGatewayPolicyTable(
AssociateTransitGatewayPolicyTableRequest associateTransitGatewayPolicyTableRequest) {
ExecutionContext executionContext = createExecutionContext(associateTransitGatewayPolicyTableRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateTransitGatewayPolicyTableRequestMarshaller()
.marshall(super.beforeMarshalling(associateTransitGatewayPolicyTableRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateTransitGatewayPolicyTable");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateTransitGatewayPolicyTableResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates the specified attachment with the specified transit gateway route table. You can associate only one
* route table with an attachment.
*
*
* @param associateTransitGatewayRouteTableRequest
* @return Result of the AssociateTransitGatewayRouteTable operation returned by the service.
* @sample AmazonEC2.AssociateTransitGatewayRouteTable
* @see AWS API Documentation
*/
@Override
public AssociateTransitGatewayRouteTableResult associateTransitGatewayRouteTable(AssociateTransitGatewayRouteTableRequest request) {
request = beforeClientExecution(request);
return executeAssociateTransitGatewayRouteTable(request);
}
@SdkInternalApi
final AssociateTransitGatewayRouteTableResult executeAssociateTransitGatewayRouteTable(
AssociateTransitGatewayRouteTableRequest associateTransitGatewayRouteTableRequest) {
ExecutionContext executionContext = createExecutionContext(associateTransitGatewayRouteTableRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateTransitGatewayRouteTableRequestMarshaller().marshall(super.beforeMarshalling(associateTransitGatewayRouteTableRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateTransitGatewayRouteTable");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateTransitGatewayRouteTableResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates a branch network interface with a trunk network interface.
*
*
* Before you create the association, run the create-network-interface command and set --interface-type
to trunk
. You must also
* create a network interface for each branch network interface that you want to associate with the trunk network
* interface.
*
*
* @param associateTrunkInterfaceRequest
* @return Result of the AssociateTrunkInterface operation returned by the service.
* @sample AmazonEC2.AssociateTrunkInterface
* @see AWS
* API Documentation
*/
@Override
public AssociateTrunkInterfaceResult associateTrunkInterface(AssociateTrunkInterfaceRequest request) {
request = beforeClientExecution(request);
return executeAssociateTrunkInterface(request);
}
@SdkInternalApi
final AssociateTrunkInterfaceResult executeAssociateTrunkInterface(AssociateTrunkInterfaceRequest associateTrunkInterfaceRequest) {
ExecutionContext executionContext = createExecutionContext(associateTrunkInterfaceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateTrunkInterfaceRequestMarshaller().marshall(super.beforeMarshalling(associateTrunkInterfaceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateTrunkInterface");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateTrunkInterfaceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, an Amazon-provided IPv6
* CIDR block, or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP
* addresses (BYOIP).
*
*
* You must specify one of the following in the request: an IPv4 CIDR block, an IPv6 pool, or an Amazon-provided
* IPv6 CIDR block.
*
*
* For more information about associating CIDR blocks with your VPC and applicable restrictions, see IP addressing for your VPCs and
* subnets in the Amazon VPC User Guide.
*
*
* @param associateVpcCidrBlockRequest
* @return Result of the AssociateVpcCidrBlock operation returned by the service.
* @sample AmazonEC2.AssociateVpcCidrBlock
* @see AWS API
* Documentation
*/
@Override
public AssociateVpcCidrBlockResult associateVpcCidrBlock(AssociateVpcCidrBlockRequest request) {
request = beforeClientExecution(request);
return executeAssociateVpcCidrBlock(request);
}
@SdkInternalApi
final AssociateVpcCidrBlockResult executeAssociateVpcCidrBlock(AssociateVpcCidrBlockRequest associateVpcCidrBlockRequest) {
ExecutionContext executionContext = createExecutionContext(associateVpcCidrBlockRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateVpcCidrBlockRequestMarshaller().marshall(super.beforeMarshalling(associateVpcCidrBlockRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateVpcCidrBlock");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateVpcCidrBlockResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
*
* This action is deprecated.
*
*
*
* Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC security groups. You
* cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the
* running
state. An instance is automatically unlinked from a VPC when it's stopped - you can link it
* to the VPC again when you restart it.
*
*
* After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change
* the security groups, you must first unlink the instance, and then link it again.
*
*
* Linking your instance to a VPC is sometimes referred to as attaching your instance.
*
*
* @param attachClassicLinkVpcRequest
* @return Result of the AttachClassicLinkVpc operation returned by the service.
* @sample AmazonEC2.AttachClassicLinkVpc
* @see AWS API
* Documentation
*/
@Override
public AttachClassicLinkVpcResult attachClassicLinkVpc(AttachClassicLinkVpcRequest request) {
request = beforeClientExecution(request);
return executeAttachClassicLinkVpc(request);
}
@SdkInternalApi
final AttachClassicLinkVpcResult executeAttachClassicLinkVpc(AttachClassicLinkVpcRequest attachClassicLinkVpcRequest) {
ExecutionContext executionContext = createExecutionContext(attachClassicLinkVpcRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachClassicLinkVpcRequestMarshaller().marshall(super.beforeMarshalling(attachClassicLinkVpcRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachClassicLinkVpc");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AttachClassicLinkVpcResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet
* and the VPC. For more information, see Internet gateways in the
* Amazon VPC User Guide.
*
*
* @param attachInternetGatewayRequest
* @return Result of the AttachInternetGateway operation returned by the service.
* @sample AmazonEC2.AttachInternetGateway
* @see AWS API
* Documentation
*/
@Override
public AttachInternetGatewayResult attachInternetGateway(AttachInternetGatewayRequest request) {
request = beforeClientExecution(request);
return executeAttachInternetGateway(request);
}
@SdkInternalApi
final AttachInternetGatewayResult executeAttachInternetGateway(AttachInternetGatewayRequest attachInternetGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(attachInternetGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachInternetGatewayRequestMarshaller().marshall(super.beforeMarshalling(attachInternetGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachInternetGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AttachInternetGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches a network interface to an instance.
*
*
* @param attachNetworkInterfaceRequest
* Contains the parameters for AttachNetworkInterface.
* @return Result of the AttachNetworkInterface operation returned by the service.
* @sample AmazonEC2.AttachNetworkInterface
* @see AWS API
* Documentation
*/
@Override
public AttachNetworkInterfaceResult attachNetworkInterface(AttachNetworkInterfaceRequest request) {
request = beforeClientExecution(request);
return executeAttachNetworkInterface(request);
}
@SdkInternalApi
final AttachNetworkInterfaceResult executeAttachNetworkInterface(AttachNetworkInterfaceRequest attachNetworkInterfaceRequest) {
ExecutionContext executionContext = createExecutionContext(attachNetworkInterfaceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachNetworkInterfaceRequestMarshaller().marshall(super.beforeMarshalling(attachNetworkInterfaceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachNetworkInterface");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AttachNetworkInterfaceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches the specified Amazon Web Services Verified Access trust provider to the specified Amazon Web Services
* Verified Access instance.
*
*
* @param attachVerifiedAccessTrustProviderRequest
* @return Result of the AttachVerifiedAccessTrustProvider operation returned by the service.
* @sample AmazonEC2.AttachVerifiedAccessTrustProvider
* @see AWS API Documentation
*/
@Override
public AttachVerifiedAccessTrustProviderResult attachVerifiedAccessTrustProvider(AttachVerifiedAccessTrustProviderRequest request) {
request = beforeClientExecution(request);
return executeAttachVerifiedAccessTrustProvider(request);
}
@SdkInternalApi
final AttachVerifiedAccessTrustProviderResult executeAttachVerifiedAccessTrustProvider(
AttachVerifiedAccessTrustProviderRequest attachVerifiedAccessTrustProviderRequest) {
ExecutionContext executionContext = createExecutionContext(attachVerifiedAccessTrustProviderRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachVerifiedAccessTrustProviderRequestMarshaller().marshall(super.beforeMarshalling(attachVerifiedAccessTrustProviderRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachVerifiedAccessTrustProvider");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AttachVerifiedAccessTrustProviderResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device
* name.
*
*
* Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see
* Amazon EBS encryption in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* After you attach an EBS volume, you must make it available. For more information, see Make an EBS volume available
* for use.
*
*
* If a volume has an Amazon Web Services Marketplace product code:
*
*
* -
*
* The volume can be attached only to a stopped instance.
*
*
* -
*
* Amazon Web Services Marketplace product codes are copied from the volume to the instance.
*
*
* -
*
* You must be subscribed to the product.
*
*
* -
*
* The instance type and operating system of the instance must support the product. For example, you can't detach a
* volume from a Windows instance and attach it to a Linux instance.
*
*
*
*
* For more information, see Attach an Amazon EBS volume
* to an instance in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param attachVolumeRequest
* @return Result of the AttachVolume operation returned by the service.
* @sample AmazonEC2.AttachVolume
* @see AWS API
* Documentation
*/
@Override
public AttachVolumeResult attachVolume(AttachVolumeRequest request) {
request = beforeClientExecution(request);
return executeAttachVolume(request);
}
@SdkInternalApi
final AttachVolumeResult executeAttachVolume(AttachVolumeRequest attachVolumeRequest) {
ExecutionContext executionContext = createExecutionContext(attachVolumeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachVolumeRequestMarshaller().marshall(super.beforeMarshalling(attachVolumeRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachVolume");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new AttachVolumeResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches a virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time.
*
*
* For more information, see Amazon Web
* Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.
*
*
* @param attachVpnGatewayRequest
* Contains the parameters for AttachVpnGateway.
* @return Result of the AttachVpnGateway operation returned by the service.
* @sample AmazonEC2.AttachVpnGateway
* @see AWS API
* Documentation
*/
@Override
public AttachVpnGatewayResult attachVpnGateway(AttachVpnGatewayRequest request) {
request = beforeClientExecution(request);
return executeAttachVpnGateway(request);
}
@SdkInternalApi
final AttachVpnGatewayResult executeAttachVpnGateway(AttachVpnGatewayRequest attachVpnGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(attachVpnGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachVpnGatewayRequestMarshaller().marshall(super.beforeMarshalling(attachVpnGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachVpnGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AttachVpnGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization rules act as firewall rules
* that grant access to networks. You must configure ingress authorization rules to enable clients to access
* resources in Amazon Web Services or on-premises networks.
*
*
* @param authorizeClientVpnIngressRequest
* @return Result of the AuthorizeClientVpnIngress operation returned by the service.
* @sample AmazonEC2.AuthorizeClientVpnIngress
* @see AWS
* API Documentation
*/
@Override
public AuthorizeClientVpnIngressResult authorizeClientVpnIngress(AuthorizeClientVpnIngressRequest request) {
request = beforeClientExecution(request);
return executeAuthorizeClientVpnIngress(request);
}
@SdkInternalApi
final AuthorizeClientVpnIngressResult executeAuthorizeClientVpnIngress(AuthorizeClientVpnIngressRequest authorizeClientVpnIngressRequest) {
ExecutionContext executionContext = createExecutionContext(authorizeClientVpnIngressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AuthorizeClientVpnIngressRequestMarshaller().marshall(super.beforeMarshalling(authorizeClientVpnIngressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AuthorizeClientVpnIngress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AuthorizeClientVpnIngressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds the specified outbound (egress) rules to a security group for use with a VPC.
*
*
* An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 CIDR address ranges, or to the
* instances that are associated with the specified source security groups. When specifying an outbound rule for
* your security group in a VPC, the IpPermissions
must include a destination for the traffic.
*
*
* You specify a protocol for each rule (for example, TCP). For the TCP and UDP protocols, you must also specify the
* destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use
* -1 for the type or code to mean all types or all codes.
*
*
* Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.
*
*
* For information about VPC security group quotas, see Amazon VPC quotas.
*
*
*
* If you want to reference a security group across VPCs attached to a transit gateway using the security group referencing
* feature, note that you can only reference security groups for ingress rules. You cannot reference a security
* group for egress rules.
*
*
*
* @param authorizeSecurityGroupEgressRequest
* @return Result of the AuthorizeSecurityGroupEgress operation returned by the service.
* @sample AmazonEC2.AuthorizeSecurityGroupEgress
* @see AWS API Documentation
*/
@Override
public AuthorizeSecurityGroupEgressResult authorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressRequest request) {
request = beforeClientExecution(request);
return executeAuthorizeSecurityGroupEgress(request);
}
@SdkInternalApi
final AuthorizeSecurityGroupEgressResult executeAuthorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest) {
ExecutionContext executionContext = createExecutionContext(authorizeSecurityGroupEgressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AuthorizeSecurityGroupEgressRequestMarshaller().marshall(super.beforeMarshalling(authorizeSecurityGroupEgressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AuthorizeSecurityGroupEgress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AuthorizeSecurityGroupEgressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds the specified inbound (ingress) rules to a security group.
*
*
* An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR address range, or from
* the instances that are associated with the specified destination security groups. When specifying an inbound rule
* for your security group in a VPC, the IpPermissions
must include a source for the traffic.
*
*
* You specify a protocol for each rule (for example, TCP). For TCP and UDP, you must also specify the destination
* port or port range. For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. You can use -1 to mean
* all types or all codes.
*
*
* Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay
* might occur.
*
*
* For more information about VPC security group quotas, see Amazon VPC quotas.
*
*
* @param authorizeSecurityGroupIngressRequest
* @return Result of the AuthorizeSecurityGroupIngress operation returned by the service.
* @sample AmazonEC2.AuthorizeSecurityGroupIngress
* @see AWS API Documentation
*/
@Override
public AuthorizeSecurityGroupIngressResult authorizeSecurityGroupIngress(AuthorizeSecurityGroupIngressRequest request) {
request = beforeClientExecution(request);
return executeAuthorizeSecurityGroupIngress(request);
}
@SdkInternalApi
final AuthorizeSecurityGroupIngressResult executeAuthorizeSecurityGroupIngress(AuthorizeSecurityGroupIngressRequest authorizeSecurityGroupIngressRequest) {
ExecutionContext executionContext = createExecutionContext(authorizeSecurityGroupIngressRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AuthorizeSecurityGroupIngressRequestMarshaller().marshall(super.beforeMarshalling(authorizeSecurityGroupIngressRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AuthorizeSecurityGroupIngress");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AuthorizeSecurityGroupIngressResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Bundles an Amazon instance store-backed Windows instance.
*
*
* During bundling, only the root device volume (C:\) is bundled. Data on other instance store volumes is not
* preserved.
*
*
*
* This action is not applicable for Linux/Unix instances or Windows instances that are backed by Amazon EBS.
*
*
*
* @param bundleInstanceRequest
* Contains the parameters for BundleInstance.
* @return Result of the BundleInstance operation returned by the service.
* @sample AmazonEC2.BundleInstance
* @see AWS API
* Documentation
*/
@Override
public BundleInstanceResult bundleInstance(BundleInstanceRequest request) {
request = beforeClientExecution(request);
return executeBundleInstance(request);
}
@SdkInternalApi
final BundleInstanceResult executeBundleInstance(BundleInstanceRequest bundleInstanceRequest) {
ExecutionContext executionContext = createExecutionContext(bundleInstanceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new BundleInstanceRequestMarshaller().marshall(super.beforeMarshalling(bundleInstanceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BundleInstance");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new BundleInstanceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels a bundling operation for an instance store-backed Windows instance.
*
*
* @param cancelBundleTaskRequest
* Contains the parameters for CancelBundleTask.
* @return Result of the CancelBundleTask operation returned by the service.
* @sample AmazonEC2.CancelBundleTask
* @see AWS API
* Documentation
*/
@Override
public CancelBundleTaskResult cancelBundleTask(CancelBundleTaskRequest request) {
request = beforeClientExecution(request);
return executeCancelBundleTask(request);
}
@SdkInternalApi
final CancelBundleTaskResult executeCancelBundleTask(CancelBundleTaskRequest cancelBundleTaskRequest) {
ExecutionContext executionContext = createExecutionContext(cancelBundleTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelBundleTaskRequestMarshaller().marshall(super.beforeMarshalling(cancelBundleTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelBundleTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelBundleTaskResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels the specified Capacity Reservation, releases the reserved capacity, and changes the Capacity
* Reservation's state to cancelled
.
*
*
* Instances running in the reserved capacity continue running until you stop them. Stopped instances that target
* the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity
* Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching
* attributes and sufficient capacity.
*
*
* @param cancelCapacityReservationRequest
* @return Result of the CancelCapacityReservation operation returned by the service.
* @sample AmazonEC2.CancelCapacityReservation
* @see AWS
* API Documentation
*/
@Override
public CancelCapacityReservationResult cancelCapacityReservation(CancelCapacityReservationRequest request) {
request = beforeClientExecution(request);
return executeCancelCapacityReservation(request);
}
@SdkInternalApi
final CancelCapacityReservationResult executeCancelCapacityReservation(CancelCapacityReservationRequest cancelCapacityReservationRequest) {
ExecutionContext executionContext = createExecutionContext(cancelCapacityReservationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelCapacityReservationRequestMarshaller().marshall(super.beforeMarshalling(cancelCapacityReservationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelCapacityReservation");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelCapacityReservationResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels one or more Capacity Reservation Fleets. When you cancel a Capacity Reservation Fleet, the following
* happens:
*
*
* -
*
* The Capacity Reservation Fleet's status changes to cancelled
.
*
*
* -
*
* The individual Capacity Reservations in the Fleet are cancelled. Instances running in the Capacity Reservations
* at the time of cancelling the Fleet continue to run in shared capacity.
*
*
* -
*
* The Fleet stops creating new Capacity Reservations.
*
*
*
*
* @param cancelCapacityReservationFleetsRequest
* @return Result of the CancelCapacityReservationFleets operation returned by the service.
* @sample AmazonEC2.CancelCapacityReservationFleets
* @see AWS API Documentation
*/
@Override
public CancelCapacityReservationFleetsResult cancelCapacityReservationFleets(CancelCapacityReservationFleetsRequest request) {
request = beforeClientExecution(request);
return executeCancelCapacityReservationFleets(request);
}
@SdkInternalApi
final CancelCapacityReservationFleetsResult executeCancelCapacityReservationFleets(
CancelCapacityReservationFleetsRequest cancelCapacityReservationFleetsRequest) {
ExecutionContext executionContext = createExecutionContext(cancelCapacityReservationFleetsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelCapacityReservationFleetsRequestMarshaller().marshall(super.beforeMarshalling(cancelCapacityReservationFleetsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelCapacityReservationFleets");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelCapacityReservationFleetsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all
* artifacts of the conversion, including a partially uploaded volume or instance. If the conversion is complete or
* is in the process of transferring the final disk image, the command fails and returns an exception.
*
*
* For more information, see Importing a
* Virtual Machine Using the Amazon EC2 CLI.
*
*
* @param cancelConversionTaskRequest
* @return Result of the CancelConversionTask operation returned by the service.
* @sample AmazonEC2.CancelConversionTask
* @see AWS API
* Documentation
*/
@Override
public CancelConversionTaskResult cancelConversionTask(CancelConversionTaskRequest request) {
request = beforeClientExecution(request);
return executeCancelConversionTask(request);
}
@SdkInternalApi
final CancelConversionTaskResult executeCancelConversionTask(CancelConversionTaskRequest cancelConversionTaskRequest) {
ExecutionContext executionContext = createExecutionContext(cancelConversionTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelConversionTaskRequestMarshaller().marshall(super.beforeMarshalling(cancelConversionTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelConversionTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelConversionTaskResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels an active export task. The request removes all artifacts of the export, including any partially-created
* Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the
* command fails and returns an error.
*
*
* @param cancelExportTaskRequest
* @return Result of the CancelExportTask operation returned by the service.
* @sample AmazonEC2.CancelExportTask
* @see AWS API
* Documentation
*/
@Override
public CancelExportTaskResult cancelExportTask(CancelExportTaskRequest request) {
request = beforeClientExecution(request);
return executeCancelExportTask(request);
}
@SdkInternalApi
final CancelExportTaskResult executeCancelExportTask(CancelExportTaskRequest cancelExportTaskRequest) {
ExecutionContext executionContext = createExecutionContext(cancelExportTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelExportTaskRequestMarshaller().marshall(super.beforeMarshalling(cancelExportTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelExportTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelExportTaskResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes your Amazon Web Services account from the launch permissions for the specified AMI. For more information,
* see Cancel having an
* AMI shared with your Amazon Web Services account in the Amazon EC2 User Guide.
*
*
* @param cancelImageLaunchPermissionRequest
* @return Result of the CancelImageLaunchPermission operation returned by the service.
* @sample AmazonEC2.CancelImageLaunchPermission
* @see AWS API Documentation
*/
@Override
public CancelImageLaunchPermissionResult cancelImageLaunchPermission(CancelImageLaunchPermissionRequest request) {
request = beforeClientExecution(request);
return executeCancelImageLaunchPermission(request);
}
@SdkInternalApi
final CancelImageLaunchPermissionResult executeCancelImageLaunchPermission(CancelImageLaunchPermissionRequest cancelImageLaunchPermissionRequest) {
ExecutionContext executionContext = createExecutionContext(cancelImageLaunchPermissionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelImageLaunchPermissionRequestMarshaller().marshall(super.beforeMarshalling(cancelImageLaunchPermissionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelImageLaunchPermission");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelImageLaunchPermissionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels an in-process import virtual machine or import snapshot task.
*
*
* @param cancelImportTaskRequest
* @return Result of the CancelImportTask operation returned by the service.
* @sample AmazonEC2.CancelImportTask
* @see AWS API
* Documentation
*/
@Override
public CancelImportTaskResult cancelImportTask(CancelImportTaskRequest request) {
request = beforeClientExecution(request);
return executeCancelImportTask(request);
}
@SdkInternalApi
final CancelImportTaskResult executeCancelImportTask(CancelImportTaskRequest cancelImportTaskRequest) {
ExecutionContext executionContext = createExecutionContext(cancelImportTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelImportTaskRequestMarshaller().marshall(super.beforeMarshalling(cancelImportTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelImportTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelImportTaskResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public CancelImportTaskResult cancelImportTask() {
return cancelImportTask(new CancelImportTaskRequest());
}
/**
*
* Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.
*
*
* For more information, see Reserved Instance
* Marketplace in the Amazon EC2 User Guide.
*
*
* @param cancelReservedInstancesListingRequest
* Contains the parameters for CancelReservedInstancesListing.
* @return Result of the CancelReservedInstancesListing operation returned by the service.
* @sample AmazonEC2.CancelReservedInstancesListing
* @see AWS API Documentation
*/
@Override
public CancelReservedInstancesListingResult cancelReservedInstancesListing(CancelReservedInstancesListingRequest request) {
request = beforeClientExecution(request);
return executeCancelReservedInstancesListing(request);
}
@SdkInternalApi
final CancelReservedInstancesListingResult executeCancelReservedInstancesListing(CancelReservedInstancesListingRequest cancelReservedInstancesListingRequest) {
ExecutionContext executionContext = createExecutionContext(cancelReservedInstancesListingRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelReservedInstancesListingRequestMarshaller().marshall(super.beforeMarshalling(cancelReservedInstancesListingRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelReservedInstancesListing");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelReservedInstancesListingResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels the specified Spot Fleet requests.
*
*
* After you cancel a Spot Fleet request, the Spot Fleet launches no new instances.
*
*
* You must also specify whether a canceled Spot Fleet request should terminate its instances. If you choose to
* terminate the instances, the Spot Fleet request enters the cancelled_terminating
state. Otherwise,
* the Spot Fleet request enters the cancelled_running
state and the instances continue to run until
* they are interrupted or you terminate them manually.
*
*
* @param cancelSpotFleetRequestsRequest
* Contains the parameters for CancelSpotFleetRequests.
* @return Result of the CancelSpotFleetRequests operation returned by the service.
* @sample AmazonEC2.CancelSpotFleetRequests
* @see AWS
* API Documentation
*/
@Override
public CancelSpotFleetRequestsResult cancelSpotFleetRequests(CancelSpotFleetRequestsRequest request) {
request = beforeClientExecution(request);
return executeCancelSpotFleetRequests(request);
}
@SdkInternalApi
final CancelSpotFleetRequestsResult executeCancelSpotFleetRequests(CancelSpotFleetRequestsRequest cancelSpotFleetRequestsRequest) {
ExecutionContext executionContext = createExecutionContext(cancelSpotFleetRequestsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelSpotFleetRequestsRequestMarshaller().marshall(super.beforeMarshalling(cancelSpotFleetRequestsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelSpotFleetRequests");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelSpotFleetRequestsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Cancels one or more Spot Instance requests.
*
*
*
* Canceling a Spot Instance request does not terminate running Spot Instances associated with the request.
*
*
*
* @param cancelSpotInstanceRequestsRequest
* Contains the parameters for CancelSpotInstanceRequests.
* @return Result of the CancelSpotInstanceRequests operation returned by the service.
* @sample AmazonEC2.CancelSpotInstanceRequests
* @see AWS
* API Documentation
*/
@Override
public CancelSpotInstanceRequestsResult cancelSpotInstanceRequests(CancelSpotInstanceRequestsRequest request) {
request = beforeClientExecution(request);
return executeCancelSpotInstanceRequests(request);
}
@SdkInternalApi
final CancelSpotInstanceRequestsResult executeCancelSpotInstanceRequests(CancelSpotInstanceRequestsRequest cancelSpotInstanceRequestsRequest) {
ExecutionContext executionContext = createExecutionContext(cancelSpotInstanceRequestsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelSpotInstanceRequestsRequestMarshaller().marshall(super.beforeMarshalling(cancelSpotInstanceRequestsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelSpotInstanceRequests");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CancelSpotInstanceRequestsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Determines whether a product code is associated with an instance. This action can only be used by the owner of
* the product code. It is useful when a product code owner must verify whether another user's instance is eligible
* for support.
*
*
* @param confirmProductInstanceRequest
* @return Result of the ConfirmProductInstance operation returned by the service.
* @sample AmazonEC2.ConfirmProductInstance
* @see AWS API
* Documentation
*/
@Override
public ConfirmProductInstanceResult confirmProductInstance(ConfirmProductInstanceRequest request) {
request = beforeClientExecution(request);
return executeConfirmProductInstance(request);
}
@SdkInternalApi
final ConfirmProductInstanceResult executeConfirmProductInstance(ConfirmProductInstanceRequest confirmProductInstanceRequest) {
ExecutionContext executionContext = createExecutionContext(confirmProductInstanceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ConfirmProductInstanceRequestMarshaller().marshall(super.beforeMarshalling(confirmProductInstanceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ConfirmProductInstance");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new ConfirmProductInstanceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Copies the specified Amazon FPGA Image (AFI) to the current Region.
*
*
* @param copyFpgaImageRequest
* @return Result of the CopyFpgaImage operation returned by the service.
* @sample AmazonEC2.CopyFpgaImage
* @see AWS API
* Documentation
*/
@Override
public CopyFpgaImageResult copyFpgaImage(CopyFpgaImageRequest request) {
request = beforeClientExecution(request);
return executeCopyFpgaImage(request);
}
@SdkInternalApi
final CopyFpgaImageResult executeCopyFpgaImage(CopyFpgaImageRequest copyFpgaImageRequest) {
ExecutionContext executionContext = createExecutionContext(copyFpgaImageRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CopyFpgaImageRequestMarshaller().marshall(super.beforeMarshalling(copyFpgaImageRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CopyFpgaImage");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new CopyFpgaImageResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Initiates the copy of an AMI. You can copy an AMI from one Region to another, or from a Region to an Outpost. You
* can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost. To copy
* an AMI to another partition, see CreateStoreImageTask.
*
*
* To copy an AMI from one Region to another, specify the source Region using the SourceRegion parameter, and
* specify the destination Region using its endpoint. Copies of encrypted backing snapshots for the AMI are
* encrypted. Copies of unencrypted backing snapshots remain unencrypted, unless you set Encrypted
* during the copy operation. You cannot create an unencrypted copy of an encrypted backing snapshot.
*
*
* To copy an AMI from a Region to an Outpost, specify the source Region using the SourceRegion parameter,
* and specify the ARN of the destination Outpost using DestinationOutpostArn. Backing snapshots copied to an
* Outpost are encrypted by default using the default encryption key for the Region, or a different key that you
* specify in the request using KmsKeyId. Outposts do not support unencrypted snapshots. For more
* information, Amazon
* EBS local snapshots on Outposts in the Amazon EC2 User Guide.
*
*
* For more information about the prerequisites and limits when copying an AMI, see Copy an AMI in the Amazon EC2
* User Guide.
*
*
* @param copyImageRequest
* Contains the parameters for CopyImage.
* @return Result of the CopyImage operation returned by the service.
* @sample AmazonEC2.CopyImage
* @see AWS API
* Documentation
*/
@Override
public CopyImageResult copyImage(CopyImageRequest request) {
request = beforeClientExecution(request);
return executeCopyImage(request);
}
@SdkInternalApi
final CopyImageResult executeCopyImage(CopyImageRequest copyImageRequest) {
ExecutionContext executionContext = createExecutionContext(copyImageRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CopyImageRequestMarshaller().marshall(super.beforeMarshalling(copyImageRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CopyImage");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new CopyImageResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy a snapshot within the
* same Region, from one Region to another, or from a Region to an Outpost. You can't copy a snapshot from an
* Outpost to a Region, from one Outpost to another, or within the same Outpost.
*
*
* You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).
*
*
* When copying snapshots to a Region, copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted
* snapshots remain unencrypted, unless you enable encryption for the snapshot copy operation. By default, encrypted
* snapshot copies use the default Key Management Service (KMS) KMS key; however, you can specify a different KMS
* key. To copy an encrypted snapshot that has been shared from another account, you must have permissions for the
* KMS key used to encrypt the snapshot.
*
*
* Snapshots copied to an Outpost are encrypted by default using the default encryption key for the Region, or a
* different key that you specify in the request using KmsKeyId. Outposts do not support unencrypted
* snapshots. For more information, Amazon EBS local
* snapshots on Outposts in the Amazon Elastic Compute Cloud User Guide.
*
*
* Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any
* purpose.
*
*
* For more information, see Copy an Amazon EBS snapshot
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param copySnapshotRequest
* @return Result of the CopySnapshot operation returned by the service.
* @sample AmazonEC2.CopySnapshot
* @see AWS API
* Documentation
*/
@Override
public CopySnapshotResult copySnapshot(CopySnapshotRequest request) {
request = beforeClientExecution(request);
return executeCopySnapshot(request);
}
@SdkInternalApi
final CopySnapshotResult executeCopySnapshot(CopySnapshotRequest copySnapshotRequest) {
ExecutionContext executionContext = createExecutionContext(copySnapshotRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CopySnapshotRequestMarshaller().marshall(super.beforeMarshalling(copySnapshotRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CopySnapshot");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new CopySnapshotResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a new Capacity Reservation with the specified attributes.
*
*
* Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances in a specific Availability
* Zone for any duration. This gives you the flexibility to selectively add capacity reservations and still get the
* Regional RI discounts for that usage. By creating Capacity Reservations, you ensure that you always have access
* to Amazon EC2 capacity when you need it, for as long as you need it. For more information, see Capacity
* Reservations in the Amazon EC2 User Guide.
*
*
* Your request to create a Capacity Reservation could fail if Amazon EC2 does not have sufficient capacity to
* fulfill the request. If your request fails due to Amazon EC2 capacity constraints, either try again at a later
* time, try in a different Availability Zone, or request a smaller capacity reservation. If your application is
* flexible across instance types and sizes, try to create a Capacity Reservation with different instance
* attributes.
*
*
* Your request could also fail if the requested quantity exceeds your On-Demand Instance limit for the selected
* instance type. If your request fails due to limit constraints, increase your On-Demand Instance limit for the
* required instance type and try again. For more information about increasing your instance limits, see Amazon EC2 Service Quotas
* in the Amazon EC2 User Guide.
*
*
* @param createCapacityReservationRequest
* @return Result of the CreateCapacityReservation operation returned by the service.
* @sample AmazonEC2.CreateCapacityReservation
* @see AWS
* API Documentation
*/
@Override
public CreateCapacityReservationResult createCapacityReservation(CreateCapacityReservationRequest request) {
request = beforeClientExecution(request);
return executeCreateCapacityReservation(request);
}
@SdkInternalApi
final CreateCapacityReservationResult executeCreateCapacityReservation(CreateCapacityReservationRequest createCapacityReservationRequest) {
ExecutionContext executionContext = createExecutionContext(createCapacityReservationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCapacityReservationRequestMarshaller().marshall(super.beforeMarshalling(createCapacityReservationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCapacityReservation");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateCapacityReservationResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a Capacity Reservation Fleet. For more information, see Create a
* Capacity Reservation Fleet in the Amazon EC2 User Guide.
*
*
* @param createCapacityReservationFleetRequest
* @return Result of the CreateCapacityReservationFleet operation returned by the service.
* @sample AmazonEC2.CreateCapacityReservationFleet
* @see AWS API Documentation
*/
@Override
public CreateCapacityReservationFleetResult createCapacityReservationFleet(CreateCapacityReservationFleetRequest request) {
request = beforeClientExecution(request);
return executeCreateCapacityReservationFleet(request);
}
@SdkInternalApi
final CreateCapacityReservationFleetResult executeCreateCapacityReservationFleet(CreateCapacityReservationFleetRequest createCapacityReservationFleetRequest) {
ExecutionContext executionContext = createExecutionContext(createCapacityReservationFleetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCapacityReservationFleetRequestMarshaller().marshall(super.beforeMarshalling(createCapacityReservationFleetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCapacityReservationFleet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateCapacityReservationFleetResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a carrier gateway. For more information about carrier gateways, see Carrier gateways in the Amazon Web Services Wavelength Developer Guide.
*
*
* @param createCarrierGatewayRequest
* @return Result of the CreateCarrierGateway operation returned by the service.
* @sample AmazonEC2.CreateCarrierGateway
* @see AWS API
* Documentation
*/
@Override
public CreateCarrierGatewayResult createCarrierGateway(CreateCarrierGatewayRequest request) {
request = beforeClientExecution(request);
return executeCreateCarrierGateway(request);
}
@SdkInternalApi
final CreateCarrierGatewayResult executeCreateCarrierGateway(CreateCarrierGatewayRequest createCarrierGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(createCarrierGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCarrierGatewayRequestMarshaller().marshall(super.beforeMarshalling(createCarrierGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCarrierGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateCarrierGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a Client VPN endpoint. A Client VPN endpoint is the resource you create and configure to enable and
* manage client VPN sessions. It is the destination endpoint at which all client VPN sessions are terminated.
*
*
* @param createClientVpnEndpointRequest
* @return Result of the CreateClientVpnEndpoint operation returned by the service.
* @sample AmazonEC2.CreateClientVpnEndpoint
* @see AWS
* API Documentation
*/
@Override
public CreateClientVpnEndpointResult createClientVpnEndpoint(CreateClientVpnEndpointRequest request) {
request = beforeClientExecution(request);
return executeCreateClientVpnEndpoint(request);
}
@SdkInternalApi
final CreateClientVpnEndpointResult executeCreateClientVpnEndpoint(CreateClientVpnEndpointRequest createClientVpnEndpointRequest) {
ExecutionContext executionContext = createExecutionContext(createClientVpnEndpointRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateClientVpnEndpointRequestMarshaller().marshall(super.beforeMarshalling(createClientVpnEndpointRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateClientVpnEndpoint");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateClientVpnEndpointResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint has a route table that describes the
* available destination network routes. Each route in the route table specifies the path for traffic to specific
* resources or networks.
*
*
* @param createClientVpnRouteRequest
* @return Result of the CreateClientVpnRoute operation returned by the service.
* @sample AmazonEC2.CreateClientVpnRoute
* @see AWS API
* Documentation
*/
@Override
public CreateClientVpnRouteResult createClientVpnRoute(CreateClientVpnRouteRequest request) {
request = beforeClientExecution(request);
return executeCreateClientVpnRoute(request);
}
@SdkInternalApi
final CreateClientVpnRouteResult executeCreateClientVpnRoute(CreateClientVpnRouteRequest createClientVpnRouteRequest) {
ExecutionContext executionContext = createExecutionContext(createClientVpnRouteRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateClientVpnRouteRequestMarshaller().marshall(super.beforeMarshalling(createClientVpnRouteRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateClientVpnRoute");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateClientVpnRouteResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a range of customer-owned IP addresses.
*
*
* @param createCoipCidrRequest
* @return Result of the CreateCoipCidr operation returned by the service.
* @sample AmazonEC2.CreateCoipCidr
* @see AWS API
* Documentation
*/
@Override
public CreateCoipCidrResult createCoipCidr(CreateCoipCidrRequest request) {
request = beforeClientExecution(request);
return executeCreateCoipCidr(request);
}
@SdkInternalApi
final CreateCoipCidrResult executeCreateCoipCidr(CreateCoipCidrRequest createCoipCidrRequest) {
ExecutionContext executionContext = createExecutionContext(createCoipCidrRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCoipCidrRequestMarshaller().marshall(super.beforeMarshalling(createCoipCidrRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCoipCidr");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateCoipCidrResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a pool of customer-owned IP (CoIP) addresses.
*
*
* @param createCoipPoolRequest
* @return Result of the CreateCoipPool operation returned by the service.
* @sample AmazonEC2.CreateCoipPool
* @see AWS API
* Documentation
*/
@Override
public CreateCoipPoolResult createCoipPool(CreateCoipPoolRequest request) {
request = beforeClientExecution(request);
return executeCreateCoipPool(request);
}
@SdkInternalApi
final CreateCoipPoolResult executeCreateCoipPool(CreateCoipPoolRequest createCoipPoolRequest) {
ExecutionContext executionContext = createExecutionContext(createCoipPoolRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCoipPoolRequestMarshaller().marshall(super.beforeMarshalling(createCoipPoolRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCoipPool");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler