use of com.cloud.api.response.NetworkResponse in project cosmic by MissionCriticalCloud.
the class CreateNetworkCmdByAdmin method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public // an exception thrown by createNetwork() will be caught by the dispatcher.
void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException {
final Network result = _networkService.createGuestNetwork(this);
if (result != null) {
final NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Full, result);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create network");
}
}
use of com.cloud.api.response.NetworkResponse in project cosmic by MissionCriticalCloud.
the class CreateNetworkCmd method execute.
@Override
public // an exception thrown by createNetwork() will be caught by the dispatcher.
void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException {
final Network result = _networkService.createGuestNetwork(this);
if (result != null) {
final NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Restricted, result);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create network");
}
}
Aggregations