You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/04/24 18:24:12 UTC
[48/50] [abbrv] git commit: updated refs/heads/internallb to ca2fc30
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/internallb
Commit: 15e2bc463f05ff8b77f6b6a79bbcb391216778d8
Parents: 6230e5b
Author: Jessica Wang <je...@apache.org>
Authored: Tue Apr 23 14:03:35 2013 -0700
Committer: Jessica Wang <je...@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());