use of com.cloud.domain.DomainVO in project cloudstack by apache.
the class DedicatedResourceManagerImpl method getDomainChildIds.
private List<Long> getDomainChildIds(long domainId) {
DomainVO domainRecord = _domainDao.findById(domainId);
List<Long> domainIds = new ArrayList<Long>();
domainIds.add(domainRecord.getId());
// find all domain Ids till leaf
List<DomainVO> allChildDomains = _domainDao.findAllChildren(domainRecord.getPath(), domainRecord.getId());
for (DomainVO domain : allChildDomains) {
domainIds.add(domain.getId());
}
return domainIds;
}
use of com.cloud.domain.DomainVO in project cloudstack by apache.
the class DedicatedResourceManagerImpl method createDedicatePodResponse.
@Override
public DedicatePodResponse createDedicatePodResponse(DedicatedResources resource) {
DedicatePodResponse dedicatePodResponse = new DedicatePodResponse();
HostPodVO pod = _podDao.findById(resource.getPodId());
DomainVO domain = _domainDao.findById(resource.getDomainId());
AccountVO account = _accountDao.findById(resource.getAccountId());
AffinityGroup group = _affinityGroupDao.findById(resource.getAffinityGroupId());
dedicatePodResponse.setId(resource.getUuid());
dedicatePodResponse.setPodId(pod.getUuid());
dedicatePodResponse.setPodName(pod.getName());
dedicatePodResponse.setDomainId(domain.getUuid());
dedicatePodResponse.setAffinityGroupId(group.getUuid());
if (account != null) {
dedicatePodResponse.setAccountId(account.getUuid());
}
dedicatePodResponse.setObjectName("dedicatedpod");
return dedicatePodResponse;
}
use of com.cloud.domain.DomainVO in project cloudstack by apache.
the class DedicatedResourceManagerImpl method createDedicateHostResponse.
@Override
public DedicateHostResponse createDedicateHostResponse(DedicatedResources resource) {
DedicateHostResponse dedicateHostResponse = new DedicateHostResponse();
HostVO host = _hostDao.findById(resource.getHostId());
DomainVO domain = _domainDao.findById(resource.getDomainId());
AccountVO account = _accountDao.findById(resource.getAccountId());
AffinityGroup group = _affinityGroupDao.findById(resource.getAffinityGroupId());
dedicateHostResponse.setId(resource.getUuid());
dedicateHostResponse.setHostId(host.getUuid());
dedicateHostResponse.setHostName(host.getName());
dedicateHostResponse.setDomainId(domain.getUuid());
dedicateHostResponse.setAffinityGroupId(group.getUuid());
if (account != null) {
dedicateHostResponse.setAccountId(account.getUuid());
}
dedicateHostResponse.setObjectName("dedicatedhost");
return dedicateHostResponse;
}
use of com.cloud.domain.DomainVO in project cloudstack by apache.
the class DedicatedResourceManagerImpl method createDedicateZoneResponse.
@Override
public DedicateZoneResponse createDedicateZoneResponse(DedicatedResources resource) {
DedicateZoneResponse dedicateZoneResponse = new DedicateZoneResponse();
DataCenterVO dc = _zoneDao.findById(resource.getDataCenterId());
DomainVO domain = _domainDao.findById(resource.getDomainId());
AccountVO account = _accountDao.findById(resource.getAccountId());
AffinityGroup group = _affinityGroupDao.findById(resource.getAffinityGroupId());
dedicateZoneResponse.setId(resource.getUuid());
dedicateZoneResponse.setZoneId(dc.getUuid());
dedicateZoneResponse.setZoneName(dc.getName());
dedicateZoneResponse.setDomainId(domain.getUuid());
dedicateZoneResponse.setAffinityGroupId(group.getUuid());
if (account != null) {
dedicateZoneResponse.setAccountId(account.getUuid());
}
dedicateZoneResponse.setObjectName("dedicatedzone");
return dedicateZoneResponse;
}
use of com.cloud.domain.DomainVO in project cloudstack by apache.
the class DedicatedResourceManagerImpl method createDedicateClusterResponse.
@Override
public DedicateClusterResponse createDedicateClusterResponse(DedicatedResources resource) {
DedicateClusterResponse dedicateClusterResponse = new DedicateClusterResponse();
ClusterVO cluster = _clusterDao.findById(resource.getClusterId());
DomainVO domain = _domainDao.findById(resource.getDomainId());
AccountVO account = _accountDao.findById(resource.getAccountId());
AffinityGroup group = _affinityGroupDao.findById(resource.getAffinityGroupId());
dedicateClusterResponse.setId(resource.getUuid());
dedicateClusterResponse.setClusterId(cluster.getUuid());
dedicateClusterResponse.setClusterName(cluster.getName());
dedicateClusterResponse.setDomainId(domain.getUuid());
dedicateClusterResponse.setAffinityGroupId(group.getUuid());
if (account != null) {
dedicateClusterResponse.setAccountId(account.getUuid());
}
dedicateClusterResponse.setObjectName("dedicatedcluster");
return dedicateClusterResponse;
}
Aggregations