LOUDSTACK-2120: mixed zone management - extend listVirtualMachines API to return zone type.

This commit is contained in:
Jessica Wang 2013-04-20 18:42:18 -07:00
parent 060be0876f
commit 612e5fb672
6 changed files with 25 additions and 0 deletions

View File

@ -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";

View File

@ -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;
}

View File

@ -101,6 +101,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO, Long> 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());

View File

@ -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;
}

View File

@ -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,

View File

@ -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,