http://code.google.com/p/typica/source/detail?r=338
Modified:
/trunk/java/com/xerox/amazonws/ec2/LaunchConfiguration.java
/trunk/java/com/xerox/amazonws/ec2/ReservationDescription.java
=======================================
--- /trunk/java/com/xerox/amazonws/ec2/LaunchConfiguration.java Fri Jun 4
07:36:52 2010
+++ /trunk/java/com/xerox/amazonws/ec2/LaunchConfiguration.java Fri Jul 9
12:55:34 2010
@@ -70,6 +70,9 @@
private String additionalInfo;
+ /** The subnet to be used with Amazon VPC */
+ private String subnetId;
+
/**
* Launches the given AMI one time. The min and max values are '1'.
*
@@ -309,6 +312,20 @@
public Boolean isPublicAddressing() {
return addressingType;
}
+
+ /**
+ * @return the subnetId
+ */
+ public String getSubnetId() {
+ return this.subnetId;
+ }
+
+ /**
+ * @param subnetId the subnetId to set
+ */
+ public void setSubnetId(String subnetId) {
+ this.subnetId = subnetId;
+ }
/**
* For some eucaluptus clusters, need to set this false (=private)
@@ -380,5 +397,9 @@
if (isMonitoring()) {
params.put(prefix + "Monitoring.Enabled", "true");
}
+ String subnetId = getSubnetId();
+ if (subnetId != null && !subnetId.trim().equals("")) {
+ params.put(prefix + "SubnetId", subnetId);
+ }
}
}
=======================================
--- /trunk/java/com/xerox/amazonws/ec2/ReservationDescription.java Thu Jul
8 13:33:26 2010
+++ /trunk/java/com/xerox/amazonws/ec2/ReservationDescription.java Fri Jul
9 12:55:34 2010
@@ -96,7 +96,7 @@
boolean monitoring, String subnetId, String privateIpAddress, String
ipAddress,
String architecture, String rootDeviceType, String rootDeviceName,
List<InstanceBlockDeviceMapping> blockDeviceMapping, String
instanceLifecycle,
- String spotInstanceRequestId) {
+ String spotInstanceRequestId, String vpcId) {
Instance instance = new Instance(imageId, instanceId, privateDnsName,
dnsName, state.getName(), ""+state.getCode(), reason,
keyName, launchIndex, productCodes,
@@ -104,7 +104,7 @@
availabilityZone, kernelId, ramdiskId, platform,
monitoring, subnetId, privateIpAddress, ipAddress,
architecture, rootDeviceType, rootDeviceName,
- blockDeviceMapping, instanceLifecycle, spotInstanceRequestId);
+ blockDeviceMapping, instanceLifecycle, spotInstanceRequestId, vpcId);
instances.add(instance);
return instance;
}
@@ -158,6 +158,7 @@
private String stateCode;
private boolean monitoring;
private String subnetId;
+ private String vpcId;
private String privateIpAddress;
private String ipAddress;
private String architecture;
@@ -175,7 +176,7 @@
boolean monitoring, String subnetId, String privateIpAddress, String
ipAddress,
String architecture, String rootDeviceType, String rootDeviceName,
List<InstanceBlockDeviceMapping> blockDeviceMapping, String
instanceLifecycle,
- String spotInstanceRequestId) {
+ String spotInstanceRequestId, String vpcId) {
this.imageId = imageId;
this.instanceId = instanceId;
this.privateDnsName = privateDnsName;
@@ -194,6 +195,7 @@
this.platform = platform;
this.monitoring = monitoring;
this.subnetId = subnetId;
+ this.vpcId = vpcId;
this.privateIpAddress = privateIpAddress;
this.ipAddress = ipAddress;
this.architecture = architecture;
@@ -232,6 +234,7 @@
this.platform = rsp_item.getPlatform();
this.monitoring =
rsp_item.getMonitoring().getState().contains("enabled");
this.subnetId = rsp_item.getSubnetId();
+ this.vpcId = rsp_item.getVpcId();
this.privateIpAddress = rsp_item.getPrivateIpAddress();
this.ipAddress = rsp_item.getIpAddress();
this.architecture = rsp_item.getArchitecture();
@@ -341,6 +344,10 @@
public String getSubnetId() {
return subnetId;
}
+
+ public String getVpcId() {
+ return vpcId;
+ }
public String getPrivateIpAddress() {
return privateIpAddress;