use of org.apache.cloudstack.network.opendaylight.api.responses.OpenDaylightControllerResponse in project cloudstack by apache.
the class ListOpenDaylightControllersCmd method execute.
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
List<OpenDaylightControllerVO> controllers = resourceManager.listControllers(this);
List<OpenDaylightControllerResponse> controllerList = new ArrayList<OpenDaylightControllerResponse>();
for (OpenDaylightControllerVO controller : controllers) {
OpenDaylightControllerResponse responseObject = resourceManager.createResponseFromVO(controller);
controllerList.add(responseObject);
}
ListResponse<OpenDaylightControllerResponse> responseList = new ListResponse<OpenDaylightControllerResponse>();
responseList.setResponseName(getCommandName());
responseList.setResponses(controllerList);
setResponseObject(responseList);
}
use of org.apache.cloudstack.network.opendaylight.api.responses.OpenDaylightControllerResponse in project cloudstack by apache.
the class OpenDaylightControllerResourceManagerImpl method createResponseFromVO.
@Override
public OpenDaylightControllerResponse createResponseFromVO(OpenDaylightControllerVO controller) {
OpenDaylightControllerResponse response = new OpenDaylightControllerResponse();
HostVO controllerHost = hostDao.findById(controller.getHostId());
hostDao.loadDetails(controllerHost);
PhysicalNetwork pnw = ApiDBUtils.findPhysicalNetworkById(controller.getPhysicalNetworkId());
if (pnw != null) {
response.setPhysicalNetworkId(pnw.getUuid());
}
response.setObjectName("opendaylightcontroller");
response.setId(controller.getUuid());
response.setUrl(controllerHost.getDetail("url"));
response.setName(controllerHost.getDetail("name"));
response.setUsername(controllerHost.getDetail("username"));
return response;
}
Aggregations