com.amazonaws.services.ec2.AmazonEC2Client Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2014-2019 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 AWS cloud. Using
* Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and deploy applications faster.
*
*
* To learn more about Amazon EC2, Amazon EBS, and Amazon VPC, see the following resources:
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
*
*/
@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;
/**
* List of exception unmarshallers for all modeled exceptions
*/
protected final List> exceptionUnmarshallers = new ArrayList>();
/**
* 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() {
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 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.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 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.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 one or more interface VPC endpoint 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.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.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 address range that is provisioned for use with your AWS 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 AWS. To
* minimize down time, you can configure your AWS 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 AWS.
*
*
* It can take a few minutes before traffic to the specified addresses starts routing to AWS 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.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 AWS 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 AWS account.
*
*
* You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a
* public IPv4 address range that you have brought to AWS for use with your AWS 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.
*
*
* [EC2-VPC] 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 AWS account. You cannot recover an Elastic IP address
* for EC2-Classic. To attempt to recover an Elastic IP address that you released, specify it in this operation.
*
*
* An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5
* Elastic IP addresses for EC2-Classic per region and 5 Elastic IP addresses for EC2-VPC per region.
*
*
* For more information, see Elastic IP Addresses
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* @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.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 instance size type, Availability Zone, and
* quantity 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.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);
}
}
/**
*
* 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.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.
*
*
* @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.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.
*
*
* @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.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);
}
}
/**
*
* Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP
* address, you must allocate it to your account.
*
*
* An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* [EC2-Classic, VPC in an EC2-VPC-only 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.
*
*
* [VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated
* with the primary IP address. If the Elastic IP address is already associated with a different instance or a
* network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address
* with an instance or network interface that has an existing Elastic IP address.
*
*
*
* 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.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.
*
*
* @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.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 Virtual Private Cloud 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.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 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.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 a subnet with a route table. The subnet and route table must be in the same VPC. This association
* causes traffic originating from the subnet 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 from the subnet later. A route
* table can be associated with multiple subnets.
*
*
* For more information, see Route Tables in the
* Amazon Virtual Private Cloud 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.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. An
* IPv6 CIDR block must have a prefix length of /64.
*
*
* @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.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 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.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 CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, or you can associate an
* Amazon-provided IPv6 CIDR block. The IPv6 CIDR block size is fixed at /56.
*
*
* For more information about associating CIDR blocks with your VPC and applicable restrictions, see VPC and Subnet
* Sizing in the Amazon Virtual Private Cloud 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.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);
}
}
/**
*
* Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's 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.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 to a VPC, enabling connectivity between the internet and the VPC. For more
* information about your VPC and internet gateway, see the Amazon Virtual Private Cloud 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.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.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 an EBS volume to a running or stopped instance and exposes it to the instance with the specified device
* name.
*
*
* Encrypted EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information,
* see Amazon EBS Encryption in
* the Amazon Elastic Compute Cloud User Guide.
*
*
* For a list of supported device names, see Attaching an EBS Volume to
* an Instance. Any device names that aren't reserved for instance store volumes can be used for EBS volumes.
* For more information, see Amazon EC2 Instance Store in
* the Amazon Elastic Compute Cloud User Guide.
*
*
* If a volume has an AWS Marketplace product code:
*
*
* -
*
* The volume can be attached only to a stopped instance.
*
*
* -
*
* AWS 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 about EBS volumes, see Attaching Amazon EBS
* Volumes in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param attachVolumeRequest
* Contains the parameters for AttachVolume.
* @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.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 AWS Site-to-Site
* VPN in the AWS 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.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 AWS 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.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);
}
}
/**
*
* [EC2-VPC only] Adds one or more egress rules to a security group for use with a VPC. Specifically, this action
* permits instances to send traffic to one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more
* destination security groups for the same VPC. This action doesn't apply to security groups for use in
* EC2-Classic. For more information, see Security Groups for Your
* VPC in the Amazon Virtual Private Cloud User Guide. For more information about security group limits,
* see Amazon VPC
* Limits.
*
*
* Each rule consists of the protocol (for example, TCP), plus either a CIDR range or a source group. 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. You can
* optionally specify a description for the rule.
*
*
* Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.
*
*
* @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.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 one or more ingress rules to a security group.
*
*
* Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay
* might occur.
*
*
* [EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission to access a security group in
* your account, or gives one or more security groups (called the source groups) permission to access a
* security group for your account. A source group can be for your own AWS account, or another. You can have up to
* 100 rules per group.
*
*
* [EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges permission to access a security group in
* your VPC, or gives one or more other security groups (called the source groups) permission to access a
* security group for your VPC. The security groups must all be for the same VPC or a peer VPC in a VPC peering
* connection. For more information about VPC security group limits, see Amazon VPC Limits.
*
*
* You can optionally specify a description for the security group rule.
*
*
* @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.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.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.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.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 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
* Contains the parameters for CancelConversionTask.
* @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.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
* Contains the parameters for CancelExportTask.
* @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.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);
}
}
/**
*
* Cancels an in-process import virtual machine or import snapshot task.
*
*
* @param cancelImportTaskRequest
* Contains the parameters for CancelImportTask.
* @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.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 Elastic Compute Cloud 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.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 Spot Instances. You must specify whether
* the Spot Fleet should also terminate its Spot Instances. If you 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.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.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.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.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 from the specified source region to the current region. You specify the destination
* region by using its endpoint when making the request.
*
*
* 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.
*
*
* For more information about the prerequisites and limits when copying an AMI, see Copying an AMI in the Amazon
* Elastic Compute Cloud 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.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 the snapshot within the
* same Region or from one Region to another. You can use the snapshot to create EBS volumes or Amazon Machine
* Images (AMIs). The snapshot is copied to the regional endpoint that you send the HTTP request to.
*
*
* Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless
* the Encrypted
flag is specified during the snapshot copy operation. By default, encrypted snapshot
* copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a
* non-default CMK with the KmsKeyId
parameter.
*
*
* To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK
* used to encrypt the snapshot.
*
*
* Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any
* purpose.
*
*
* For more information, see Copying an Amazon EBS
* Snapshot in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param copySnapshotRequest
* Contains the parameters for CopySnapshot.
* @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.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 Elastic Compute Cloud 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 Limits
* in the Amazon Elastic Compute Cloud 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.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 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.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.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);
}
}
/**
*
* Provides information to AWS about your VPN customer gateway device. The customer gateway is the appliance at your
* end of the VPN connection. (The device on the AWS side of the VPN connection is the virtual private gateway.) You
* must provide the Internet-routable IP address of the customer gateway's external interface. The IP address must
* be static and may be behind a device performing network address translation (NAT).
*
*
* For devices that use Border Gateway Protocol (BGP), you can also provide the device's BGP Autonomous System
* Number (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use
* a private ASN (in the 64512 - 65534 range).
*
*
*
* Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with the exception of 7224, which is
* reserved in the us-east-1
region, and 9059, which is reserved in the eu-west-1
region.
*
*
*
* For more information, see AWS Site-to-Site
* VPN in the AWS Site-to-Site VPN User Guide.
*
*
*
* You cannot create more than one customer gateway with the same VPN type, IP address, and BGP ASN parameter
* values. If you run an identical request more than one time, the first request creates the customer gateway, and
* subsequent requests return information about the existing customer gateway. The subsequent requests do not create
* new customer gateway resources.
*
*
*
* @param createCustomerGatewayRequest
* Contains the parameters for CreateCustomerGateway.
* @return Result of the CreateCustomerGateway operation returned by the service.
* @sample AmazonEC2.CreateCustomerGateway
* @see AWS API
* Documentation
*/
@Override
public CreateCustomerGatewayResult createCustomerGateway(CreateCustomerGatewayRequest request) {
request = beforeClientExecution(request);
return executeCreateCustomerGateway(request);
}
@SdkInternalApi
final CreateCustomerGatewayResult executeCreateCustomerGateway(CreateCustomerGatewayRequest createCustomerGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(createCustomerGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCustomerGatewayRequestMarshaller().marshall(super.beforeMarshalling(createCustomerGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCustomerGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateCustomerGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a default subnet with a size /20
IPv4 CIDR block in the specified Availability Zone in your
* default VPC. You can have only one default subnet per Availability Zone. For more information, see Creating a
* Default Subnet in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createDefaultSubnetRequest
* @return Result of the CreateDefaultSubnet operation returned by the service.
* @sample AmazonEC2.CreateDefaultSubnet
* @see AWS API
* Documentation
*/
@Override
public CreateDefaultSubnetResult createDefaultSubnet(CreateDefaultSubnetRequest request) {
request = beforeClientExecution(request);
return executeCreateDefaultSubnet(request);
}
@SdkInternalApi
final CreateDefaultSubnetResult executeCreateDefaultSubnet(CreateDefaultSubnetRequest createDefaultSubnetRequest) {
ExecutionContext executionContext = createExecutionContext(createDefaultSubnetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDefaultSubnetRequestMarshaller().marshall(super.beforeMarshalling(createDefaultSubnetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDefaultSubnet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateDefaultSubnetResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a default VPC with a size /16
IPv4 CIDR block and a default subnet in each Availability
* Zone. For more information about the components of a default VPC, see Default VPC and Default
* Subnets in the Amazon Virtual Private Cloud User Guide. You cannot specify the components of the
* default VPC yourself.
*
*
* If you deleted your previous default VPC, you can create a default VPC. You cannot have more than one default VPC
* per Region.
*
*
* If your account supports EC2-Classic, you cannot use this action to create a default VPC in a Region that
* supports EC2-Classic. If you want a default VPC in a Region that supports EC2-Classic, see
* "I really want a default VPC for my existing EC2 account. Is that possible?" in the Default VPCs FAQ.
*
*
* @param createDefaultVpcRequest
* @return Result of the CreateDefaultVpc operation returned by the service.
* @sample AmazonEC2.CreateDefaultVpc
* @see AWS API
* Documentation
*/
@Override
public CreateDefaultVpcResult createDefaultVpc(CreateDefaultVpcRequest request) {
request = beforeClientExecution(request);
return executeCreateDefaultVpc(request);
}
@SdkInternalApi
final CreateDefaultVpcResult executeCreateDefaultVpc(CreateDefaultVpcRequest createDefaultVpcRequest) {
ExecutionContext executionContext = createExecutionContext(createDefaultVpcRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDefaultVpcRequestMarshaller().marshall(super.beforeMarshalling(createDefaultVpcRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDefaultVpc");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateDefaultVpcResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing
* all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the
* individual DHCP options you can specify. For more information about the options, see RFC 2132.
*
*
* -
*
* domain-name-servers
- The IP addresses of up to four domain name servers, or AmazonProvidedDNS. The
* default DHCP option set specifies AmazonProvidedDNS. If specifying more than one domain name server, specify the
* IP addresses in a single parameter, separated by commas. ITo have your instance to receive a custom DNS hostname
* as specified in domain-name
, you must set domain-name-servers
to a custom DNS server.
*
*
* -
*
* domain-name
- If you're using AmazonProvidedDNS in us-east-1
, specify
* ec2.internal
. If you're using AmazonProvidedDNS in another region, specify
* region.compute.internal
(for example, ap-northeast-1.compute.internal
). Otherwise,
* specify a domain name (for example, MyCompany.com
). This value is used to complete unqualified DNS
* hostnames. Important: Some Linux operating systems accept multiple domain names separated by spaces.
* However, Windows and other Linux operating systems treat the value as a single domain, which results in
* unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating
* systems, specify only one domain name.
*
*
* -
*
* ntp-servers
- The IP addresses of up to four Network Time Protocol (NTP) servers.
*
*
* -
*
* netbios-name-servers
- The IP addresses of up to four NetBIOS name servers.
*
*
* -
*
* netbios-node-type
- The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2
* (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132.
*
*
*
*
* Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide
* (AmazonProvidedDNS). If you create a set of options, and if your VPC has an internet gateway, make sure to set
* the domain-name-servers
option either to AmazonProvidedDNS
or to a domain name server
* of your choice. For more information, see DHCP Options Sets in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param createDhcpOptionsRequest
* @return Result of the CreateDhcpOptions operation returned by the service.
* @sample AmazonEC2.CreateDhcpOptions
* @see AWS API
* Documentation
*/
@Override
public CreateDhcpOptionsResult createDhcpOptions(CreateDhcpOptionsRequest request) {
request = beforeClientExecution(request);
return executeCreateDhcpOptions(request);
}
@SdkInternalApi
final CreateDhcpOptionsResult executeCreateDhcpOptions(CreateDhcpOptionsRequest createDhcpOptionsRequest) {
ExecutionContext executionContext = createExecutionContext(createDhcpOptionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDhcpOptionsRequestMarshaller().marshall(super.beforeMarshalling(createDhcpOptionsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDhcpOptions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateDhcpOptionsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* [IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only internet gateway is used to
* enable outbound communication over IPv6 from instances in your VPC to the internet, and prevents hosts outside of
* your VPC from initiating an IPv6 connection with your instance.
*
*
* @param createEgressOnlyInternetGatewayRequest
* @return Result of the CreateEgressOnlyInternetGateway operation returned by the service.
* @sample AmazonEC2.CreateEgressOnlyInternetGateway
* @see AWS API Documentation
*/
@Override
public CreateEgressOnlyInternetGatewayResult createEgressOnlyInternetGateway(CreateEgressOnlyInternetGatewayRequest request) {
request = beforeClientExecution(request);
return executeCreateEgressOnlyInternetGateway(request);
}
@SdkInternalApi
final CreateEgressOnlyInternetGatewayResult executeCreateEgressOnlyInternetGateway(
CreateEgressOnlyInternetGatewayRequest createEgressOnlyInternetGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(createEgressOnlyInternetGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateEgressOnlyInternetGatewayRequestMarshaller().marshall(super.beforeMarshalling(createEgressOnlyInternetGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEgressOnlyInternetGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateEgressOnlyInternetGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Launches an EC2 Fleet.
*
*
* You can create a single EC2 Fleet that includes multiple launch specifications that vary by instance type, AMI,
* Availability Zone, or subnet.
*
*
* For more information, see Launching
* an EC2 Fleet in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param createFleetRequest
* @return Result of the CreateFleet operation returned by the service.
* @sample AmazonEC2.CreateFleet
* @see AWS API
* Documentation
*/
@Override
public CreateFleetResult createFleet(CreateFleetRequest request) {
request = beforeClientExecution(request);
return executeCreateFleet(request);
}
@SdkInternalApi
final CreateFleetResult executeCreateFleet(CreateFleetRequest createFleetRequest) {
ExecutionContext executionContext = createExecutionContext(createFleetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateFleetRequestMarshaller().marshall(super.beforeMarshalling(createFleetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFleet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new CreateFleetResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet,
* or VPC.
*
*
* Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting
* of fields that describe the traffic flow. For more information, see Flow Log
* Records in the Amazon Virtual Private Cloud User Guide.
*
*
* When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has
* a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored
* network interfaces are published to a single log file object that is stored in the specified bucket.
*
*
* For more information, see VPC
* Flow Logs in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createFlowLogsRequest
* @return Result of the CreateFlowLogs operation returned by the service.
* @sample AmazonEC2.CreateFlowLogs
* @see AWS API
* Documentation
*/
@Override
public CreateFlowLogsResult createFlowLogs(CreateFlowLogsRequest request) {
request = beforeClientExecution(request);
return executeCreateFlowLogs(request);
}
@SdkInternalApi
final CreateFlowLogsResult executeCreateFlowLogs(CreateFlowLogsRequest createFlowLogsRequest) {
ExecutionContext executionContext = createExecutionContext(createFlowLogsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateFlowLogsRequestMarshaller().marshall(super.beforeMarshalling(createFlowLogsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFlowLogs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateFlowLogsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP).
*
*
* The create operation is asynchronous. To verify that the AFI is ready for use, check the output logs.
*
*
* An AFI contains the FPGA bitstream that is ready to download to an FPGA. You can securely deploy an AFI on one or
* more FPGA-accelerated instances. For more information, see the AWS
* FPGA Hardware Development Kit.
*
*
* @param createFpgaImageRequest
* @return Result of the CreateFpgaImage operation returned by the service.
* @sample AmazonEC2.CreateFpgaImage
* @see AWS API
* Documentation
*/
@Override
public CreateFpgaImageResult createFpgaImage(CreateFpgaImageRequest request) {
request = beforeClientExecution(request);
return executeCreateFpgaImage(request);
}
@SdkInternalApi
final CreateFpgaImageResult executeCreateFpgaImage(CreateFpgaImageRequest createFpgaImageRequest) {
ExecutionContext executionContext = createExecutionContext(createFpgaImageRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateFpgaImageRequestMarshaller().marshall(super.beforeMarshalling(createFpgaImageRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFpgaImage");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateFpgaImageResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.
*
*
* If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume,
* the new AMI contains block device mapping information for those volumes. When you launch an instance from this
* new AMI, the instance automatically launches with those additional volumes.
*
*
* For more information, see Creating Amazon EBS-Backed
* Linux AMIs in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param createImageRequest
* Contains the parameters for CreateImage.
* @return Result of the CreateImage operation returned by the service.
* @sample AmazonEC2.CreateImage
* @see AWS API
* Documentation
*/
@Override
public CreateImageResult createImage(CreateImageRequest request) {
request = beforeClientExecution(request);
return executeCreateImage(request);
}
@SdkInternalApi
final CreateImageResult executeCreateImage(CreateImageRequest createImageRequest) {
ExecutionContext executionContext = createExecutionContext(createImageRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateImageRequestMarshaller().marshall(super.beforeMarshalling(createImageRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateImage");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new CreateImageResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Exports a running or stopped instance to an S3 bucket.
*
*
* For information about the supported operating systems, image formats, and known limitations for the types of
* instances you can export, see Exporting an Instance as a VM Using
* VM Import/Export in the VM Import/Export User Guide.
*
*
* @param createInstanceExportTaskRequest
* Contains the parameters for CreateInstanceExportTask.
* @return Result of the CreateInstanceExportTask operation returned by the service.
* @sample AmazonEC2.CreateInstanceExportTask
* @see AWS
* API Documentation
*/
@Override
public CreateInstanceExportTaskResult createInstanceExportTask(CreateInstanceExportTaskRequest request) {
request = beforeClientExecution(request);
return executeCreateInstanceExportTask(request);
}
@SdkInternalApi
final CreateInstanceExportTaskResult executeCreateInstanceExportTask(CreateInstanceExportTaskRequest createInstanceExportTaskRequest) {
ExecutionContext executionContext = createExecutionContext(createInstanceExportTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateInstanceExportTaskRequestMarshaller().marshall(super.beforeMarshalling(createInstanceExportTaskRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateInstanceExportTask");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateInstanceExportTaskResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using
* AttachInternetGateway.
*
*
* For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.
*
*
* @param createInternetGatewayRequest
* @return Result of the CreateInternetGateway operation returned by the service.
* @sample AmazonEC2.CreateInternetGateway
* @see AWS API
* Documentation
*/
@Override
public CreateInternetGatewayResult createInternetGateway(CreateInternetGatewayRequest request) {
request = beforeClientExecution(request);
return executeCreateInternetGateway(request);
}
@SdkInternalApi
final CreateInternetGatewayResult executeCreateInternetGateway(CreateInternetGatewayRequest createInternetGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(createInternetGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateInternetGatewayRequestMarshaller().marshall(super.beforeMarshalling(createInternetGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateInternetGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateInternetGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public CreateInternetGatewayResult createInternetGateway() {
return createInternetGateway(new CreateInternetGatewayRequest());
}
/**
*
* Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the
* private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private
* key. If a key with the specified name already exists, Amazon EC2 returns an error.
*
*
* You can have up to five thousand key pairs per region.
*
*
* The key pair returned to you is available only in the region in which you create it. If you prefer, you can
* create your own key pair using a third-party tool and upload it to any region using ImportKeyPair.
*
*
* For more information, see Key
* Pairs in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param createKeyPairRequest
* @return Result of the CreateKeyPair operation returned by the service.
* @sample AmazonEC2.CreateKeyPair
* @see AWS API
* Documentation
*/
@Override
public CreateKeyPairResult createKeyPair(CreateKeyPairRequest request) {
request = beforeClientExecution(request);
return executeCreateKeyPair(request);
}
@SdkInternalApi
final CreateKeyPairResult executeCreateKeyPair(CreateKeyPairRequest createKeyPairRequest) {
ExecutionContext executionContext = createExecutionContext(createKeyPairRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateKeyPairRequestMarshaller().marshall(super.beforeMarshalling(createKeyPairRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateKeyPair");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(new CreateKeyPairResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a launch template. A launch template contains the parameters to launch an instance. When you launch an
* instance using RunInstances, you can specify a launch template instead of providing the launch parameters
* in the request.
*
*
* @param createLaunchTemplateRequest
* @return Result of the CreateLaunchTemplate operation returned by the service.
* @sample AmazonEC2.CreateLaunchTemplate
* @see AWS API
* Documentation
*/
@Override
public CreateLaunchTemplateResult createLaunchTemplate(CreateLaunchTemplateRequest request) {
request = beforeClientExecution(request);
return executeCreateLaunchTemplate(request);
}
@SdkInternalApi
final CreateLaunchTemplateResult executeCreateLaunchTemplate(CreateLaunchTemplateRequest createLaunchTemplateRequest) {
ExecutionContext executionContext = createExecutionContext(createLaunchTemplateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateLaunchTemplateRequestMarshaller().marshall(super.beforeMarshalling(createLaunchTemplateRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLaunchTemplate");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateLaunchTemplateResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a new version for a launch template. You can specify an existing version of launch template from which to
* base the new version.
*
*
* Launch template versions are numbered in the order in which they are created. You cannot specify, change, or
* replace the numbering of launch template versions.
*
*
* @param createLaunchTemplateVersionRequest
* @return Result of the CreateLaunchTemplateVersion operation returned by the service.
* @sample AmazonEC2.CreateLaunchTemplateVersion
* @see AWS API Documentation
*/
@Override
public CreateLaunchTemplateVersionResult createLaunchTemplateVersion(CreateLaunchTemplateVersionRequest request) {
request = beforeClientExecution(request);
return executeCreateLaunchTemplateVersion(request);
}
@SdkInternalApi
final CreateLaunchTemplateVersionResult executeCreateLaunchTemplateVersion(CreateLaunchTemplateVersionRequest createLaunchTemplateVersionRequest) {
ExecutionContext executionContext = createExecutionContext(createLaunchTemplateVersionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateLaunchTemplateVersionRequestMarshaller().marshall(super.beforeMarshalling(createLaunchTemplateVersionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLaunchTemplateVersion");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateLaunchTemplateVersionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a NAT gateway in the specified public subnet. This action creates a network interface in the specified
* subnet with a private IP address from the IP address range of the subnet. Internet-bound traffic from a private
* subnet can be routed to the NAT gateway, therefore enabling instances in the private subnet to connect to the
* internet. For more information, see NAT Gateways in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param createNatGatewayRequest
* @return Result of the CreateNatGateway operation returned by the service.
* @sample AmazonEC2.CreateNatGateway
* @see AWS API
* Documentation
*/
@Override
public CreateNatGatewayResult createNatGateway(CreateNatGatewayRequest request) {
request = beforeClientExecution(request);
return executeCreateNatGateway(request);
}
@SdkInternalApi
final CreateNatGatewayResult executeCreateNatGateway(CreateNatGatewayRequest createNatGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(createNatGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateNatGatewayRequestMarshaller().marshall(super.beforeMarshalling(createNatGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNatGateway");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateNatGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security
* groups) for the instances in your VPC.
*
*
* For more information, see Network
* ACLs in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createNetworkAclRequest
* @return Result of the CreateNetworkAcl operation returned by the service.
* @sample AmazonEC2.CreateNetworkAcl
* @see AWS API
* Documentation
*/
@Override
public CreateNetworkAclResult createNetworkAcl(CreateNetworkAclRequest request) {
request = beforeClientExecution(request);
return executeCreateNetworkAcl(request);
}
@SdkInternalApi
final CreateNetworkAclResult executeCreateNetworkAcl(CreateNetworkAclRequest createNetworkAclRequest) {
ExecutionContext executionContext = createExecutionContext(createNetworkAclRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateNetworkAclRequestMarshaller().marshall(super.beforeMarshalling(createNetworkAclRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNetworkAcl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateNetworkAclResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered
* ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in
* or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in
* ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules.
*
*
* We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them
* one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing
* ones without having to renumber the rules.
*
*
* After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old
* one.
*
*
* For more information about network ACLs, see Network ACLs in the Amazon
* Virtual Private Cloud User Guide.
*
*
* @param createNetworkAclEntryRequest
* @return Result of the CreateNetworkAclEntry operation returned by the service.
* @sample AmazonEC2.CreateNetworkAclEntry
* @see AWS API
* Documentation
*/
@Override
public CreateNetworkAclEntryResult createNetworkAclEntry(CreateNetworkAclEntryRequest request) {
request = beforeClientExecution(request);
return executeCreateNetworkAclEntry(request);
}
@SdkInternalApi
final CreateNetworkAclEntryResult executeCreateNetworkAclEntry(CreateNetworkAclEntryRequest createNetworkAclEntryRequest) {
ExecutionContext executionContext = createExecutionContext(createNetworkAclEntryRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateNetworkAclEntryRequestMarshaller().marshall(super.beforeMarshalling(createNetworkAclEntryRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNetworkAclEntry");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateNetworkAclEntryResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a network interface in the specified subnet.
*
*
* For more information about network interfaces, see Elastic Network Interfaces in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param createNetworkInterfaceRequest
* Contains the parameters for CreateNetworkInterface.
* @return Result of the CreateNetworkInterface operation returned by the service.
* @sample AmazonEC2.CreateNetworkInterface
* @see AWS API
* Documentation
*/
@Override
public CreateNetworkInterfaceResult createNetworkInterface(CreateNetworkInterfaceRequest request) {
request = beforeClientExecution(request);
return executeCreateNetworkInterface(request);
}
@SdkInternalApi
final CreateNetworkInterfaceResult executeCreateNetworkInterface(CreateNetworkInterfaceRequest createNetworkInterfaceRequest) {
ExecutionContext executionContext = createExecutionContext(createNetworkInterfaceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateNetworkInterfaceRequestMarshaller().marshall(super.beforeMarshalling(createNetworkInterfaceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNetworkInterface");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateNetworkInterfaceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Grants an AWS-authorized account permission to attach the specified network interface to an instance in their
* account.
*
*
* You can grant permission to a single AWS account only, and only one account at a time.
*
*
* @param createNetworkInterfacePermissionRequest
* Contains the parameters for CreateNetworkInterfacePermission.
* @return Result of the CreateNetworkInterfacePermission operation returned by the service.
* @sample AmazonEC2.CreateNetworkInterfacePermission
* @see AWS API Documentation
*/
@Override
public CreateNetworkInterfacePermissionResult createNetworkInterfacePermission(CreateNetworkInterfacePermissionRequest request) {
request = beforeClientExecution(request);
return executeCreateNetworkInterfacePermission(request);
}
@SdkInternalApi
final CreateNetworkInterfacePermissionResult executeCreateNetworkInterfacePermission(
CreateNetworkInterfacePermissionRequest createNetworkInterfacePermissionRequest) {
ExecutionContext executionContext = createExecutionContext(createNetworkInterfacePermissionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateNetworkInterfacePermissionRequestMarshaller().marshall(super.beforeMarshalling(createNetworkInterfacePermissionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNetworkInterfacePermission");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateNetworkInterfacePermissionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a placement group in which to launch instances. The strategy of the placement group determines how the
* instances are organized within the group.
*
*
* A cluster
placement group is a logical grouping of instances within a single Availability Zone that
* benefit from low network latency, high network throughput. A spread
placement group places instances
* on distinct hardware. A partition
placement group places groups of instances in different
* partitions, where instances in one partition do not share the same hardware with instances in another partition.
*
*
* For more information, see Placement Groups in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @param createPlacementGroupRequest
* @return Result of the CreatePlacementGroup operation returned by the service.
* @sample AmazonEC2.CreatePlacementGroup
* @see AWS API
* Documentation
*/
@Override
public CreatePlacementGroupResult createPlacementGroup(CreatePlacementGroupRequest request) {
request = beforeClientExecution(request);
return executeCreatePlacementGroup(request);
}
@SdkInternalApi
final CreatePlacementGroupResult executeCreatePlacementGroup(CreatePlacementGroupRequest createPlacementGroupRequest) {
ExecutionContext executionContext = createExecutionContext(createPlacementGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreatePlacementGroupRequestMarshaller().marshall(super.beforeMarshalling(createPlacementGroupRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePlacementGroup");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreatePlacementGroupResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in the Reserved Instance Marketplace. You
* can submit one Standard Reserved Instance listing at a time. To get a list of your Standard Reserved Instances,
* you can use the