use of com.cloud.api.response.NetworkOfferingResponse in project CloudStack-archive by CloudStack-extras.
the class UpdateNetworkOfferingCmd method execute.
@Override
public void execute() {
NetworkOffering result = _configService.updateNetworkOffering(this);
if (result != null) {
NetworkOfferingResponse response = _responseGenerator.createNetworkOfferingResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update network offering");
}
}
use of com.cloud.api.response.NetworkOfferingResponse in project cosmic by MissionCriticalCloud.
the class UpdateNetworkOfferingCmd method execute.
@Override
public void execute() {
final NetworkOffering result = _configService.updateNetworkOffering(this);
if (result != null) {
final NetworkOfferingResponse response = _responseGenerator.createNetworkOfferingResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network offering");
}
}
use of com.cloud.api.response.NetworkOfferingResponse in project cosmic by MissionCriticalCloud.
the class ListNetworkOfferingsCmd method execute.
@Override
public void execute() {
final Pair<List<? extends NetworkOffering>, Integer> offerings = _configService.searchForNetworkOfferings(this);
final ListResponse<NetworkOfferingResponse> response = new ListResponse<>();
final List<NetworkOfferingResponse> offeringResponses = new ArrayList<>();
for (final NetworkOffering offering : offerings.first()) {
final NetworkOfferingResponse offeringResponse = _responseGenerator.createNetworkOfferingResponse(offering);
offeringResponses.add(offeringResponse);
}
response.setResponses(offeringResponses, offerings.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.NetworkOfferingResponse in project CloudStack-archive by CloudStack-extras.
the class ListNetworkOfferingsCmd method execute.
@Override
public void execute() {
List<? extends NetworkOffering> offerings = _configService.searchForNetworkOfferings(this);
ListResponse<NetworkOfferingResponse> response = new ListResponse<NetworkOfferingResponse>();
List<NetworkOfferingResponse> offeringResponses = new ArrayList<NetworkOfferingResponse>();
for (NetworkOffering offering : offerings) {
NetworkOfferingResponse offeringResponse = _responseGenerator.createNetworkOfferingResponse(offering);
offeringResponses.add(offeringResponse);
}
response.setResponses(offeringResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.NetworkOfferingResponse in project CloudStack-archive by CloudStack-extras.
the class CreateNetworkOfferingCmd method execute.
@Override
public void execute() {
NetworkOffering result = _configService.createNetworkOffering(this);
if (result != null) {
NetworkOfferingResponse response = _responseGenerator.createNetworkOfferingResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create network offering");
}
}
Aggregations