Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
    /*
     * Copyright 2010-2015 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 com.amazonaws.*;
   import com.amazonaws.auth.*;
   import com.amazonaws.http.*;
   import com.amazonaws.util.*;
   
Client for accessing AmazonEC2. 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.

   
   public class AmazonEC2Client extends AmazonWebServiceClient implements AmazonEC2 {

    
Provider for AWS credentials.
   
       private AWSCredentialsProvider awsCredentialsProvider;

    
List of exception unmarshallers for all AmazonEC2 exceptions.
   
               = new ArrayList<Unmarshaller<AmazonServiceExceptionNode>>();

    
Constructs a new client to invoke service methods on AmazonEC2. 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.

   
       public AmazonEC2Client() {
           this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
       }

    
Constructs a new client to invoke service methods on AmazonEC2. 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.

Parameters:
clientConfiguration The client configuration options controlling how this client connects to AmazonEC2 (ex: proxy settings, retry counts, etc.).
See also:
com.amazonaws.auth.DefaultAWSCredentialsProviderChain
   
      public AmazonEC2Client(ClientConfiguration clientConfiguration) {
          this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
      }

    
Constructs a new client to invoke service methods on AmazonEC2 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.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
  
      public AmazonEC2Client(AWSCredentials awsCredentials) {
          this(awsCredentialsnew ClientConfiguration());
      }

    
Constructs a new client to invoke service methods on AmazonEC2 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.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AmazonEC2 (ex: proxy settings, retry counts, etc.).
  
      public AmazonEC2Client(AWSCredentials awsCredentialsClientConfiguration clientConfiguration) {
          super(clientConfiguration);
          this. = new StaticCredentialsProvider(awsCredentials);
          init();
      }

    
Constructs a new client to invoke service methods on AmazonEC2 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.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
  
      public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProvider) {
          this(awsCredentialsProvidernew ClientConfiguration());
      }

    
Constructs a new client to invoke service methods on AmazonEC2 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.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AmazonEC2 (ex: proxy settings, retry counts, etc.).
  
      public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProviderClientConfiguration clientConfiguration) {
          this(awsCredentialsProviderclientConfigurationnull);
      }

    
Constructs a new client to invoke service methods on AmazonEC2 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.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AmazonEC2 (ex: proxy settings, retry counts, etc.).
requestMetricCollector optional request metric collector
  
      public AmazonEC2Client(AWSCredentialsProvider awsCredentialsProvider,
              ClientConfiguration clientConfiguration,
              RequestMetricCollector requestMetricCollector) {
          super(clientConfigurationrequestMetricCollector);
          this. = awsCredentialsProvider;
          init();
      }
  
      private void init() {
          
          
          // calling this.setEndPoint(...) will also modify the signer accordingly
          this.setEndpoint("ec2.us-east-1.amazonaws.com");
          
          HandlerChainFactory chainFactory = new HandlerChainFactory();
          .addAll(chainFactory.newRequestHandlerChain(
                  "/com/amazonaws/services/ec2/request.handlers"));
          .addAll(chainFactory.newRequestHandler2Chain(
                  "/com/amazonaws/services/ec2/request.handler2s"));
      }

    

Requests a reboot of one or more instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.

If a Linux/Unix instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.

For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .

Parameters:
rebootInstancesRequest Container for the necessary parameters to execute the RebootInstances service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public void rebootInstances(RebootInstancesRequest rebootInstancesRequest) {
          ExecutionContext executionContext = createExecutionContext(rebootInstancesRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          Request<RebootInstancesRequestrequest = null;
          awsRequestMetrics.startEvent(.);
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new RebootInstancesRequestMarshaller().marshall(super.beforeMarshalling(rebootInstancesRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              invoke(requestnullexecutionContext);
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestnull);
          }
      }
    
    

Describes one or more of the Reserved Instances that you purchased.

For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute Cloud User Guide .

Parameters:
describeReservedInstancesRequest Container for the necessary parameters to execute the DescribeReservedInstances service method on AmazonEC2.
Returns:
The response from the DescribeReservedInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public DescribeReservedInstancesResult describeReservedInstances(DescribeReservedInstancesRequest describeReservedInstancesRequest) {
          ExecutionContext executionContext = createExecutionContext(describeReservedInstancesRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<DescribeReservedInstancesRequestrequest = null;
          Response<DescribeReservedInstancesResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new DescribeReservedInstancesRequestMarshaller().marshall(super.beforeMarshalling(describeReservedInstancesRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew DescribeReservedInstancesResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

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.

Parameters:
createFlowLogsRequest Container for the necessary parameters to execute the CreateFlowLogs service method on AmazonEC2.
Returns:
The response from the CreateFlowLogs service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public CreateFlowLogsResult createFlowLogs(CreateFlowLogsRequest createFlowLogsRequest) {
          ExecutionContext executionContext = createExecutionContext(createFlowLogsRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<CreateFlowLogsRequestrequest = null;
          Response<CreateFlowLogsResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new CreateFlowLogsRequestMarshaller().marshall(super.beforeMarshalling(createFlowLogsRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew CreateFlowLogsResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

Describes one or more of the Availability Zones that are available to you. The results include zones only for the region you're currently using. If there is an event impacting an Availability Zone, you can use this request to view the state and any provided message for that Availability Zone.

For more information, see Regions and Availability Zones in the Amazon Elastic Compute Cloud User Guide .

Parameters:
describeAvailabilityZonesRequest Container for the necessary parameters to execute the DescribeAvailabilityZones service method on AmazonEC2.
Returns:
The response from the DescribeAvailabilityZones service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public DescribeAvailabilityZonesResult describeAvailabilityZones(DescribeAvailabilityZonesRequest describeAvailabilityZonesRequest) {
          ExecutionContext executionContext = createExecutionContext(describeAvailabilityZonesRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<DescribeAvailabilityZonesRequestrequest = null;
          Response<DescribeAvailabilityZonesResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new DescribeAvailabilityZonesRequestMarshaller().marshall(super.beforeMarshalling(describeAvailabilityZonesRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew DescribeAvailabilityZonesResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

Restores an Elastic IP address that was previously moved to the EC2-VPC platform back to the EC2-Classic platform. You cannot move an Elastic IP address that was originally allocated for use in EC2-VPC. The Elastic IP address must not be associated with an instance or network interface.

Parameters:
restoreAddressToClassicRequest Container for the necessary parameters to execute the RestoreAddressToClassic service method on AmazonEC2.
Returns:
The response from the RestoreAddressToClassic service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public RestoreAddressToClassicResult restoreAddressToClassic(RestoreAddressToClassicRequest restoreAddressToClassicRequest) {
          ExecutionContext executionContext = createExecutionContext(restoreAddressToClassicRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<RestoreAddressToClassicRequestrequest = null;
          Response<RestoreAddressToClassicResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new RestoreAddressToClassicRequestMarshaller().marshall(super.beforeMarshalling(restoreAddressToClassicRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew RestoreAddressToClassicResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so results in the volume being stuck in a busy state while detaching.

If an Amazon EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.

When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.

For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .

Parameters:
detachVolumeRequest Container for the necessary parameters to execute the DetachVolume service method on AmazonEC2.
Returns:
The response from the DetachVolume service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public DetachVolumeResult detachVolume(DetachVolumeRequest detachVolumeRequest) {
          ExecutionContext executionContext = createExecutionContext(detachVolumeRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<DetachVolumeRequestrequest = null;
          Response<DetachVolumeResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new DetachVolumeRequestMarshaller().marshall(super.beforeMarshalling(detachVolumeRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew DetachVolumeResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

Deletes the specified key pair, by removing the public key from Amazon EC2.

Parameters:
deleteKeyPairRequest Container for the necessary parameters to execute the DeleteKeyPair service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public void deleteKeyPair(DeleteKeyPairRequest deleteKeyPairRequest) {
          ExecutionContext executionContext = createExecutionContext(deleteKeyPairRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          Request<DeleteKeyPairRequestrequest = null;
          awsRequestMetrics.startEvent(.);
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new DeleteKeyPairRequestMarshaller().marshall(super.beforeMarshalling(deleteKeyPairRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              invoke(requestnullexecutionContext);
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestnull);
          }
      }
    
    

Disables monitoring for a running instance. For more information about monitoring instances, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .

Parameters:
unmonitorInstancesRequest Container for the necessary parameters to execute the UnmonitorInstances service method on AmazonEC2.
Returns:
The response from the UnmonitorInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public UnmonitorInstancesResult unmonitorInstances(UnmonitorInstancesRequest unmonitorInstancesRequest) {
          ExecutionContext executionContext = createExecutionContext(unmonitorInstancesRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<UnmonitorInstancesRequestrequest = null;
          Response<UnmonitorInstancesResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new UnmonitorInstancesRequestMarshaller().marshall(super.beforeMarshalling(unmonitorInstancesRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew UnmonitorInstancesResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

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 .

Parameters:
attachVpnGatewayRequest Container for the necessary parameters to execute the AttachVpnGateway service method on AmazonEC2.
Returns:
The response from the AttachVpnGateway service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public AttachVpnGatewayResult attachVpnGateway(AttachVpnGatewayRequest attachVpnGatewayRequest) {
          ExecutionContext executionContext = createExecutionContext(attachVpnGatewayRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<AttachVpnGatewayRequestrequest = null;
          Response<AttachVpnGatewayResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new AttachVpnGatewayRequestMarshaller().marshall(super.beforeMarshalling(attachVpnGatewayRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew AttachVpnGatewayResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

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 .

Parameters:
createImageRequest Container for the necessary parameters to execute the CreateImage service method on AmazonEC2.
Returns:
The response from the CreateImage service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public CreateImageResult createImage(CreateImageRequest createImageRequest) {
          ExecutionContext executionContext = createExecutionContext(createImageRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<CreateImageRequestrequest = null;
          Response<CreateImageResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new CreateImageRequestMarshaller().marshall(super.beforeMarshalling(createImageRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew CreateImageResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

Deletes a security group.

If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.

Parameters:
deleteSecurityGroupRequest Container for the necessary parameters to execute the DeleteSecurityGroup service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public void deleteSecurityGroup(DeleteSecurityGroupRequest deleteSecurityGroupRequest) {
          ExecutionContext executionContext = createExecutionContext(deleteSecurityGroupRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          Request<DeleteSecurityGroupRequestrequest = null;
          awsRequestMetrics.startEvent(.);
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new DeleteSecurityGroupRequestMarshaller().marshall(super.beforeMarshalling(deleteSecurityGroupRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              invoke(requestnullexecutionContext);
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestnull);
          }
      }
    
    

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 .

Parameters:
createInstanceExportTaskRequest Container for the necessary parameters to execute the CreateInstanceExportTask service method on AmazonEC2.
Returns:
The response from the CreateInstanceExportTask service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public CreateInstanceExportTaskResult createInstanceExportTask(CreateInstanceExportTaskRequest createInstanceExportTaskRequest) {
          ExecutionContext executionContext = createExecutionContext(createInstanceExportTaskRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          awsRequestMetrics.startEvent(.);
          Request<CreateInstanceExportTaskRequestrequest = null;
          Response<CreateInstanceExportTaskResultresponse = null;
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new CreateInstanceExportTaskRequestMarshaller().marshall(super.beforeMarshalling(createInstanceExportTaskRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              response = invoke(requestnew CreateInstanceExportTaskResultStaxUnmarshaller(), executionContext);
              return response.getAwsResponse();
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestresponse);
          }
      }
    
    

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.

IMPORTANT: You can have up to 50 rules per security group (covering both ingress and egress rules).

A security group is for use with instances either in the EC2-Classic platform or in a specific 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 .

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.

Parameters:
authorizeSecurityGroupEgressRequest Container for the necessary parameters to execute the AuthorizeSecurityGroupEgress service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public void authorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest) {
          ExecutionContext executionContext = createExecutionContext(authorizeSecurityGroupEgressRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          Request<AuthorizeSecurityGroupEgressRequestrequest = null;
          awsRequestMetrics.startEvent(.);
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new AuthorizeSecurityGroupEgressRequestMarshaller().marshall(super.beforeMarshalling(authorizeSecurityGroupEgressRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              invoke(requestnullexecutionContext);
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestnull);
          }
      }
    
    

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 .

Parameters:
associateDhcpOptionsRequest Container for the necessary parameters to execute the AssociateDhcpOptions service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
  
      public void associateDhcpOptions(AssociateDhcpOptionsRequest associateDhcpOptionsRequest) {
          ExecutionContext executionContext = createExecutionContext(associateDhcpOptionsRequest);
          AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
          Request<AssociateDhcpOptionsRequestrequest = null;
          awsRequestMetrics.startEvent(.);
          
          try {
              awsRequestMetrics.startEvent(.);
              try {
                  request = new AssociateDhcpOptionsRequestMarshaller().marshall(super.beforeMarshalling(associateDhcpOptionsRequest));
                  // Binds the request metrics to the current request.
                  request.setAWSRequestMetrics(awsRequestMetrics);
              } finally {
                  awsRequestMetrics.endEvent(.);
              }
  
              invoke(requestnullexecutionContext);
  
          } finally {
              
              endClientExecution(awsRequestMetricsrequestnull);
          }
      }
    
    

Retrieves the encrypted administrator password for an instance running Windows.

The Windows password is generated at boot if the EC2Config service plugin, Ec2SetPassword , is enabled. This usually only happens the first time an AMI is launched, and then Ec2SetPassword is automatically disabled. The password is not generated for rebundled AMIs unless Ec2SetPassword is enabled before bundling.

The password is encrypted using the key pair that you specified when you launched the instance. You must provide the corresponding key pair file.

Password generation and encryption takes a few moments. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.

Parameters:
getPasswordDataRequest Container for the necessary parameters to execute the GetPasswordData service method on AmazonEC2.
Returns:
The response from the GetPasswordData service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public GetPasswordDataResult getPasswordData(GetPasswordDataRequest getPasswordDataRequest) {
         ExecutionContext executionContext = createExecutionContext(getPasswordDataRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<GetPasswordDataRequestrequest = null;
         Response<GetPasswordDataResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new GetPasswordDataRequestMarshaller().marshall(super.beforeMarshalling(getPasswordDataRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew GetPasswordDataResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Stops an Amazon EBS-backed instance. Each time you transition an instance from stopped to started, Amazon EC2 charges a full instance hour, even if transitions happen multiple times within a single hour.

You can't start or stop Spot Instances.

Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.

Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.

Performing this operation on an instance that uses an instance store as its root device returns an error.

You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .

For more information about troubleshooting, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .

Parameters:
stopInstancesRequest Container for the necessary parameters to execute the StopInstances service method on AmazonEC2.
Returns:
The response from the StopInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public StopInstancesResult stopInstances(StopInstancesRequest stopInstancesRequest) {
         ExecutionContext executionContext = createExecutionContext(stopInstancesRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<StopInstancesRequestrequest = null;
         Response<StopInstancesResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new StopInstancesRequestMarshaller().marshall(super.beforeMarshalling(stopInstancesRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew StopInstancesResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with CreateKeyPair, in which AWS creates the key pair and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, you create the key pair and give AWS just the public key. The private key is never transferred between you and AWS.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .

Parameters:
importKeyPairRequest Container for the necessary parameters to execute the ImportKeyPair service method on AmazonEC2.
Returns:
The response from the ImportKeyPair service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public ImportKeyPairResult importKeyPair(ImportKeyPairRequest importKeyPairRequest) {
         ExecutionContext executionContext = createExecutionContext(importKeyPairRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<ImportKeyPairRequestrequest = null;
         Response<ImportKeyPairResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new ImportKeyPairRequestMarshaller().marshall(super.beforeMarshalling(importKeyPairRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew ImportKeyPairResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Deletes the specified network interface. You must detach the network interface before you can delete it.

Parameters:
deleteNetworkInterfaceRequest Container for the necessary parameters to execute the DeleteNetworkInterface service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public void deleteNetworkInterface(DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteNetworkInterfaceRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         Request<DeleteNetworkInterfaceRequestrequest = null;
         awsRequestMetrics.startEvent(.);
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteNetworkInterfaceRequestMarshaller().marshall(super.beforeMarshalling(deleteNetworkInterfaceRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             invoke(requestnullexecutionContext);
         } finally {
             
             endClientExecution(awsRequestMetricsrequestnull);
         }
     }
    
    

Modifies the specified attribute of the specified VPC.

Parameters:
modifyVpcAttributeRequest Container for the necessary parameters to execute the ModifyVpcAttribute service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public void modifyVpcAttribute(ModifyVpcAttributeRequest modifyVpcAttributeRequest) {
         ExecutionContext executionContext = createExecutionContext(modifyVpcAttributeRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         Request<ModifyVpcAttributeRequestrequest = null;
         awsRequestMetrics.startEvent(.);
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new ModifyVpcAttributeRequestMarshaller().marshall(super.beforeMarshalling(modifyVpcAttributeRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             invoke(requestnullexecutionContext);
         } finally {
             
             endClientExecution(awsRequestMetricsrequestnull);
         }
     }
    
    

Describes the running instances for the specified Spot fleet.

Parameters:
describeSpotFleetInstancesRequest Container for the necessary parameters to execute the DescribeSpotFleetInstances service method on AmazonEC2.
Returns:
The response from the DescribeSpotFleetInstances service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
         ExecutionContext executionContext = createExecutionContext(describeSpotFleetInstancesRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeSpotFleetInstancesRequestrequest = null;
         Response<DescribeSpotFleetInstancesResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeSpotFleetInstancesRequestMarshaller().marshall(super.beforeMarshalling(describeSpotFleetInstancesRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew DescribeSpotFleetInstancesResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

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 .

IMPORTANT: EC2-Classic: You can have up to 500 security groups. EC2-VPC: You can create up to 100 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.

Parameters:
createSecurityGroupRequest Container for the necessary parameters to execute the CreateSecurityGroup service method on AmazonEC2.
Returns:
The response from the CreateSecurityGroup service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public CreateSecurityGroupResult createSecurityGroup(CreateSecurityGroupRequest createSecurityGroupRequest) {
         ExecutionContext executionContext = createExecutionContext(createSecurityGroupRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateSecurityGroupRequestrequest = null;
         Response<CreateSecurityGroupResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateSecurityGroupRequestMarshaller().marshall(super.beforeMarshalling(createSecurityGroupRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew CreateSecurityGroupResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Describes the Spot Price history. The prices returned are listed in chronological order, from the oldest to the most recent, for up to the past 90 days. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide .

When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The price is valid within the time period that you specified; the response merely indicates the last time that the price changed.

Parameters:
describeSpotPriceHistoryRequest Container for the necessary parameters to execute the DescribeSpotPriceHistory service method on AmazonEC2.
Returns:
The response from the DescribeSpotPriceHistory service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
         ExecutionContext executionContext = createExecutionContext(describeSpotPriceHistoryRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeSpotPriceHistoryRequestrequest = null;
         Response<DescribeSpotPriceHistoryResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeSpotPriceHistoryRequestMarshaller().marshall(super.beforeMarshalling(describeSpotPriceHistoryRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew DescribeSpotPriceHistoryResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Describes one or more of your network interfaces.

Parameters:
describeNetworkInterfacesRequest Container for the necessary parameters to execute the DescribeNetworkInterfaces service method on AmazonEC2.
Returns:
The response from the DescribeNetworkInterfaces service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
         ExecutionContext executionContext = createExecutionContext(describeNetworkInterfacesRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeNetworkInterfacesRequestrequest = null;
         Response<DescribeNetworkInterfacesResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeNetworkInterfacesRequestMarshaller().marshall(super.beforeMarshalling(describeNetworkInterfacesRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew DescribeNetworkInterfacesResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Describes one or more regions that are currently available to you.

For a list of the regions supported by Amazon EC2, see Regions and Endpoints .

Parameters:
describeRegionsRequest Container for the necessary parameters to execute the DescribeRegions service method on AmazonEC2.
Returns:
The response from the DescribeRegions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public DescribeRegionsResult describeRegions(DescribeRegionsRequest describeRegionsRequest) {
         ExecutionContext executionContext = createExecutionContext(describeRegionsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeRegionsRequestrequest = null;
         Response<DescribeRegionsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeRegionsRequestMarshaller().marshall(super.beforeMarshalling(describeRegionsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew DescribeRegionsResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

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 .

Parameters:
createDhcpOptionsRequest Container for the necessary parameters to execute the CreateDhcpOptions service method on AmazonEC2.
Returns:
The response from the CreateDhcpOptions service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public CreateDhcpOptionsResult createDhcpOptions(CreateDhcpOptionsRequest createDhcpOptionsRequest) {
         ExecutionContext executionContext = createExecutionContext(createDhcpOptionsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateDhcpOptionsRequestrequest = null;
         Response<CreateDhcpOptionsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateDhcpOptionsRequestMarshaller().marshall(super.beforeMarshalling(createDhcpOptionsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew CreateDhcpOptionsResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

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 .

Parameters:
createReservedInstancesListingRequest Container for the necessary parameters to execute the CreateReservedInstancesListing service method on AmazonEC2.
Returns:
The response from the CreateReservedInstancesListing service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
         ExecutionContext executionContext = createExecutionContext(createReservedInstancesListingRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateReservedInstancesListingRequestrequest = null;
         Response<CreateReservedInstancesListingResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateReservedInstancesListingRequestMarshaller().marshall(super.beforeMarshalling(createReservedInstancesListingRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew CreateReservedInstancesListingResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Deletes one or more specified VPC endpoints. Deleting the endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint.

Parameters:
deleteVpcEndpointsRequest Container for the necessary parameters to execute the DeleteVpcEndpoints service method on AmazonEC2.
Returns:
The response from the DeleteVpcEndpoints service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public DeleteVpcEndpointsResult deleteVpcEndpoints(DeleteVpcEndpointsRequest deleteVpcEndpointsRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteVpcEndpointsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DeleteVpcEndpointsRequestrequest = null;
         Response<DeleteVpcEndpointsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteVpcEndpointsRequestMarshaller().marshall(super.beforeMarshalling(deleteVpcEndpointsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response = invoke(requestnew DeleteVpcEndpointsResultStaxUnmarshaller(), executionContext);
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }
    
    

Resets permission settings for the specified snapshot.

For more information on modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide .

Parameters:
resetSnapshotAttributeRequest Container for the necessary parameters to execute the ResetSnapshotAttribute service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public void resetSnapshotAttribute(ResetSnapshotAttributeRequest resetSnapshotAttributeRequest) {
         ExecutionContext executionContext = createExecutionContext(resetSnapshotAttributeRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         Request<ResetSnapshotAttributeRequestrequest = null;
         awsRequestMetrics.startEvent(.);
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new ResetSnapshotAttributeRequestMarshaller().marshall(super.beforeMarshalling(resetSnapshotAttributeRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             invoke(requestnullexecutionContext);
         } finally {
             
             endClientExecution(awsRequestMetricsrequestnull);
         }
     }
    
    

Deletes the specified route from the specified route table.

Parameters:
deleteRouteRequest Container for the necessary parameters to execute the DeleteRoute service method on AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
     public void deleteRoute(DeleteRouteRequest deleteRouteRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteRouteRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         Request<DeleteRouteRequestrequest = null;
         awsRequestMetrics.startEvent(.);
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteRouteRequestMarshaller().marshall(super.beforeMarshalling(deleteRouteRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             invoke(requestnullexecutionContext);
         } finally {
             
             endClientExecution(awsRequestMetricsrequestnull);
         }
     }
    
    

Describes one or more of your Internet gateways.

Parameters:
describeInternetGatewaysRequest Container for the necessary parameters to execute the DescribeInternetGateways service method on AmazonEC2.
Returns:
The response from the DescribeInternetGateways service method, as returned by AmazonEC2.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AmazonEC2 indicating either a problem with the data in the request, or a server side issue.
         ExecutionContext executionContext = createExecutionContext(describeInternetGatewaysRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeInternetGatewaysRequestrequest = null;
         Response<DescribeInternetGatewaysResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeInternetGatewaysRequestMarshaller().marshall(super.beforeMarshalling(describeInternetGatewaysRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
             response =