Revision: 349
Author: dkavanagh
Date: Sun Jan 20 13:05:22 2013
Log: image import
http://code.google.com/p/typica/source/detail?r=349
Added:
/trunk/java/com/xerox/amazonws/ec2/ImageFormat.java
Modified:
/trunk/java/com/xerox/amazonws/ec2/Jec2.java
=======================================
--- /dev/null
+++ /trunk/java/com/xerox/amazonws/ec2/ImageFormat.java Sun Jan 20 13:05:22
2013
@@ -0,0 +1,45 @@
+//
+// typica - A client library for Amazon Web Services
+// Copyright (C) 2011 Eucalyptus Systems
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//
http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License 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.xerox.amazonws.ec2;
+
+/**
+ * This enumeration represents different image format that can be imported.
+ */
+public enum ImageFormat {
+ VMDK ("VMDK"),
+ RAW ("RAW");
+
+ private final String formatId;
+
+ ImageFormat(String formatId) {
+ this.formatId = formatId;
+ }
+
+ public String getFormatId() {
+ return formatId;
+ }
+
+ public static ImageFormat getFormatFromString(String val) {
+ for (ImageFormat t : ImageFormat.values()) {
+ if (t.getFormatId().equals(val)) {
+ return t;
+ }
+ }
+ return null;
+ }
+}
=======================================
--- /trunk/java/com/xerox/amazonws/ec2/Jec2.java Wed Jun 22 06:03:24 2011
+++ /trunk/java/com/xerox/amazonws/ec2/Jec2.java Sun Jan 20 13:05:22 2013
@@ -2724,6 +2724,25 @@
}
return ret;
}
+
+ /**
+ * Creates a new import task.
+ *
+ * @param availabilityZone zone to place the EBS volume in
+ * @param imgFormat format of the disk image
+ * @param imageSize bytes in the disk image
+ * @param manifestS3URL pre-signed S3 URL for the image manifest
+ * @param desc optional description
+ * @param volumeSize size of EBS volume to be created
+ * @throws EC2Exception wraps checked exceptions
+ */
+// public ConversionTask importInstance(String availabilityZone,
ImageFormat imgFormat, long imageSize,
+// String manifestS3URL, String desc, int volumeSize) throws
EC2Exception {
+// Map<String, String> params = new HashMap<String, String>();
+// HttpGet method = new HttpGet();
+// ImportVolumeResponse response =
+// makeRequestInt(method, "ImportVolume", params,
ImportVolumeResponse.class);
+// }
// helper method to create common filter parameters
protected void createFilterParams(Map<String, String> params, Map<String,
List<String>> filters) {