use of com.cloud.api.ApiConstants.VMDetails in project cosmic by MissionCriticalCloud.
the class UpdateVMAffinityGroupCmdByAdmin method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException {
CallContext.current().setEventDetails("Vm Id: " + getId());
final UserVm result = _affinityGroupService.updateVMAffinityGroups(getId(), getAffinityGroupIdList());
final ArrayList<VMDetails> dc = new ArrayList<>();
dc.add(VMDetails.valueOf("affgrp"));
final EnumSet<VMDetails> details = EnumSet.copyOf(dc);
if (result != null) {
final UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Full, "virtualmachine", details, result).get(0);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update vm's affinity groups");
}
}
Aggregations