use of com.att.cdp.openstack.model.OpenStackLoadBalancerHealthMonitor in project AJSC by att.
the class OpenStackNetworkService method createLoadBalancerHealthMonitor.
/**
* @see com.att.cdp.zones.NetworkService#createLoadBalancerHealthMonitor(com.att.cdp.zones.model.LoadBalancerHealthMonitor)
*/
@Override
public LoadBalancerHealthMonitor createLoadBalancerHealthMonitor(LoadBalancerHealthMonitor loadBalancerHealthMonitor) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor loadBalancerHealthMonitorToCreate = new com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor();
if (loadBalancerHealthMonitor.getType() != null) {
loadBalancerHealthMonitorToCreate.setType(loadBalancerHealthMonitor.getType().name());
}
loadBalancerHealthMonitorToCreate.setDelay(loadBalancerHealthMonitor.getDelay());
loadBalancerHealthMonitorToCreate.setTimeout(loadBalancerHealthMonitor.getTimeout());
loadBalancerHealthMonitorToCreate.setMaxRetries(loadBalancerHealthMonitor.getMaxRetries());
loadBalancerHealthMonitorToCreate.setUrlPath(loadBalancerHealthMonitor.getUrlPath());
loadBalancerHealthMonitorToCreate.setExpectedCodes(loadBalancerHealthMonitor.getExpectedCodes());
com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor openstackLbMonitor = client.lbaas().HealthMonitor().create(loadBalancerHealthMonitorToCreate).execute();
return new OpenStackLoadBalancerHealthMonitor(context, openstackLbMonitor);
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
use of com.att.cdp.openstack.model.OpenStackLoadBalancerHealthMonitor in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerHealthMonitors.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerHealthMonitors()
*/
@Override
public List<LoadBalancerHealthMonitor> getLoadBalancerHealthMonitors() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
ArrayList<LoadBalancerHealthMonitor> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
LoadBalancerResource.HealthMonitor resource = client.lbaas().HealthMonitor();
for (com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor loadBalancerHealthMonitor : resource.list().execute()) {
list.add(new OpenStackLoadBalancerHealthMonitor(context, loadBalancerHealthMonitor));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.att.cdp.openstack.model.OpenStackLoadBalancerHealthMonitor in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerHealthMonitorById.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerHealthMonitorById(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public LoadBalancerHealthMonitor getLoadBalancerHealthMonitorById(String id) throws ZoneException {
checkArg(id, "id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.LOADBALANCERHEALTHMONITOR, id);
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor n = quantumConnector.getClient().lbaas().HealthMonitor().show(id).execute();
return new OpenStackLoadBalancerHealthMonitor(context, n);
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return null;
}
use of com.att.cdp.openstack.model.OpenStackLoadBalancerHealthMonitor in project AJSC by att.
the class OpenStackNetworkService method updateLoadBalancerHealthMonitor.
/**
* @see com.att.cdp.zones.NetworkService#updateLoadBalancerHealthMonitor(com.att.cdp.zones.model.LoadBalancerHealthMonitor)
*/
@SuppressWarnings("nls")
@Override
public LoadBalancerHealthMonitor updateLoadBalancerHealthMonitor(LoadBalancerHealthMonitor loadBalancerHealthMonitor) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor loadBalancerHealthMonitorToCreate = new com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor();
if (loadBalancerHealthMonitor.getType() != null) {
loadBalancerHealthMonitorToCreate.setType(loadBalancerHealthMonitor.getType().name());
}
loadBalancerHealthMonitorToCreate.setDelay(loadBalancerHealthMonitor.getDelay());
loadBalancerHealthMonitorToCreate.setTimeout(loadBalancerHealthMonitor.getTimeout());
loadBalancerHealthMonitorToCreate.setMaxRetries(loadBalancerHealthMonitor.getMaxRetries());
loadBalancerHealthMonitorToCreate.setUrlPath(loadBalancerHealthMonitor.getUrlPath());
loadBalancerHealthMonitorToCreate.setExpectedCodes(loadBalancerHealthMonitor.getExpectedCodes());
com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor openstackLbMonitor = client.lbaas().HealthMonitor().update(loadBalancerHealthMonitorToCreate).execute();
return new OpenStackLoadBalancerHealthMonitor(context, openstackLbMonitor);
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
Aggregations