CLOUDSTACK-4302: Instance wizard UI: Support affinity groups for dedicated zones

Changes:
- Add affinityGroupUuid in the listzones response for dedicatedZones.
This commit is contained in:
Prachi Damle 2013-08-14 13:41:01 -07:00
parent cb609d24d6
commit 431ea4988c
4 changed files with 57 additions and 0 deletions

View File

@ -99,6 +99,10 @@ public class ZoneResponse extends BaseResponse {
@SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise")
private boolean localStorageEnabled;
@SerializedName(ApiConstants.AFFINITY_GROUP_ID)
@Param(description = "the UUID of the affinity group associated, null for public zones")
private String affinityGroupId;
public void setId(String id) {
this.id = id;
}
@ -198,4 +202,8 @@ public class ZoneResponse extends BaseResponse {
public void setIp6Dns2(String ip6Dns2) {
this.ip6Dns2 = ip6Dns2;
}
public void setAffinityGroupId(String affinityGroupId) {
this.affinityGroupId = affinityGroupId;
}
}

View File

@ -94,6 +94,7 @@ public class DataCenterJoinDaoImpl extends GenericDaoBase<DataCenterJoinVO, Long
zoneResponse.setAllocationState(dataCenter.getAllocationState().toString());
zoneResponse.setZoneToken(dataCenter.getZoneToken());
zoneResponse.setDhcpProvider(dataCenter.getDhcpProvider());
zoneResponse.setAffinityGroupId(dataCenter.getAffinityGroupUuid());
zoneResponse.setObjectName("zone");
return zoneResponse;
}

View File

@ -108,6 +108,12 @@ public class DataCenterJoinVO extends BaseViewVO implements InternalIdentity, Id
@Column(name="domain_path")
private String domainPath;
@Column(name = "affinity_group_id")
private long affinityGroupId;
@Column(name = "affinity_group_uuid")
private String affinityGroupUuid;
public DataCenterJoinVO() {
}
@ -302,5 +308,11 @@ public class DataCenterJoinVO extends BaseViewVO implements InternalIdentity, Id
this.ip6Dns2 = ip6Dns2;
}
public long getAffinityGroupId() {
return affinityGroupId;
}
public String getAffinityGroupUuid() {
return affinityGroupUuid;
}
}

View File

@ -2321,3 +2321,39 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'manage
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.cache.replacement.enabled', 'true', 'enable or disable cache storage replacement algorithm.');
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.cache.replacement.interval', '86400', 'time interval between cache replacement threads (in seconds).');
DROP VIEW IF EXISTS `cloud`.`data_center_view`;
CREATE VIEW `cloud`.`data_center_view` AS
select
data_center.id,
data_center.uuid,
data_center.name,
data_center.is_security_group_enabled,
data_center.is_local_storage_enabled,
data_center.description,
data_center.dns1,
data_center.dns2,
data_center.ip6_dns1,
data_center.ip6_dns2,
data_center.internal_dns1,
data_center.internal_dns2,
data_center.guest_network_cidr,
data_center.domain,
data_center.networktype,
data_center.allocation_state,
data_center.zone_token,
data_center.dhcp_provider,
data_center.removed,
domain.id domain_id,
domain.uuid domain_uuid,
domain.name domain_name,
domain.path domain_path,
dedicated_resources.affinity_group_id,
affinity_group.uuid affinity_group_uuid
from
`cloud`.`data_center`
left join
`cloud`.`domain` ON data_center.domain_id = domain.id
left join
`cloud`.`dedicated_resources` ON data_center.id = dedicated_resources.data_center_id
left join
`cloud`.`affinity_group` ON dedicated_resources.affinity_group_id = affinity_group.id;