diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index d73f309c95f..e774ecc94b6 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -231,6 +231,7 @@ public class ApiConstants { public static final String VOLUME_ID = "volumeid"; public static final String ZONE_ID = "zoneid"; public static final String ZONE_NAME = "zonename"; + public static final String ZONE_TYPE = "zonetype"; public static final String NETWORK_TYPE = "networktype"; public static final String PAGE = "page"; public static final String PAGE_SIZE = "pagesize"; diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java index 212601ce20c..da08c94074c 100644 --- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java @@ -80,6 +80,9 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the availability zone for the virtual machine") private String zoneName; + @SerializedName(ApiConstants.ZONE_TYPE) @Param(description="the network type of the availability zone for the virtual machine") + private String zoneType; + @SerializedName(ApiConstants.HOST_ID) @Param(description="the ID of the host for the virtual machine") private String hostId; @@ -249,6 +252,10 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp this.zoneName = zoneName; } + public void setZoneType(String zoneType) { + this.zoneType = zoneType; + } + public void setHostId(String hostId) { this.hostId = hostId; } diff --git a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java index 4ed62262966..2bb7ee9c520 100644 --- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java @@ -101,6 +101,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBase implem } userVmResponse.setZoneId(userVm.getDataCenterUuid()); userVmResponse.setZoneName(userVm.getDataCenterName()); + userVmResponse.setZoneType(userVm.getDataCenterType()); if ((caller == null) || (caller.getType() == Account.ACCOUNT_TYPE_ADMIN)) { userVmResponse.setInstanceName(userVm.getInstanceName()); userVmResponse.setHostId(userVm.getHostUuid()); diff --git a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java index 8d1314eafae..a50906d9e3d 100644 --- a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java +++ b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java @@ -153,6 +153,9 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity { @Column(name="data_center_name") private String dataCenterName = null; + @Column(name="data_center_type") + private String dataCenterType = null; + @Column(name="security_group_enabled") private boolean securityGroupEnabled; @@ -800,8 +803,18 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity { public void setDataCenterName(String zoneName) { this.dataCenterName = zoneName; } + + + public String getDataCenterType() { + return dataCenterType; + } + public void setDataCenterType(String zoneType) { + this.dataCenterType = zoneType; + } + + public boolean isSecurityGroupEnabled() { return securityGroupEnabled; } diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql index e2949d93e61..57d6ab96c63 100644 --- a/setup/db/db/schema-40to410.sql +++ b/setup/db/db/schema-40to410.sql @@ -487,6 +487,7 @@ CREATE VIEW `cloud`.`user_vm_view` AS data_center.id data_center_id, data_center.uuid data_center_uuid, data_center.name data_center_name, + data_center.networktype data_center_type, data_center.is_security_group_enabled security_group_enabled, host.id host_id, host.uuid host_uuid, @@ -1456,6 +1457,7 @@ CREATE VIEW `cloud`.`storage_pool_view` AS data_center.id data_center_id, data_center.uuid data_center_uuid, data_center.name data_center_name, + data_center.name data_center_type, host_pod_ref.id pod_id, host_pod_ref.uuid pod_uuid, host_pod_ref.name pod_name, diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 93a685fbc3a..10cdbbad6f9 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -374,6 +374,7 @@ CREATE VIEW `cloud`.`user_vm_view` AS data_center.id data_center_id, data_center.uuid data_center_uuid, data_center.name data_center_name, + data_center.networktype data_center_type, data_center.is_security_group_enabled security_group_enabled, host.id host_id, host.uuid host_uuid,