use of com.cloud.api.response.HypervisorCapabilitiesResponse in project CloudStack-archive by CloudStack-extras.
the class UpdateHypervisorCapabilitiesCmd method execute.
@Override
public void execute() {
HypervisorCapabilities result = _mgr.updateHypervisorCapabilities(getId(), getMaxGuestsLimit(), getSecurityGroupEnabled());
if (result != null) {
HypervisorCapabilitiesResponse response = _responseGenerator.createHypervisorCapabilitiesResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update hypervisor capabilities");
}
}
use of com.cloud.api.response.HypervisorCapabilitiesResponse in project cosmic by MissionCriticalCloud.
the class ListHypervisorCapabilitiesCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final Pair<List<? extends HypervisorCapabilities>, Integer> hpvCapabilities = _mgr.listHypervisorCapabilities(getId(), getHypervisor(), getKeyword(), this.getStartIndex(), this.getPageSizeVal());
final ListResponse<HypervisorCapabilitiesResponse> response = new ListResponse<>();
final List<HypervisorCapabilitiesResponse> hpvCapabilitiesResponses = new ArrayList<>();
for (final HypervisorCapabilities capability : hpvCapabilities.first()) {
final HypervisorCapabilitiesResponse hpvCapabilityResponse = _responseGenerator.createHypervisorCapabilitiesResponse(capability);
hpvCapabilityResponse.setObjectName("hypervisorCapabilities");
hpvCapabilitiesResponses.add(hpvCapabilityResponse);
}
response.setResponses(hpvCapabilitiesResponses, hpvCapabilities.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.HypervisorCapabilitiesResponse in project cosmic by MissionCriticalCloud.
the class UpdateHypervisorCapabilitiesCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final HypervisorCapabilities result = _mgr.updateHypervisorCapabilities(getId(), getMaxGuestsLimit());
if (result != null) {
final HypervisorCapabilitiesResponse response = _responseGenerator.createHypervisorCapabilitiesResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update hypervisor capabilities");
}
}
use of com.cloud.api.response.HypervisorCapabilitiesResponse in project CloudStack-archive by CloudStack-extras.
the class ListHypervisorCapabilitiesCmd method execute.
@Override
public void execute() {
List<? extends HypervisorCapabilities> hpvCapabilities = _mgr.listHypervisorCapabilities(getId(), getHypervisor(), getKeyword(), this.getStartIndex(), this.getPageSizeVal());
ListResponse<HypervisorCapabilitiesResponse> response = new ListResponse<HypervisorCapabilitiesResponse>();
List<HypervisorCapabilitiesResponse> hpvCapabilitiesResponses = new ArrayList<HypervisorCapabilitiesResponse>();
for (HypervisorCapabilities capability : hpvCapabilities) {
HypervisorCapabilitiesResponse hpvCapabilityResponse = _responseGenerator.createHypervisorCapabilitiesResponse(capability);
hpvCapabilityResponse.setObjectName("hypervisorCapabilities");
hpvCapabilitiesResponses.add(hpvCapabilityResponse);
}
response.setResponses(hpvCapabilitiesResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.HypervisorCapabilitiesResponse in project cosmic by MissionCriticalCloud.
the class ApiResponseHelper method createHypervisorCapabilitiesResponse.
@Override
public HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(final HypervisorCapabilities hpvCapabilities) {
final HypervisorCapabilitiesResponse hpvCapabilitiesResponse = new HypervisorCapabilitiesResponse();
hpvCapabilitiesResponse.setId(hpvCapabilities.getUuid());
hpvCapabilitiesResponse.setHypervisor(hpvCapabilities.getHypervisorType());
hpvCapabilitiesResponse.setHypervisorVersion(hpvCapabilities.getHypervisorVersion());
hpvCapabilitiesResponse.setMaxGuestsLimit(hpvCapabilities.getMaxGuestsLimit());
hpvCapabilitiesResponse.setMaxDataVolumesLimit(hpvCapabilities.getMaxDataVolumesLimit());
hpvCapabilitiesResponse.setMaxHostsPerCluster(hpvCapabilities.getMaxHostsPerCluster());
hpvCapabilitiesResponse.setIsStorageMotionSupported(hpvCapabilities.isStorageMotionSupported());
return hpvCapabilitiesResponse;
}
Aggregations