Search in sources :

Example 16 with Quantum

use of com.woorea.openstack.quantum.Quantum in project AJSC by att.

the class TestQuantumConnector method testGlanceConnector.

@Test
@Ignore
public void testGlanceConnector() throws ZoneException {
    OpenStackContext context = login();
    QuantumConnector connector = context.getQuantumConnector();
    assertNotNull(connector);
    Access access = connector.getAccess();
    assertNotNull(access);
    Quantum client = connector.getClient();
    assertNotNull(client);
    logout(context);
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Quantum(com.woorea.openstack.quantum.Quantum) Access(com.woorea.openstack.keystone.model.Access) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 17 with Quantum

use of com.woorea.openstack.quantum.Quantum in project AJSC by att.

the class OpenStackNetworkService method deleteLoadBalancerHealthMonitor.

/**
 * @see com.att.cdp.zones.NetworkService#deleteLoadBalancerHealthMonitor(com.att.cdp.zones.model.LoadBalancerHealthMonitor)
 */
@SuppressWarnings("nls")
@Override
public void deleteLoadBalancerHealthMonitor(LoadBalancerHealthMonitor loadBalancerHealthMonitor) throws ZoneException {
    checkArg(loadBalancerHealthMonitor, "loadBalancerHealthMonitor");
    connect();
    Context context = getContext();
    trackRequest();
    RequestState.put(RequestState.LOADBALANCERHEALTHMONITOR, loadBalancerHealthMonitor.getId());
    RequestState.put(RequestState.SERVICE, "Network");
    RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
    try {
        Quantum client = quantumConnector.getClient();
        client.lbaas().HealthMonitor().delete(loadBalancerHealthMonitor.getId()).execute();
    } catch (OpenStackBaseException e) {
        ExceptionMapper.mapException(e);
    }
}
Also used : Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext) Quantum(com.woorea.openstack.quantum.Quantum) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException)

Example 18 with Quantum

use of com.woorea.openstack.quantum.Quantum in project AJSC by att.

the class OpenStackNetworkService method getNetworkExtensions.

/**
 * @return List of extensions
 * @throws ZoneException
 *             If the context cannot be used to obtain the list of extensions
 * @see com.att.cdp.zones.NetworkService#getNetworks()
 */
@SuppressWarnings("nls")
public List<Extension> getNetworkExtensions() throws ZoneException {
    connect();
    trackRequest();
    RequestState.put(RequestState.SERVICE, "Network");
    RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
    ArrayList<Extension> list = new ArrayList<>();
    try {
        Quantum client = quantumConnector.getClient();
        ExtensionsResource res = new ExtensionsResource(client);
        for (com.woorea.openstack.nova.model.Extension ext : res.list(false).execute()) {
            list.add(ext);
        }
    } catch (OpenStackBaseException e) {
        ExceptionMapper.mapException(e);
    }
    return list;
}
Also used : Extension(com.woorea.openstack.nova.model.Extension) FloatingIpsExtension(com.woorea.openstack.nova.api.extensions.FloatingIpsExtension) Quantum(com.woorea.openstack.quantum.Quantum) Extension(com.woorea.openstack.nova.model.Extension) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException) ArrayList(java.util.ArrayList) ExtensionsResource(com.woorea.openstack.nova.api.ExtensionsResource)

Example 19 with Quantum

use of com.woorea.openstack.quantum.Quantum 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;
}
Also used : Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext) Quantum(com.woorea.openstack.quantum.Quantum) OpenStackLoadBalancerMember(com.att.cdp.openstack.model.OpenStackLoadBalancerMember) LoadBalancerMember(com.att.cdp.zones.model.LoadBalancerMember) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException) OpenStackLoadBalancerMember(com.att.cdp.openstack.model.OpenStackLoadBalancerMember)

Example 20 with Quantum

use of com.woorea.openstack.quantum.Quantum in project AJSC by att.

the class OpenStackNetworkService method disassociateLoadBalancerHealthMonitorWithPool.

/**
 * @see com.att.cdp.zones.NetworkService#disassociateLoadBalancerHealthMonitorWithPool(java.lang.String,
 *      java.lang.String)
 */
@SuppressWarnings("nls")
@Override
public void disassociateLoadBalancerHealthMonitorWithPool(String poolId, String healthMonitorId) throws ZoneException {
    checkArg(poolId, "poolId");
    checkArg(healthMonitorId, "healthMonitorId");
    connect();
    Context context = getContext();
    trackRequest();
    RequestState.put(RequestState.LOADBALANCERPOOL, poolId);
    RequestState.put(RequestState.LOADBALANCERHEALTHMONITOR, healthMonitorId);
    RequestState.put(RequestState.SERVICE, "Network");
    RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
    try {
        Quantum client = quantumConnector.getClient();
        client.lbaas().Pool().disassociateMonitor(poolId, healthMonitorId).execute();
    } catch (OpenStackBaseException e) {
        ExceptionMapper.mapException(e);
    }
}
Also used : Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext) Quantum(com.woorea.openstack.quantum.Quantum) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException)

Aggregations

Quantum (com.woorea.openstack.quantum.Quantum)37 OpenStackContext (com.att.cdp.openstack.OpenStackContext)36 OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)36 Context (com.att.cdp.zones.Context)35 ArrayList (java.util.ArrayList)15 LoadBalancerResource (com.woorea.openstack.quantum.api.LoadBalancerResource)7 OpenStackLoadBalancerPool (com.att.cdp.openstack.model.OpenStackLoadBalancerPool)5 LoadBalancerPool (com.att.cdp.zones.model.LoadBalancerPool)5 OpenStackLoadBalancerVIP (com.att.cdp.openstack.model.OpenStackLoadBalancerVIP)4 OpenStackNetwork (com.att.cdp.openstack.model.OpenStackNetwork)4 OpenStackSubnet (com.att.cdp.openstack.model.OpenStackSubnet)4 Network (com.att.cdp.zones.model.Network)4 AbstractNetwork (com.att.cdp.zones.spi.AbstractNetwork)4 OpenStackLoadBalancerHealthMonitor (com.att.cdp.openstack.model.OpenStackLoadBalancerHealthMonitor)3 OpenStackLoadBalancerMember (com.att.cdp.openstack.model.OpenStackLoadBalancerMember)3 OpenStackPort (com.att.cdp.openstack.model.OpenStackPort)3 LoadBalancerHealthMonitor (com.att.cdp.zones.model.LoadBalancerHealthMonitor)3 LoadBalancerMember (com.att.cdp.zones.model.LoadBalancerMember)3 Subnet (com.att.cdp.zones.model.Subnet)3 SubnetsResource (com.woorea.openstack.quantum.api.SubnetsResource)3