
com.amazonaws.services.ec2.AmazonEC2Client Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2010-2016 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 java.util.Map.Entry;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
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.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 resizable computing
* capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates
* your need to invest in hardware up front, so you can develop and deploy
* applications faster.
*
*/
@ThreadSafe
public class AmazonEC2Client extends AmazonWebServiceClient implements
AmazonEC2 {
/** Provider for AWS credentials. */
private 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";
/** The region metadata service name for computing region endpoints. */
private static final String DEFAULT_ENDPOINT_PREFIX = "ec2";
/**
* Client configuration factory providing ClientConfigurations tailored to
* this client
*/
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
/**
* 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
*/
public AmazonEC2Client() {
this(new DefaultAWSCredentialsProviderChain(), 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
*/
public AmazonEC2Client(ClientConfiguration clientConfiguration) {
this(new DefaultAWSCredentialsProviderChain(), 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.
*/
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.).
*/
public AmazonEC2Client(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(
awsCredentials);
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.
*/
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.).
*/
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
*/
public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) {
super(clientConfiguration, requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
init();
}
private void init() {
exceptionUnmarshallers.add(new LegacyErrorUnmarshaller());
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(DEFAULT_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"));
}
/**
*
* 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 the
* DescribeVpcPeeringConnections
request to view your
* outstanding VPC peering connection requests.
*
*
* @param acceptVpcPeeringConnectionRequest
* Contains the parameters for AcceptVpcPeeringConnection.
* @return Result of the AcceptVpcPeeringConnection operation returned by
* the service.
* @sample AmazonEC2.AcceptVpcPeeringConnection
*/
@Override
public AcceptVpcPeeringConnectionResult acceptVpcPeeringConnection(
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);
} 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());
}
/**
*
* Acquires an Elastic IP address.
*
*
* An Elastic IP address is for use either in the EC2-Classic platform or in
* a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* @param allocateAddressRequest
* Contains the parameters for AllocateAddress.
* @return Result of the AllocateAddress operation returned by the service.
* @sample AmazonEC2.AllocateAddress
*/
@Override
public AllocateAddressResult allocateAddress(
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);
} 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 minimum you need to
* specify the instance size type, Availability Zone, and quantity of hosts
* you want to allocate.
*
*
* @param allocateHostsRequest
* Contains the parameters for AllocateHosts.
* @return Result of the AllocateHosts operation returned by the service.
* @sample AmazonEC2.AllocateHosts
*/
@Override
public AllocateHostsResult allocateHosts(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AllocateHostsResultStaxUnmarshaller());
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.
*
*
* AssignPrivateIpAddresses is available only in EC2-VPC.
*
*
* @param assignPrivateIpAddressesRequest
* Contains the parameters for AssignPrivateIpAddresses.
* @return Result of the AssignPrivateIpAddresses operation returned by the
* service.
* @sample AmazonEC2.AssignPrivateIpAddresses
*/
@Override
public AssignPrivateIpAddressesResult assignPrivateIpAddresses(
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);
} 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.
*
*
* 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.
*
*
* [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.
*
*
* This is an idempotent operation. If you perform the operation more than
* once, Amazon EC2 doesn't return an error.
*
*
* @param associateAddressRequest
* Contains the parameters for AssociateAddress.
* @return Result of the AssociateAddress operation returned by the service.
* @sample AmazonEC2.AssociateAddress
*/
@Override
public AssociateAddressResult associateAddress(
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);
} 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 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
* Contains the parameters for AssociateDhcpOptions.
* @return Result of the AssociateDhcpOptions operation returned by the
* service.
* @sample AmazonEC2.AssociateDhcpOptions
*/
@Override
public AssociateDhcpOptionsResult associateDhcpOptions(
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);
} 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 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 about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.
*
*
* @param associateRouteTableRequest
* Contains the parameters for AssociateRouteTable.
* @return Result of the AssociateRouteTable operation returned by the
* service.
* @sample AmazonEC2.AssociateRouteTable
*/
@Override
public AssociateRouteTableResult associateRouteTable(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AssociateRouteTableResultStaxUnmarshaller());
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
* Contains the parameters for AttachClassicLinkVpc.
* @return Result of the AttachClassicLinkVpc operation returned by the
* service.
* @sample AmazonEC2.AttachClassicLinkVpc
*/
@Override
public AttachClassicLinkVpcResult attachClassicLinkVpc(
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);
} 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
* Contains the parameters for AttachInternetGateway.
* @return Result of the AttachInternetGateway operation returned by the
* service.
* @sample AmazonEC2.AttachInternetGateway
*/
@Override
public AttachInternetGatewayResult attachInternetGateway(
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);
} 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
*/
@Override
public AttachNetworkInterfaceResult attachNetworkInterface(
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);
} 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 an overview of the AWS Marketplace, see Introducing AWS
* Marketplace.
*
*
* 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
*/
@Override
public AttachVolumeResult attachVolume(
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);
} 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. For more information, see
* Adding a Hardware Virtual Private Gateway to Your VPC in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param attachVpnGatewayRequest
* Contains the parameters for AttachVpnGateway.
* @return Result of the AttachVpnGateway operation returned by the service.
* @sample AmazonEC2.AttachVpnGateway
*/
@Override
public AttachVpnGatewayResult attachVpnGateway(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new AttachVpnGatewayResultStaxUnmarshaller());
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 CIDR IP 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.
*
*
*
* You can have up to 50 rules per security group (covering both ingress and
* egress rules).
*
*
*
* 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.
*
*
* Rule changes are propagated to affected instances as quickly as possible.
* However, a small delay might occur.
*
*
* @param authorizeSecurityGroupEgressRequest
* Contains the parameters for AuthorizeSecurityGroupEgress.
* @return Result of the AuthorizeSecurityGroupEgress operation returned by
* the service.
* @sample AmazonEC2.AuthorizeSecurityGroupEgress
*/
@Override
public AuthorizeSecurityGroupEgressResult authorizeSecurityGroupEgress(
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);
} 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.
*
*
*
* EC2-Classic: You can have up to 100 rules per group.
*
*
* EC2-VPC: You can have up to 50 rules per group (covering both ingress and
* egress rules).
*
*
*
* 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 CIDR IP 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.
*
*
* [EC2-VPC] This action gives one or more CIDR IP 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.
*
*
* @param authorizeSecurityGroupIngressRequest
* Contains the parameters for AuthorizeSecurityGroupIngress.
* @return Result of the AuthorizeSecurityGroupIngress operation returned by
* the service.
* @sample AmazonEC2.AuthorizeSecurityGroupIngress
*/
@Override
public AuthorizeSecurityGroupIngressResult authorizeSecurityGroupIngress(
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);
} 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.
*
*
*
* For more information, see Creating an Instance Store-Backed Windows AMI.
*
*
* @param bundleInstanceRequest
* Contains the parameters for BundleInstance.
* @return Result of the BundleInstance operation returned by the service.
* @sample AmazonEC2.BundleInstance
*/
@Override
public BundleInstanceResult bundleInstance(
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);
} 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
*/
@Override
public CancelBundleTaskResult cancelBundleTask(
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);
} 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 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 Using the Command Line Tools to Import Your Virtual Machine to Amazon
* EC2 in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param cancelConversionTaskRequest
* Contains the parameters for CancelConversionTask.
* @return Result of the CancelConversionTask operation returned by the
* service.
* @sample AmazonEC2.CancelConversionTask
*/
@Override
public CancelConversionTaskResult cancelConversionTask(
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);
} 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
*/
@Override
public CancelExportTaskResult cancelExportTask(
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);
} 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
*/
@Override
public CancelImportTaskResult cancelImportTask(
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);
} 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
*/
@Override
public CancelReservedInstancesListingResult cancelReservedInstancesListing(
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);
} 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
*/
@Override
public CancelSpotFleetRequestsResult cancelSpotFleetRequests(
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);
} 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. Spot instances are instances
* that Amazon EC2 starts on your behalf when the bid price that you specify
* exceeds the current Spot price. Amazon EC2 periodically sets the Spot
* price based on available Spot instance capacity and current Spot instance
* requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User
* Guide.
*
*
*
* 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
*/
@Override
public CancelSpotInstanceRequestsResult cancelSpotInstanceRequests(
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);
} 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 needs to verify whether another user's instance
* is eligible for support.
*
*
* @param confirmProductInstanceRequest
* Contains the parameters for ConfirmProductInstance.
* @return Result of the ConfirmProductInstance operation returned by the
* service.
* @sample AmazonEC2.ConfirmProductInstance
*/
@Override
public ConfirmProductInstanceResult confirmProductInstance(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new ConfirmProductInstanceResultStaxUnmarshaller());
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.
*
*
* For more information, see Copying AMIs 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
*/
@Override
public CopyImageResult copyImage(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);
} 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.
*
*
* 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
*/
@Override
public CopySnapshotResult copySnapshot(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CopySnapshotResultStaxUnmarshaller());
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 about VPN customer gateways, see Adding a Hardware Virtual Private Gateway to Your VPC in the
* Amazon Virtual Private Cloud 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
*/
@Override
public CreateCustomerGatewayResult createCustomerGateway(
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);
} 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 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.
*
*
* -
*
* 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"). 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 about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User
* Guide.
*
*
* @param createDhcpOptionsRequest
* Contains the parameters for CreateDhcpOptions.
* @return Result of the CreateDhcpOptions operation returned by the
* service.
* @sample AmazonEC2.CreateDhcpOptions
*/
@Override
public CreateDhcpOptionsResult createDhcpOptions(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateDhcpOptionsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates one or more flow logs to capture IP traffic for a specific
* network interface, subnet, or VPC. Flow logs are delivered to a specified
* log group in Amazon CloudWatch Logs. If you specify a VPC or subnet in
* the request, a log stream is created in CloudWatch Logs for each network
* interface in the subnet or VPC. Log streams can include information about
* accepted and rejected traffic to a network interface. You can view the
* data in your log streams using Amazon CloudWatch Logs.
*
*
* In your request, you must also specify an IAM role that has permission to
* publish logs to CloudWatch Logs.
*
*
* @param createFlowLogsRequest
* Contains the parameters for CreateFlowLogs.
* @return Result of the CreateFlowLogs operation returned by the service.
* @sample AmazonEC2.CreateFlowLogs
*/
@Override
public CreateFlowLogsResult createFlowLogs(
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);
} 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 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
*/
@Override
public CreateImageResult createImage(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);
} 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 EC2 Instances in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* @param createInstanceExportTaskRequest
* Contains the parameters for CreateInstanceExportTask.
* @return Result of the CreateInstanceExportTask operation returned by the
* service.
* @sample AmazonEC2.CreateInstanceExportTask
*/
@Override
public CreateInstanceExportTaskResult createInstanceExportTask(
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);
} 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
* Contains the parameters for CreateInternetGateway.
* @return Result of the CreateInternetGateway operation returned by the
* service.
* @sample AmazonEC2.CreateInternetGateway
*/
@Override
public CreateInternetGatewayResult createInternetGateway(
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);
} 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#8
* 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. To create a key pair that is available in all regions, use
* ImportKeyPair.
*
*
* For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param createKeyPairRequest
* Contains the parameters for CreateKeyPair.
* @return Result of the CreateKeyPair operation returned by the service.
* @sample AmazonEC2.CreateKeyPair
*/
@Override
public CreateKeyPairResult createKeyPair(
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);
} 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 NAT gateway in the specified subnet. A NAT gateway can be used
* to enable instances in a private subnet to connect to the Internet. This
* action creates a network interface in the specified subnet with a private
* IP address from the IP address range of the subnet. For more information,
* see NAT Gateways in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createNatGatewayRequest
* Contains the parameters for CreateNatGateway.
* @return Result of the CreateNatGateway operation returned by the service.
* @sample AmazonEC2.CreateNatGateway
*/
@Override
public CreateNatGatewayResult createNatGateway(
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);
} 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 about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createNetworkAclRequest
* Contains the parameters for CreateNetworkAcl.
* @return Result of the CreateNetworkAcl operation returned by the service.
* @sample AmazonEC2.CreateNetworkAcl
*/
@Override
public CreateNetworkAclResult createNetworkAcl(
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);
} 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
* Contains the parameters for CreateNetworkAclEntry.
* @return Result of the CreateNetworkAclEntry operation returned by the
* service.
* @sample AmazonEC2.CreateNetworkAclEntry
*/
@Override
public CreateNetworkAclEntryResult createNetworkAclEntry(
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);
} 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 Elastic Compute Cloud
* User Guide.
*
*
* @param createNetworkInterfaceRequest
* Contains the parameters for CreateNetworkInterface.
* @return Result of the CreateNetworkInterface operation returned by the
* service.
* @sample AmazonEC2.CreateNetworkInterface
*/
@Override
public CreateNetworkInterfaceResult createNetworkInterface(
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);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateNetworkInterfaceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a placement group that you launch cluster instances into. You
* must give the group a name that's unique within the scope of your
* account.
*
*
* For more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* @param createPlacementGroupRequest
* Contains the parameters for CreatePlacementGroup.
* @return Result of the CreatePlacementGroup operation returned by the
* service.
* @sample AmazonEC2.CreatePlacementGroup
*/
@Override
public CreatePlacementGroupResult createPlacementGroup(
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);
} 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 Reserved Instances to be sold in the
* Reserved Instance Marketplace. You can submit one Reserved Instance
* listing at a time. To get a list of your Reserved Instances, you can use
* the DescribeReservedInstances operation.
*
*
* The Reserved Instance Marketplace matches sellers who want to resell
* Reserved Instance capacity that they no longer need with buyers who want
* to purchase additional capacity. Reserved Instances bought and sold
* through the Reserved Instance Marketplace work like any other Reserved
* Instances.
*
*
* To sell your Reserved Instances, you must first register as a seller in
* the Reserved Instance Marketplace. After completing the registration
* process, you can create a Reserved Instance Marketplace listing of some
* or all of your Reserved Instances, and specify the upfront price to
* receive for them. Your Reserved Instance listings then become available
* for purchase. To view the details of your Reserved Instance listing, you
* can use the DescribeReservedInstancesListings operation.
*
*
* For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud
* User Guide.
*
*
* @param createReservedInstancesListingRequest
* Contains the parameters for CreateReservedInstancesListing.
* @return Result of the CreateReservedInstancesListing operation returned
* by the service.
* @sample AmazonEC2.CreateReservedInstancesListing
*/
@Override
public CreateReservedInstancesListingResult createReservedInstancesListing(
CreateReservedInstancesListingRequest createReservedInstancesListingRequest) {
ExecutionContext executionContext = createExecutionContext(createReservedInstancesListingRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateReservedInstancesListingRequestMarshaller()
.marshall(super
.beforeMarshalling(createReservedInstancesListingRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateReservedInstancesListingResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a route in a route table within a VPC.
*
*
* You must specify one of the following targets: Internet gateway or
* virtual private gateway, NAT instance, NAT gateway, VPC peering
* connection, or network interface.
*
*
* When determining how to route traffic, we use the route with the most
* specific match. For example, let's say the traffic is destined for
* 192.0.2.3
, and the route table includes the following two
* routes:
*
*
* -
*
* 192.0.2.0/24
(goes to some target A)
*
*
* -
*
* 192.0.2.0/28
(goes to some target B)
*
*
*
*
* Both routes apply to the traffic destined for 192.0.2.3
.
* However, the second route in the list covers a smaller number of IP
* addresses and is therefore more specific, so we use that route to
* determine where to target the traffic.
*
*
* For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createRouteRequest
* Contains the parameters for CreateRoute.
* @return Result of the CreateRoute operation returned by the service.
* @sample AmazonEC2.CreateRoute
*/
@Override
public CreateRouteResult createRoute(CreateRouteRequest createRouteRequest) {
ExecutionContext executionContext = createExecutionContext(createRouteRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateRouteRequestMarshaller().marshall(super
.beforeMarshalling(createRouteRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateRouteResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a route table for the specified VPC. After you create a route
* table, you can add routes and associate the table with a subnet.
*
*
* For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.
*
*
* @param createRouteTableRequest
* Contains the parameters for CreateRouteTable.
* @return Result of the CreateRouteTable operation returned by the service.
* @sample AmazonEC2.CreateRouteTable
*/
@Override
public CreateRouteTableResult createRouteTable(
CreateRouteTableRequest createRouteTableRequest) {
ExecutionContext executionContext = createExecutionContext(createRouteTableRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateRouteTableRequestMarshaller()
.marshall(super
.beforeMarshalling(createRouteTableRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateRouteTableResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a security group.
*
*
* A security group is for use with instances either in the EC2-Classic
* platform or in a specific VPC. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud
* User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud
* User Guide.
*
*
*
* EC2-Classic: You can have up to 500 security groups.
*
*
* EC2-VPC: You can create up to 500 security groups per VPC.
*
*
*
* When you create a security group, you specify a friendly name of your
* choice. You can have a security group for use in EC2-Classic with the
* same name as a security group for use in a VPC. However, you can't have
* two security groups for use in EC2-Classic with the same name or two
* security groups for use in a VPC with the same name.
*
*
* You have a default security group for use in EC2-Classic and a default
* security group for use in your VPC. If you don't specify a security group
* when you launch an instance, the instance is launched into the
* appropriate default security group. A default security group includes a
* default rule that grants instances unrestricted network access to each
* other.
*
*
* You can add or remove rules from your security groups using
* AuthorizeSecurityGroupIngress,
* AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress,
* and RevokeSecurityGroupEgress.
*
*
* @param createSecurityGroupRequest
* Contains the parameters for CreateSecurityGroup.
* @return Result of the CreateSecurityGroup operation returned by the
* service.
* @sample AmazonEC2.CreateSecurityGroup
*/
@Override
public CreateSecurityGroupResult createSecurityGroup(
CreateSecurityGroupRequest createSecurityGroupRequest) {
ExecutionContext executionContext = createExecutionContext(createSecurityGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateSecurityGroupRequestMarshaller()
.marshall(super
.beforeMarshalling(createSecurityGroupRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateSecurityGroupResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a snapshot of an EBS volume and stores it in Amazon S3. You can
* use snapshots for backups, to make copies of EBS volumes, and to save
* data before shutting down an instance.
*
*
* When a snapshot is created, any AWS Marketplace product codes that are
* associated with the source volume are propagated to the snapshot.
*
*
* You can take a snapshot of an attached volume that is in use. However,
* snapshots only capture data that has been written to your EBS volume at
* the time the snapshot command is issued; this may exclude any data that
* has been cached by any applications or the operating system. If you can
* pause any file systems on the volume long enough to take a snapshot, your
* snapshot should be complete. However, if you cannot pause all file writes
* to the volume, you should unmount the volume from within the instance,
* issue the snapshot command, and then remount the volume to ensure a
* consistent and complete snapshot. You may remount and use your volume
* while the snapshot status is pending
.
*
*
* To create a snapshot for EBS volumes that serve as root devices, you
* should stop the instance before taking the snapshot.
*
*
* Snapshots that are taken from encrypted volumes are automatically
* encrypted. Volumes that are created from encrypted snapshots are also
* automatically encrypted. Your encrypted volumes and any associated
* snapshots always remain protected.
*
*
* For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* @param createSnapshotRequest
* Contains the parameters for CreateSnapshot.
* @return Result of the CreateSnapshot operation returned by the service.
* @sample AmazonEC2.CreateSnapshot
*/
@Override
public CreateSnapshotResult createSnapshot(
CreateSnapshotRequest createSnapshotRequest) {
ExecutionContext executionContext = createExecutionContext(createSnapshotRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateSnapshotRequestMarshaller().marshall(super
.beforeMarshalling(createSnapshotRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateSnapshotResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a data feed for Spot instances, enabling you to view Spot
* instance usage logs. You can create one data feed per AWS account. For
* more information, see Spot Instance Data Feed in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* @param createSpotDatafeedSubscriptionRequest
* Contains the parameters for CreateSpotDatafeedSubscription.
* @return Result of the CreateSpotDatafeedSubscription operation returned
* by the service.
* @sample AmazonEC2.CreateSpotDatafeedSubscription
*/
@Override
public CreateSpotDatafeedSubscriptionResult createSpotDatafeedSubscription(
CreateSpotDatafeedSubscriptionRequest createSpotDatafeedSubscriptionRequest) {
ExecutionContext executionContext = createExecutionContext(createSpotDatafeedSubscriptionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateSpotDatafeedSubscriptionRequestMarshaller()
.marshall(super
.beforeMarshalling(createSpotDatafeedSubscriptionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateSpotDatafeedSubscriptionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a subnet in an existing VPC.
*
*
* When you create each subnet, you provide the VPC ID and the CIDR block
* you want for the subnet. After you create a subnet, you can't change its
* CIDR block. The subnet's CIDR block can be the same as the VPC's CIDR
* block (assuming you want only a single subnet in the VPC), or a subset of
* the VPC's CIDR block. If you create more than one subnet in a VPC, the
* subnets' CIDR blocks must not overlap. The smallest subnet (and VPC) you
* can create uses a /28 netmask (16 IP addresses), and the largest uses a
* /16 netmask (65,536 IP addresses).
*
*
*
* AWS reserves both the first four and the last IP address in each subnet's
* CIDR block. They're not available for use.
*
*
*
* If you add more than one subnet to a VPC, they're set up in a star
* topology with a logical router in the middle.
*
*
* If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP
* address doesn't change if you stop and restart the instance (unlike a
* similar instance launched outside a VPC, which gets a new IP address when
* restarted). It's therefore possible to have a subnet with no running
* instances (they're all stopped), but no remaining IP addresses available.
*
*
* For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User
* Guide.
*
*
* @param createSubnetRequest
* Contains the parameters for CreateSubnet.
* @return Result of the CreateSubnet operation returned by the service.
* @sample AmazonEC2.CreateSubnet
*/
@Override
public CreateSubnetResult createSubnet(
CreateSubnetRequest createSubnetRequest) {
ExecutionContext executionContext = createExecutionContext(createSubnetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateSubnetRequestMarshaller().marshall(super
.beforeMarshalling(createSubnetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateSubnetResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds or overwrites one or more tags for the specified Amazon EC2 resource
* or resources. Each resource can have a maximum of 10 tags. Each tag
* consists of a key and optional value. Tag keys must be unique per
* resource.
*
*
* For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User
* Guide. For more information about creating IAM policies that control
* users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in
* the Amazon Elastic Compute Cloud User Guide.
*
*
* @param createTagsRequest
* Contains the parameters for CreateTags.
* @return Result of the CreateTags operation returned by the service.
* @sample AmazonEC2.CreateTags
*/
@Override
public CreateTagsResult createTags(CreateTagsRequest createTagsRequest) {
ExecutionContext executionContext = createExecutionContext(createTagsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateTagsRequestMarshaller().marshall(super
.beforeMarshalling(createTagsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateTagsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an EBS volume that can be attached to an instance in the same
* Availability Zone. The volume is created in the regional endpoint that
* you send the HTTP request to. For more information see Regions
* and Endpoints.
*
*
* You can create a new empty volume or restore a volume from an EBS
* snapshot. Any AWS Marketplace product codes from the snapshot are
* propagated to the volume.
*
*
* You can create encrypted volumes with the Encrypted
* parameter. Encrypted volumes may only be attached to instances that
* support Amazon EBS encryption. Volumes that are created from encrypted
* snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* For more information, see Creating or Restoring an Amazon EBS Volume in the Amazon Elastic
* Compute Cloud User Guide.
*
*
* @param createVolumeRequest
* Contains the parameters for CreateVolume.
* @return Result of the CreateVolume operation returned by the service.
* @sample AmazonEC2.CreateVolume
*/
@Override
public CreateVolumeResult createVolume(
CreateVolumeRequest createVolumeRequest) {
ExecutionContext executionContext = createExecutionContext(createVolumeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVolumeRequestMarshaller().marshall(super
.beforeMarshalling(createVolumeRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVolumeResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a VPC with the specified CIDR block.
*
*
* The smallest VPC you can create uses a /28 netmask (16 IP addresses), and
* the largest uses a /16 netmask (65,536 IP addresses). To help you decide
* how big to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User
* Guide.
*
*
* By default, each instance you launch in the VPC has the default DHCP
* options, which includes only a default DNS server that we provide
* (AmazonProvidedDNS). For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User
* Guide.
*
*
* You can specify the instance tenancy value for the VPC when you create
* it. You can't change this value for the VPC after you create it. For more
* information, see Dedicated Instances in the Amazon Virtual Private Cloud User
* Guide.
*
*
* @param createVpcRequest
* Contains the parameters for CreateVpc.
* @return Result of the CreateVpc operation returned by the service.
* @sample AmazonEC2.CreateVpc
*/
@Override
public CreateVpcResult createVpc(CreateVpcRequest createVpcRequest) {
ExecutionContext executionContext = createExecutionContext(createVpcRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVpcRequestMarshaller().marshall(super
.beforeMarshalling(createVpcRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVpcResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a VPC endpoint for a specified AWS service. An endpoint enables
* you to create a private connection between your VPC and another AWS
* service in your account. You can specify an endpoint policy to attach to
* the endpoint that will control access to the service from your VPC. You
* can also specify the VPC route tables that use the endpoint.
*
*
* Currently, only endpoints to Amazon S3 are supported.
*
*
* @param createVpcEndpointRequest
* Contains the parameters for CreateVpcEndpoint.
* @return Result of the CreateVpcEndpoint operation returned by the
* service.
* @sample AmazonEC2.CreateVpcEndpoint
*/
@Override
public CreateVpcEndpointResult createVpcEndpoint(
CreateVpcEndpointRequest createVpcEndpointRequest) {
ExecutionContext executionContext = createExecutionContext(createVpcEndpointRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVpcEndpointRequestMarshaller()
.marshall(super
.beforeMarshalling(createVpcEndpointRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVpcEndpointResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Requests a VPC peering connection between two VPCs: a requester VPC that
* you own and a peer VPC with which to create the connection. The peer VPC
* can belong to another AWS account. The requester VPC and peer VPC cannot
* have overlapping CIDR blocks.
*
*
* The owner of the peer VPC must accept the peering request to activate the
* peering connection. The VPC peering connection request expires after 7
* days, after which it cannot be accepted or rejected.
*
*
* A CreateVpcPeeringConnection
request between VPCs with
* overlapping CIDR blocks results in the VPC peering connection having a
* status of failed
.
*
*
* @param createVpcPeeringConnectionRequest
* Contains the parameters for CreateVpcPeeringConnection.
* @return Result of the CreateVpcPeeringConnection operation returned by
* the service.
* @sample AmazonEC2.CreateVpcPeeringConnection
*/
@Override
public CreateVpcPeeringConnectionResult createVpcPeeringConnection(
CreateVpcPeeringConnectionRequest createVpcPeeringConnectionRequest) {
ExecutionContext executionContext = createExecutionContext(createVpcPeeringConnectionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVpcPeeringConnectionRequestMarshaller()
.marshall(super
.beforeMarshalling(createVpcPeeringConnectionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVpcPeeringConnectionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public CreateVpcPeeringConnectionResult createVpcPeeringConnection() {
return createVpcPeeringConnection(new CreateVpcPeeringConnectionRequest());
}
/**
*
* Creates a VPN connection between an existing virtual private gateway and
* a VPN customer gateway. The only supported connection type is
* ipsec.1
.
*
*
* The response includes information that you need to give to your network
* administrator to configure your customer gateway.
*
*
*
* We strongly recommend that you use HTTPS when calling this operation
* because the response contains sensitive cryptographic information for
* configuring your customer gateway.
*
*
*
* If you decide to shut down your VPN connection for any reason and later
* create a new VPN connection, you must reconfigure your customer gateway
* with the new information returned from this call.
*
*
* This is an idempotent operation. If you perform the operation more than
* once, Amazon EC2 doesn't return an error.
*
*
* For more information about VPN connections, see Adding a Hardware Virtual Private Gateway to Your VPC in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param createVpnConnectionRequest
* Contains the parameters for CreateVpnConnection.
* @return Result of the CreateVpnConnection operation returned by the
* service.
* @sample AmazonEC2.CreateVpnConnection
*/
@Override
public CreateVpnConnectionResult createVpnConnection(
CreateVpnConnectionRequest createVpnConnectionRequest) {
ExecutionContext executionContext = createExecutionContext(createVpnConnectionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVpnConnectionRequestMarshaller()
.marshall(super
.beforeMarshalling(createVpnConnectionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVpnConnectionResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a static route associated with a VPN connection between an
* existing virtual private gateway and a VPN customer gateway. The static
* route allows traffic to be routed from the virtual private gateway to the
* VPN customer gateway.
*
*
* For more information about VPN connections, see Adding a Hardware Virtual Private Gateway to Your VPC in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param createVpnConnectionRouteRequest
* Contains the parameters for CreateVpnConnectionRoute.
* @return Result of the CreateVpnConnectionRoute operation returned by the
* service.
* @sample AmazonEC2.CreateVpnConnectionRoute
*/
@Override
public CreateVpnConnectionRouteResult createVpnConnectionRoute(
CreateVpnConnectionRouteRequest createVpnConnectionRouteRequest) {
ExecutionContext executionContext = createExecutionContext(createVpnConnectionRouteRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVpnConnectionRouteRequestMarshaller()
.marshall(super
.beforeMarshalling(createVpnConnectionRouteRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVpnConnectionRouteResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a virtual private gateway. A virtual private gateway is the
* endpoint on the VPC side of your VPN connection. You can create a virtual
* private gateway before creating the VPC itself.
*
*
* For more information about virtual private gateways, see Adding a Hardware Virtual Private Gateway to Your VPC in the
* Amazon Virtual Private Cloud User Guide.
*
*
* @param createVpnGatewayRequest
* Contains the parameters for CreateVpnGateway.
* @return Result of the CreateVpnGateway operation returned by the service.
* @sample AmazonEC2.CreateVpnGateway
*/
@Override
public CreateVpnGatewayResult createVpnGateway(
CreateVpnGatewayRequest createVpnGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(createVpnGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateVpnGatewayRequestMarshaller()
.marshall(super
.beforeMarshalling(createVpnGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new CreateVpnGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified customer gateway. You must delete the VPN
* connection before you can delete the customer gateway.
*
*
* @param deleteCustomerGatewayRequest
* Contains the parameters for DeleteCustomerGateway.
* @return Result of the DeleteCustomerGateway operation returned by the
* service.
* @sample AmazonEC2.DeleteCustomerGateway
*/
@Override
public DeleteCustomerGatewayResult deleteCustomerGateway(
DeleteCustomerGatewayRequest deleteCustomerGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(deleteCustomerGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteCustomerGatewayRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteCustomerGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteCustomerGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified set of DHCP options. You must disassociate the set
* of DHCP options before you can delete it. You can disassociate the set of
* DHCP options by associating either a new set of options or the default
* set of options with the VPC.
*
*
* @param deleteDhcpOptionsRequest
* Contains the parameters for DeleteDhcpOptions.
* @return Result of the DeleteDhcpOptions operation returned by the
* service.
* @sample AmazonEC2.DeleteDhcpOptions
*/
@Override
public DeleteDhcpOptionsResult deleteDhcpOptions(
DeleteDhcpOptionsRequest deleteDhcpOptionsRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDhcpOptionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDhcpOptionsRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteDhcpOptionsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteDhcpOptionsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes one or more flow logs.
*
*
* @param deleteFlowLogsRequest
* Contains the parameters for DeleteFlowLogs.
* @return Result of the DeleteFlowLogs operation returned by the service.
* @sample AmazonEC2.DeleteFlowLogs
*/
@Override
public DeleteFlowLogsResult deleteFlowLogs(
DeleteFlowLogsRequest deleteFlowLogsRequest) {
ExecutionContext executionContext = createExecutionContext(deleteFlowLogsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteFlowLogsRequestMarshaller().marshall(super
.beforeMarshalling(deleteFlowLogsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteFlowLogsResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified Internet gateway. You must detach the Internet
* gateway from the VPC before you can delete it.
*
*
* @param deleteInternetGatewayRequest
* Contains the parameters for DeleteInternetGateway.
* @return Result of the DeleteInternetGateway operation returned by the
* service.
* @sample AmazonEC2.DeleteInternetGateway
*/
@Override
public DeleteInternetGatewayResult deleteInternetGateway(
DeleteInternetGatewayRequest deleteInternetGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(deleteInternetGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteInternetGatewayRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteInternetGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteInternetGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified key pair, by removing the public key from Amazon
* EC2.
*
*
* @param deleteKeyPairRequest
* Contains the parameters for DeleteKeyPair.
* @return Result of the DeleteKeyPair operation returned by the service.
* @sample AmazonEC2.DeleteKeyPair
*/
@Override
public DeleteKeyPairResult deleteKeyPair(
DeleteKeyPairRequest deleteKeyPairRequest) {
ExecutionContext executionContext = createExecutionContext(deleteKeyPairRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteKeyPairRequestMarshaller().marshall(super
.beforeMarshalling(deleteKeyPairRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteKeyPairResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified NAT gateway. Deleting a NAT gateway disassociates
* its Elastic IP address, but does not release the address from your
* account. Deleting a NAT gateway does not delete any NAT gateway routes in
* your route tables.
*
*
* @param deleteNatGatewayRequest
* Contains the parameters for DeleteNatGateway.
* @return Result of the DeleteNatGateway operation returned by the service.
* @sample AmazonEC2.DeleteNatGateway
*/
@Override
public DeleteNatGatewayResult deleteNatGateway(
DeleteNatGatewayRequest deleteNatGatewayRequest) {
ExecutionContext executionContext = createExecutionContext(deleteNatGatewayRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteNatGatewayRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteNatGatewayRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteNatGatewayResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified network ACL. You can't delete the ACL if it's
* associated with any subnets. You can't delete the default network ACL.
*
*
* @param deleteNetworkAclRequest
* Contains the parameters for DeleteNetworkAcl.
* @return Result of the DeleteNetworkAcl operation returned by the service.
* @sample AmazonEC2.DeleteNetworkAcl
*/
@Override
public DeleteNetworkAclResult deleteNetworkAcl(
DeleteNetworkAclRequest deleteNetworkAclRequest) {
ExecutionContext executionContext = createExecutionContext(deleteNetworkAclRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteNetworkAclRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteNetworkAclRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteNetworkAclResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified ingress or egress entry (rule) from the specified
* network ACL.
*
*
* @param deleteNetworkAclEntryRequest
* Contains the parameters for DeleteNetworkAclEntry.
* @return Result of the DeleteNetworkAclEntry operation returned by the
* service.
* @sample AmazonEC2.DeleteNetworkAclEntry
*/
@Override
public DeleteNetworkAclEntryResult deleteNetworkAclEntry(
DeleteNetworkAclEntryRequest deleteNetworkAclEntryRequest) {
ExecutionContext executionContext = createExecutionContext(deleteNetworkAclEntryRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteNetworkAclEntryRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteNetworkAclEntryRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteNetworkAclEntryResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified network interface. You must detach the network
* interface before you can delete it.
*
*
* @param deleteNetworkInterfaceRequest
* Contains the parameters for DeleteNetworkInterface.
* @return Result of the DeleteNetworkInterface operation returned by the
* service.
* @sample AmazonEC2.DeleteNetworkInterface
*/
@Override
public DeleteNetworkInterfaceResult deleteNetworkInterface(
DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest) {
ExecutionContext executionContext = createExecutionContext(deleteNetworkInterfaceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteNetworkInterfaceRequestMarshaller()
.marshall(super
.beforeMarshalling(deleteNetworkInterfaceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeleteNetworkInterfaceResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified placement group. You must terminate all instances
* in the placement group before you can delete the placement group. For
* more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User
* Guide.
*
*
* @param deletePlacementGroupRequest
* Contains the parameters for DeletePlacementGroup.
* @return Result of the DeletePlacementGroup operation returned by the
* service.
* @sample AmazonEC2.DeletePlacementGroup
*/
@Override
public DeletePlacementGroupResult deletePlacementGroup(
DeletePlacementGroupRequest deletePlacementGroupRequest) {
ExecutionContext executionContext = createExecutionContext(deletePlacementGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeletePlacementGroupRequestMarshaller()
.marshall(super
.beforeMarshalling(deletePlacementGroupRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
StaxResponseHandler responseHandler = new StaxResponseHandler(
new DeletePlacementGroupResultStaxUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*