use of org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse in project cloudstack by apache.
the class ApiResponseHelper method createStorageNetworkIpRangeResponse.
@Override
public StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result) {
StorageNetworkIpRangeResponse response = new StorageNetworkIpRangeResponse();
response.setUuid(result.getUuid());
response.setVlan(result.getVlan());
response.setEndIp(result.getEndIp());
response.setStartIp(result.getStartIp());
response.setPodUuid(result.getPodUuid());
response.setZoneUuid(result.getZoneUuid());
response.setNetworkUuid(result.getNetworkUuid());
response.setNetmask(result.getNetmask());
response.setGateway(result.getGateway());
response.setObjectName("storagenetworkiprange");
return response;
}
use of org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse in project cloudstack by apache.
the class CreateStorageNetworkIpRangeCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
StorageNetworkIpRange result = _storageNetworkService.createIpRange(this);
StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn("Create storage network IP range failed", e);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
}
use of org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse in project cloudstack by apache.
the class ListStorageNetworkIpRangeCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
List<StorageNetworkIpRange> results = _storageNetworkService.listIpRange(this);
ListResponse<StorageNetworkIpRangeResponse> response = new ListResponse<StorageNetworkIpRangeResponse>();
List<StorageNetworkIpRangeResponse> resList = new ArrayList<StorageNetworkIpRangeResponse>(results.size());
for (StorageNetworkIpRange r : results) {
StorageNetworkIpRangeResponse resp = _responseGenerator.createStorageNetworkIpRangeResponse(r);
resList.add(resp);
}
response.setResponses(resList);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn("Failed to list storage network ip range for rangeId=" + getRangeId() + " podId=" + getPodId() + " zoneId=" + getZoneId());
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
}
use of org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse in project cloudstack by apache.
the class UpdateStorageNetworkIpRangeCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
StorageNetworkIpRange result = _storageNetworkService.updateIpRange(this);
StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn("Update storage network IP range failed", e);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
}
Aggregations