CLOUDSTACK-2120: mixed zone management - extend listNetworks API to return zone type.

This commit is contained in:
Jessica Wang 2013-04-23 12:25:34 -07:00
parent 35e2072660
commit 16ba999bf1
2 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,9 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the zone the network belongs to")
private String zoneName;
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description="the networktype of the zone the network belongs to")
private String zoneType;
@SerializedName("networkofferingid") @Param(description="network offering id the network is created from")
private String networkOfferingId;
@ -291,6 +294,10 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
this.zoneName = zoneName;
}
public void setZoneType(String zoneType) {
this.zoneType = zoneType;
}
public void setCidr(String cidr) {
this.cidr = cidr;
}

View File

@ -2354,6 +2354,7 @@ public class ApiResponseHelper implements ResponseGenerator {
if (zone != null) {
response.setZoneId(zone.getUuid());
response.setZoneName(zone.getName());
response.setZoneType(zone.getNetworkType().toString());
}
if (network.getPhysicalNetworkId() != null) {
PhysicalNetworkVO pnet = ApiDBUtils.findPhysicalNetworkById(network.getPhysicalNetworkId());