Author: jjohnstn
Date: 2010-08-17 13:20:36 -0400 (Tue, 17 Aug 2010)
New Revision: 24218
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
Log:
2010-08-17 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java (createInstance): New
API that takes a memory and storage setting for the hardware profile.
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java (createInstance): Change API to
accept memory and storage settings.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-08-17 17:19:21
UTC (rev 24217)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-08-17 17:20:36
UTC (rev 24218)
@@ -1,3 +1,10 @@
+2010-08-17 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java (createInstance):
New
+ API that takes a memory and storage setting for the hardware profile.
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java (createInstance): Change API to
+ accept memory and storage settings.
+
2010-08-16 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
(buildHardwareProfile): Remove
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-08-17
17:19:21 UTC (rev 24217)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-08-17
17:20:36 UTC (rev 24218)
@@ -226,9 +226,10 @@
return realms.toArray(new DeltaCloudRealm[realms.size()]);
}
- public DeltaCloudInstance createInstance(String name, String imageId, String realmId,
String profileId) throws DeltaCloudException {
+ public DeltaCloudInstance createInstance(String name, String imageId, String realmId,
String profileId,
+ String memory, String storage) throws DeltaCloudException {
try {
- Instance instance = client.createInstance(imageId, profileId, realmId, name);
+ Instance instance = client.createInstance(imageId, profileId, realmId, name, memory,
storage);
if (instance != null) {
DeltaCloudInstance newInstance = new DeltaCloudInstance(instance);
instances.add(newInstance);
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-08-17
17:19:21 UTC (rev 24217)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-08-17
17:20:36 UTC (rev 24218)
@@ -159,11 +159,21 @@
String query = "?image_id=" + imageId;
return buildInstance(sendRequest(DCNS.INSTANCES + query, RequestType.POST));
}
-
+
@Override
public Instance createInstance(String imageId, String profileId, String realmId, String
name) throws DeltaCloudClientException
{
- String query = "?image_id=" + imageId + "&hardware_profile_id="
+ profileId + "&realm_id=" + realmId + "&name=" + name +
"&commit=create";
+ return createInstance(imageId, profileId, realmId, name, null, null);
+ }
+
+ public Instance createInstance(String imageId, String profileId, String realmId, String
name, String memory, String storage) throws DeltaCloudClientException
+ {
+ String query = "?image_id=" + imageId + "&hwp_id=" + profileId
+ "&realm_id=" + realmId + "&name=" + name;
+ if (memory != null)
+ query += "&hwp_memory=" + memory;
+ if (storage != null)
+ query += "&hwp_storage=" + storage;
+ query += "&commit=create";
return buildInstance(sendRequest(DCNS.INSTANCES + query, RequestType.POST));
}
Show replies by date