use of com.cloud.network.OvsProvider in project cloudstack by apache.
the class ListOvsElementsCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
List<? extends OvsProvider> providers = _service.get(0).searchForOvsElement(this);
ListResponse<OvsProviderResponse> response = new ListResponse<OvsProviderResponse>();
List<OvsProviderResponse> providerResponses = new ArrayList<OvsProviderResponse>();
for (OvsProvider provider : providers) {
OvsProviderResponse providerResponse = _responseGenerator.createOvsProviderResponse(provider);
providerResponses.add(providerResponse);
}
response.setResponses(providerResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.network.OvsProvider in project cloudstack by apache.
the class ConfigureOvsElementCmd method execute.
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Ovs element: " + id);
OvsProvider result = _service.get(0).configure(this);
if (result != null) {
OvsProviderResponse ovsResponse = _responseGenerator.createOvsProviderResponse(result);
ovsResponse.setResponseName(getCommandName());
this.setResponseObject(ovsResponse);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure the ovs provider");
}
}
Aggregations