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