Amazon AWS SDK Guía de usuario Pagina 59

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 76
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 58
interruption or termination.We've inserted new code in the following example that shows how to enable
this scenario.
In the added code, we create a BlockDeviceMapping object and set its associated Elastic Block Storage
(EBS) to an EBS object that we've configured to not be deleted if the Spot Instance is terminated.We
then add this BlockDeviceMapping to the ArrayList of mappings that we include in the launch
specification.
1
// Retrieves the credentials from an AWSCredentials.properties file.
AWSCredentials credentials = null;
try {
5 credentials = new PropertiesCredentials(
GettingStartedApp.class.getResourceAsStream("AwsCredentials.proper
ties"));
} catch (IOException e1) {
System.out.println("Credentials were not properly entered into AwsCre
dentials.properties.");
System.out.println(e1.getMessage());
10 System.exit(-1);
}
// Create the AmazonEC2Client object so we can call various APIs.
AmazonEC2 ec2 = new AmazonEC2Client(credentials);
15
// Initializes a Spot Instance Request
RequestSpotInstancesRequest requestRequest = new RequestSpotInstances
Request();
// Request 1 x t1.micro instance with a bid price of $0.03.
20 requestRequest.setSpotPrice("0.03");
requestRequest.setInstanceCount(Integer.valueOf(1));
// Set up the specifications of the launch. This includes the instance
// type (e.g. t1.micro) and the latest Amazon Linux AMI id available.
25 // Note, you should always use the latest Amazon Linux AMI id or another
// of your choosing.
LaunchSpecification launchSpecification = new LaunchSpecification();
launchSpecification.setImageId("ami-8c1fece5");
launchSpecification.setInstanceType("t1.micro");
30
// Add the security group to the request.
ArrayList<String> securityGroups = new ArrayList<String>();
securityGroups.add("GettingStartedGroup");
launchSpecification.setSecurityGroups(securityGroups);
35
// Create the block device mapping to describe the root partition.
BlockDeviceMapping blockDeviceMapping = new BlockDeviceMapping();
blockDeviceMapping.setDeviceName("/dev/sda1");
40 // Set the delete on termination flag to false.
EbsBlockDevice ebs = new EbsBlockDevice();
ebs.setDeleteOnTermination(Boolean.FALSE);
blockDeviceMapping.setEbs(ebs);
45 // Add the block device mapping to the block list.
ArrayList<BlockDeviceMapping> blockList = new ArrayList<BlockDeviceMap
ping>();
Version v1.0.0
55
AWS SDK for Java Developer Guide
Tutorial: Advanced Amazon EC2 Spot Request
Management
Vista de pagina 58
1 2 ... 54 55 56 57 58 59 60 61 62 63 64 ... 75 76

Comentarios a estos manuales

Sin comentarios

Miele G 4925 SCU CLST Futura Classic Plus manuals

Owner’s manuals and user’s guides for Unknown Miele G 4925 SCU CLST Futura Classic Plus.
We providing 1 pdf manuals Miele G 4925 SCU CLST Futura Classic Plus for download free by document types: Energy Guide


Table of contents





More products and manuals for Unknown Miele

Models Document Type
T8023 Specifications Sheet   Miele T8023 Specification Sheet, 3 pages
K 1901 Vi Specifications Sheet   Miele K 1901 Vi Specification Sheet, 1 pages
KMR 1355 Specifications Sheet   Miele KMR 1355 Specification Sheet [en] , 3 pages
KM451BK User Manual   Miele KM451BK User's Manual, 12 pages
K 1903 SF Energy Guide Miele K 1903 SF Energy Guide, 1 pages
KWT 1603 SF Specifications Sheet   Miele KWT 1603 SF Specification Sheet, 3 pages
KF 1803 Vi Specifications Sheet    Miele KF 1803 Vi Specification Sheet, 7 pages
DA 7000 D AURA Installation Manual Miele DA 7000 D Aura Installation Manual, 2 pages
DA 3480 Specifications Sheet Miele DA 3480 Specification Sheet, 1 pages
F 1803 SF Specifications Sheet   Miele F 1803 SF Specification Sheet, 3 pages
KM5676 User Manual   Miele KM5676 User's Manual, 44 pages
F 1801 SF Energy Guide Miele F 1801 SF Energy Guide, 1 pages
DA 249 Specifications Sheet   Miele DA 249 Specification Sheet, 2 pages
H 6800 BM Specifications Sheet   Miele H 6800 BM Specification Sheet, 9 pages
Little Giant PW 6065 Energy Guide   Miele Little Giant PW 6065 Energy Guide, 1 pages
G 5605 SCi Futura Dimension Series Specifications Sheet   Miele G 5605 SCi Futura Dimension Series Specification Sheet, 5 pages
EGW 2062 Specifications Sheet   Miele EGW 2062 Specification Sheet, 1 pages
F 1903 SF Energy Guide Miele F 1903 SF Energy Guide, 1 pages
KF 1801 Vi Specifications Sheet   Miele KF 1801 Vi Specification Sheet, 4 pages
F 1803 Vi Specifications Sheet   Miele F 1803 Vi Specification Sheet, 6 pages