Search in sources :

Example 6 with AffinityGroupResponse

use of org.apache.cloudstack.affinity.AffinityGroupResponse in project cloudstack by apache.

the class ApiResponseHelper method createAffinityGroupResponse.

@Override
public AffinityGroupResponse createAffinityGroupResponse(AffinityGroup group) {
    AffinityGroupResponse response = new AffinityGroupResponse();
    Account account = ApiDBUtils.findAccountById(group.getAccountId());
    response.setId(group.getUuid());
    response.setAccountName(account.getAccountName());
    response.setName(group.getName());
    response.setType(group.getType());
    response.setDescription(group.getDescription());
    Domain domain = ApiDBUtils.findDomainById(account.getDomainId());
    if (domain != null) {
        response.setDomainId(domain.getUuid());
        response.setDomainName(domain.getName());
    }
    response.setObjectName("affinitygroup");
    return response;
}
Also used : ProjectAccount(com.cloud.projects.ProjectAccount) UserAccount(com.cloud.user.UserAccount) Account(com.cloud.user.Account) AffinityGroupResponse(org.apache.cloudstack.affinity.AffinityGroupResponse) Domain(com.cloud.domain.Domain)

Aggregations

AffinityGroupResponse (org.apache.cloudstack.affinity.AffinityGroupResponse)6 ArrayList (java.util.ArrayList)4 Account (com.cloud.user.Account)3 Hashtable (java.util.Hashtable)3 ApiDBUtils (com.cloud.api.ApiDBUtils)2 ApiResponseHelper (com.cloud.api.ApiResponseHelper)2 UserVmJoinVO (com.cloud.api.query.vo.UserVmJoinVO)2 GPU (com.cloud.gpu.GPU)2 ServiceOfferingDetailsVO (com.cloud.service.ServiceOfferingDetailsVO)2 DiskOfferingVO (com.cloud.storage.DiskOfferingVO)2 GuestOS (com.cloud.storage.GuestOS)2 AccountManager (com.cloud.user.AccountManager)2 User (com.cloud.user.User)2 UserStatisticsVO (com.cloud.user.UserStatisticsVO)2 UserDao (com.cloud.user.dao.UserDao)2 UserStatisticsDao (com.cloud.user.dao.UserStatisticsDao)2 UserVm (com.cloud.uservm.UserVm)2 SearchBuilder (com.cloud.utils.db.SearchBuilder)2 SearchCriteria (com.cloud.utils.db.SearchCriteria)2 Op (com.cloud.utils.db.SearchCriteria.Op)2