use of com.cloud.api.response.VlanIpRangeResponse in project CloudStack-archive by CloudStack-extras.
the class CreateVlanIpRangeCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, ResourceAllocationException {
try {
Vlan result = _configService.createVlanAndPublicIpRange(this);
if (result != null) {
VlanIpRangeResponse response = _responseGenerator.createVlanIpRangeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create vlan ip range");
}
} catch (ConcurrentOperationException ex) {
s_logger.warn("Exception: ", ex);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
} catch (InsufficientCapacityException ex) {
s_logger.info(ex);
throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
}
}
use of com.cloud.api.response.VlanIpRangeResponse in project CloudStack-archive by CloudStack-extras.
the class ListVlanIpRangesCmd method execute.
@Override
public void execute() {
List<? extends Vlan> vlans = _mgr.searchForVlans(this);
ListResponse<VlanIpRangeResponse> response = new ListResponse<VlanIpRangeResponse>();
List<VlanIpRangeResponse> vlanResponses = new ArrayList<VlanIpRangeResponse>();
for (Vlan vlan : vlans) {
VlanIpRangeResponse vlanResponse = _responseGenerator.createVlanIpRangeResponse(vlan);
vlanResponse.setObjectName("vlaniprange");
vlanResponses.add(vlanResponse);
}
response.setResponses(vlanResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
Aggregations