Search in sources :

Example 11 with Context

use of com.att.cdp.zones.Context in project AJSC by att.

the class ConnectedServer method releaseIpAddress.

/**
 * @see com.att.cdp.zones.model.Server#releaseIpAddress(java.lang.String)
 */
@Override
public void releaseIpAddress(String address) throws ZoneException {
    Context context = getContext();
    context.getComputeService().releaseIpAddress(this, address);
}
Also used : Context(com.att.cdp.zones.Context)

Example 12 with Context

use of com.att.cdp.zones.Context in project AJSC by att.

the class ConnectedServer method getFixedIpsViaInterfaces.

/**
 * @see com.att.cdp.zones.model.Server#getFixedIpsViaInterfaces()
 */
@Override
public List<String> getFixedIpsViaInterfaces() throws ZoneException {
    Context context = getContext();
    List<String> ipAddrList = null;
    List<com.att.cdp.zones.model.Port> ports = context.getNetworkService().getInterfaces(getId());
    if (ports != null && ports.size() > 0) {
        LOG.info("getFixedIpViaInterfaces(): ports={}", ports);
        ipAddrList = ports.get(0).getAddresses();
    } else {
        LOG.warn("getFixedIpViaInterfaces(): No ports found!");
    }
    return ipAddrList;
}
Also used : Context(com.att.cdp.zones.Context) Port(com.att.cdp.zones.model.Port)

Example 13 with Context

use of com.att.cdp.zones.Context in project AJSC by att.

the class ConnectedServer method assignIp.

/**
 * @see com.att.cdp.zones.model.Server#assignIp(java.lang.String)
 */
@Override
public void assignIp(String address) throws ZoneException {
    Context context = getContext();
    context.getComputeService().assignIpAddress(this, address);
}
Also used : Context(com.att.cdp.zones.Context)

Example 14 with Context

use of com.att.cdp.zones.Context in project AJSC by att.

the class ConnectedVolume method refresh.

/**
 * @see com.att.cdp.zones.model.Volume#refresh()
 */
@Override
public void refresh() throws ZoneException {
    Context context = getContext();
    Volume copy = context.getVolumeService().getVolume(getId());
    ObjectMapper.map(copy, this);
}
Also used : Context(com.att.cdp.zones.Context) Volume(com.att.cdp.zones.model.Volume)

Example 15 with Context

use of com.att.cdp.zones.Context in project AJSC by att.

the class AbstractVolume method getVolumes.

/**
 * This is a default implementation that is correct for all providers other than VMware. The VMware provider
 * overrides this method. Any other providers that want to implement this method may also override it if needed.
 *
 *    getVolumes methods gives a list of volumes for a particular model
 */
@Override
public List<Volume> getVolumes(Server server) throws ZoneException {
    Context context = getContext();
    Provider provider = context.getProvider();
    throw new NotSupportedException(String.format("Provider %s does not support getVolumebyServer Id using  a model", provider.getName()));
}
Also used : Context(com.att.cdp.zones.Context) NotSupportedException(com.att.cdp.exceptions.NotSupportedException) Provider(com.att.cdp.zones.Provider)

Aggregations

Context (com.att.cdp.zones.Context)248 OpenStackContext (com.att.cdp.openstack.OpenStackContext)167 OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)140 ArrayList (java.util.ArrayList)55 Ignore (org.junit.Ignore)50 Test (org.junit.Test)47 Quantum (com.woorea.openstack.quantum.Quantum)35 ZoneException (com.att.cdp.exceptions.ZoneException)30 NetworkService (com.att.cdp.zones.NetworkService)24 Server (com.att.cdp.zones.model.Server)22 ComputeService (com.att.cdp.zones.ComputeService)21 Network (com.att.cdp.zones.model.Network)19 OpenStackServer (com.att.cdp.openstack.model.OpenStackServer)18 OpenStackSnapshot (com.att.cdp.openstack.model.OpenStackSnapshot)18 Subnet (com.att.cdp.zones.model.Subnet)15 Port (com.att.cdp.zones.model.Port)14 Snapshot (com.att.cdp.zones.model.Snapshot)12 Volume (com.att.cdp.zones.model.Volume)11 OpenStackResponseException (com.woorea.openstack.base.client.OpenStackResponseException)11 ResourceNotFoundException (com.att.cdp.exceptions.ResourceNotFoundException)10