cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [16/42] git commit: updated refs/heads/ui-vm-affinity to 25f2f0f
Date Wed, 24 Apr 2013 23:03:24 GMT
CLOUDSTACK-2120: mixed zone management - extend listSnapshots API to return zone type.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/15e2bc46
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/15e2bc46
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/15e2bc46

Branch: refs/heads/ui-vm-affinity
Commit: 15e2bc463f05ff8b77f6b6a79bbcb391216778d8
Parents: 6230e5b
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Apr 23 14:03:35 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue Apr 23 14:03:35 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/api/response/SnapshotResponse.java  |   16 +++++++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |    6 +++++
 2 files changed, 22 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15e2bc46/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java b/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
index 5b77fb2..7484ac9 100644
--- a/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
@@ -93,6 +93,14 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
     @Param(description = "the state of the snapshot. BackedUp means that snapshot is ready
to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp -
the snapshot is being backed up on secondary storage")
     private Snapshot.State state;
 
+    @SerializedName(ApiConstants.ZONE_NAME)
+    @Param(description = "name of the availability zone")
+    private String zoneName;
+    
+    @SerializedName(ApiConstants.ZONE_TYPE)
+    @Param(description = "network type of the availability zone")
+    private String zoneType;
+    
     @SerializedName(ApiConstants.TAGS)  @Param(description="the list of resource tags associated
with snapshot", responseObject = ResourceTagResponse.class)
     private List<ResourceTagResponse> tags;
 
@@ -173,6 +181,14 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
         this.projectName = projectName;
     }
 
+    public void setZoneName(String zoneName) {
+        this.zoneName = zoneName;
+    }
+
+    public void setZoneType(String zoneType) {
+        this.zoneType = zoneType;
+    }
+    
     public void setTags(List<ResourceTagResponse> tags) {
         this.tags = tags;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15e2bc46/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index f4567c0..ba5322f 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -443,6 +443,12 @@ public class ApiResponseHelper implements ResponseGenerator {
             snapshotResponse.setVolumeId(volume.getUuid());
             snapshotResponse.setVolumeName(volume.getName());
             snapshotResponse.setVolumeType(volume.getVolumeType().name());
+        
+            DataCenter zone = ApiDBUtils.findZoneById(volume.getDataCenterId());
+            if (zone != null) {
+            	snapshotResponse.setZoneName(zone.getName());
+            	snapshotResponse.setZoneType(zone.getNetworkType().toString());            
   
+            }
         }
         snapshotResponse.setCreated(snapshot.getCreated());
         snapshotResponse.setName(snapshot.getName());


Mime
View raw message