Search in sources :

Example 1 with Context

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

the class DummyIdentity method getTenant.

/**
 * @see com.att.cdp.zones.Service#getTenant()
 */
@Override
public Tenant getTenant() throws ZoneException {
    checkLoggedIn();
    Context context = getContext();
    return ((DummyProviderContext) context).getTenant();
}
Also used : AbstractContext(com.att.cdp.zones.spi.AbstractContext) Context(com.att.cdp.zones.Context)

Example 2 with Context

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

the class ConnectedHypervisor method refreshStatus.

/**
 * @see com.att.cdp.zones.model.Hypervisor#refreshStatus()
 */
@Override
public void refreshStatus() throws ZoneException {
    Context context = getContext();
    context.getComputeService().refreshHypervisorStatus(this);
}
Also used : Context(com.att.cdp.zones.Context)

Example 3 with Context

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

the class ConnectedImage method refreshAll.

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

Example 4 with Context

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

the class ConnectedServer method assignIpAddressFromPool.

/**
 * @see com.att.cdp.zones.model.Server#assignIpAddressFromPool()
 */
@Override
public String assignIpAddressFromPool() throws ZoneException {
    Context context = getContext();
    List<String> pools = context.getNetworkService().getFloatingIpPools();
    if (pools == null || pools.isEmpty()) {
        throw new InvalidRequestException(EELFResourceManager.format(Msg.NO_FLOATING_IP_POOL));
    }
    return assignIpAddressFromPool(pools.get(0));
}
Also used : Context(com.att.cdp.zones.Context) InvalidRequestException(com.att.cdp.exceptions.InvalidRequestException)

Example 5 with Context

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

the class ConnectedServer method suspend.

/**
 * @see com.att.cdp.zones.model.Server#suspend()
 */
@Override
public void suspend() throws ZoneException {
    Context context = getContext();
    context.getComputeService().suspendServer(this);
}
Also used : Context(com.att.cdp.zones.Context)

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