use of org.apache.cloudstack.api.response.ExternalLoadBalancerResponse in project cloudstack by apache.
the class AddExternalLoadBalancerCmd method execute.
@Override
public void execute() {
try {
Host externalLoadBalancer = _f5DeviceManagerService.addExternalLoadBalancer(this);
ExternalLoadBalancerResponse response = _f5DeviceManagerService.createExternalLoadBalancerResponse(externalLoadBalancer);
response.setObjectName("externalloadbalancer");
response.setResponseName(getCommandName());
this.setResponseObject(response);
} catch (InvalidParameterValueException ipve) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
} catch (CloudRuntimeException cre) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
}
}
use of org.apache.cloudstack.api.response.ExternalLoadBalancerResponse in project cloudstack by apache.
the class ExternalLoadBalancerDeviceManagerImpl method createExternalLoadBalancerResponse.
public ExternalLoadBalancerResponse createExternalLoadBalancerResponse(Host externalLoadBalancer) {
Map<String, String> lbDetails = _hostDetailDao.findDetails(externalLoadBalancer.getId());
ExternalLoadBalancerResponse response = new ExternalLoadBalancerResponse();
response.setId(externalLoadBalancer.getUuid());
response.setIpAddress(externalLoadBalancer.getPrivateIpAddress());
response.setUsername(lbDetails.get("username"));
response.setPublicInterface(lbDetails.get("publicInterface"));
response.setPrivateInterface(lbDetails.get("privateInterface"));
response.setNumRetries(lbDetails.get("numRetries"));
return response;
}
use of org.apache.cloudstack.api.response.ExternalLoadBalancerResponse in project cloudstack by apache.
the class ListExternalLoadBalancersCmd method execute.
@Override
public void execute() {
List<? extends Host> externalLoadBalancers = _f5DeviceManagerService.listExternalLoadBalancers(this);
ListResponse<ExternalLoadBalancerResponse> listResponse = new ListResponse<ExternalLoadBalancerResponse>();
List<ExternalLoadBalancerResponse> responses = new ArrayList<ExternalLoadBalancerResponse>();
for (Host externalLoadBalancer : externalLoadBalancers) {
ExternalLoadBalancerResponse response = _f5DeviceManagerService.createExternalLoadBalancerResponse(externalLoadBalancer);
response.setObjectName("externalloadbalancer");
response.setResponseName(getCommandName());
responses.add(response);
}
listResponse.setResponses(responses);
listResponse.setResponseName(getCommandName());
this.setResponseObject(listResponse);
}
Aggregations