use of com.att.cdp.openstack.model.OpenStackLoadBalancerMember in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerMemberById.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerMemberById(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public LoadBalancerMember getLoadBalancerMemberById(String id) throws ZoneException {
checkArg(id, "id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.LOADBALANCERMEMBER, id);
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
com.woorea.openstack.quantum.model.LoadBalancerMember n = quantumConnector.getClient().lbaas().Member().show(id).execute();
return new OpenStackLoadBalancerMember(context, n);
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return null;
}
use of com.att.cdp.openstack.model.OpenStackLoadBalancerMember in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerMembers.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerMembers()
*/
@Override
public List<LoadBalancerMember> getLoadBalancerMembers() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
ArrayList<LoadBalancerMember> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
LoadBalancerResource.Member resource = client.lbaas().Member();
for (com.woorea.openstack.quantum.model.LoadBalancerMember loadBalancerMember : resource.list().execute()) {
list.add(new OpenStackLoadBalancerMember(context, loadBalancerMember));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.att.cdp.openstack.model.OpenStackLoadBalancerMember in project AJSC by att.
the class OpenStackNetworkService method createLoadBalancerMember.
/**
* @see com.att.cdp.zones.NetworkService#createLoadBalancerMember(com.att.cdp.zones.model.LoadBalancerMember)
*/
@Override
public LoadBalancerMember createLoadBalancerMember(LoadBalancerMember loadBalancerMember) 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.LoadBalancerMember loadBalancerMemberToCreate = new com.woorea.openstack.quantum.model.LoadBalancerMember();
loadBalancerMemberToCreate.setAddress(loadBalancerMember.getAddress());
loadBalancerMemberToCreate.setPort(loadBalancerMember.getProtocolPort());
loadBalancerMemberToCreate.setPoolId(loadBalancerMember.getPoolId());
loadBalancerMemberToCreate.setWeight(loadBalancerMember.getWeight());
com.woorea.openstack.quantum.model.LoadBalancerMember openstackLbMember = client.lbaas().Member().create(loadBalancerMemberToCreate).execute();
return new OpenStackLoadBalancerMember(context, openstackLbMember);
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
use of com.att.cdp.openstack.model.OpenStackLoadBalancerMember in project AJSC by att.
the class OpenStackNetworkService method updateLoadBalancerMember.
/**
* @see com.att.cdp.zones.NetworkService#updateLoadBalancerMember(com.att.cdp.zones.model.LoadBalancerMember)
*/
@Override
public LoadBalancerMember updateLoadBalancerMember(LoadBalancerMember loadBalancerMember) 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.LoadBalancerMember loadBalancerMemberToCreate = new com.woorea.openstack.quantum.model.LoadBalancerMember();
loadBalancerMemberToCreate.setAddress(loadBalancerMember.getAddress());
loadBalancerMemberToCreate.setPort(loadBalancerMember.getProtocolPort());
loadBalancerMemberToCreate.setSubnetId(loadBalancerMember.getSubnetId());
com.woorea.openstack.quantum.model.LoadBalancerMember openstackLbMember = client.lbaas().Member().update(loadBalancerMemberToCreate).execute();
return new OpenStackLoadBalancerMember(context, openstackLbMember);
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
Aggregations