use of com.cloud.api.response.StoragePoolResponse in project CloudStack-archive by CloudStack-extras.
the class PreparePrimaryStorageForMaintenanceCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException {
StoragePool result = _storageService.preparePrimaryStorageForMaintenance(getId());
if (result != null) {
StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
response.setResponseName("storagepool");
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to prepare primary storage for maintenance");
}
}
use of com.cloud.api.response.StoragePoolResponse in project CloudStack-archive by CloudStack-extras.
the class UpdateStoragePoolCmd method execute.
@Override
public void execute() {
StoragePool result = _storageService.updateStoragePool(this);
if (result != null) {
StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update storage pool");
}
}
use of com.cloud.api.response.StoragePoolResponse in project CloudStack-archive by CloudStack-extras.
the class ListStoragePoolsCmd method execute.
@Override
public void execute() {
List<? extends StoragePool> pools = _mgr.searchForStoragePools(this);
ListResponse<StoragePoolResponse> response = new ListResponse<StoragePoolResponse>();
List<StoragePoolResponse> poolResponses = new ArrayList<StoragePoolResponse>();
for (StoragePool pool : pools) {
StoragePoolResponse poolResponse = _responseGenerator.createStoragePoolResponse(pool);
poolResponse.setObjectName("storagepool");
poolResponses.add(poolResponse);
}
response.setResponses(poolResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.StoragePoolResponse in project cosmic by MissionCriticalCloud.
the class PreparePrimaryStorageForMaintenanceCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException {
final StoragePool result = _storageService.preparePrimaryStorageForMaintenance(getId());
if (result != null) {
final StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
response.setResponseName("storagepool");
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to prepare primary storage for maintenance");
}
}
use of com.cloud.api.response.StoragePoolResponse in project cosmic by MissionCriticalCloud.
the class CancelPrimaryStorageMaintenanceCmd method execute.
@Override
public void execute() throws ResourceUnavailableException {
final StoragePool result = _storageService.cancelPrimaryStorageForMaintenance(this);
if (result != null) {
final StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to cancel primary storage maintenance");
}
}
Aggregations