summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.client
diff options
context:
space:
mode:
authorSelvam <selvam@gluster.com>2011-04-20 10:55:26 +0530
committerSelvam <selvam@gluster.com>2011-04-28 17:57:17 +0530
commit98da4383c37046e81f83bf9bf98ec077e94134b8 (patch)
treec4669777417867a1eb3de7ba4fd7d1eefc19e510 /src/com.gluster.storage.management.client
parentc11192c4cf06f14ad90d72819ebeee2ad527f16d (diff)
Story #18 Add disk, UI, REST client and REST Resource
Diffstat (limited to 'src/com.gluster.storage.management.client')
-rw-r--r--src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java
index 05b89306..7ce2028f 100644
--- a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java
+++ b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java
@@ -20,7 +20,11 @@
*/
package com.gluster.storage.management.client;
+import java.util.ArrayList;
+import java.util.List;
+
import com.gluster.storage.management.core.constants.RESTConstants;
+import com.gluster.storage.management.core.model.Disk;
import com.gluster.storage.management.core.model.Status;
import com.gluster.storage.management.core.model.Volume;
import com.gluster.storage.management.core.response.VolumeListResponse;
@@ -84,6 +88,12 @@ public class VolumesClient extends AbstractClient {
return ((VolumeOptionInfoListResponse) fetchSubResource(RESTConstants.SUBRESOURCE_DEFAULT_OPTIONS,
VolumeOptionInfoListResponse.class));
}
+
+ public Status addDisks(String volumeName, String disks) {
+ Form form = new Form();
+ form.add(RESTConstants.QUERY_PARAM_DISKS, disks);
+ return (Status) postRequest(volumeName + "/" + RESTConstants.SUBRESOURCE_DISKS, Status.class, form);
+ }
public static void main(String[] args) {
UsersClient usersClient = new UsersClient();
@@ -105,8 +115,11 @@ public class VolumesClient extends AbstractClient {
// for (VolumeOptionInfo option : client.getVolumeOptionsDefaults()) {
// System.out.println(option.getName() + "-" + option.getDescription() + "-" + option.getDefaultValue());
// }
- System.out.println(client.getVolume("Volume3").getOptions());
- System.out.println(client.setVolumeOption("Volume3", "network.frame-timeout", "600").getMessage());
+// System.out.println(client.getVolume("Volume3").getOptions());
+// System.out.println(client.setVolumeOption("Volume3", "network.frame-timeout", "600").getMessage());
+
+ Status status = client.addDisks("Volume3", "server1:sda, server1:sdb, server1:sdc");
+ System.out.println(status.getMessage());
}
}
}