use of com.att.cdp.zones.Context in project AJSC by att.
the class AbstractVolume method updateVolume.
/**
* 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.
*
* updateVolume method is used to update the size of the volume (only increase)
*/
@Override
public Volume updateVolume(Volume template, Server server) throws ZoneException {
Context context = getContext();
Provider provider = context.getProvider();
throw new NotSupportedException(String.format("Provider %s does not support updateVolume using a volume object as a model", provider.getName()));
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class ConnectedServer method attachPort.
/**
* @see com.att.cdp.zones.model.Server#attachPort(com.att.cdp.zones.model.Port)
*/
@Override
public void attachPort(Port nic) throws ZoneException {
Context context = getContext();
ComputeService service = context.getComputeService();
service.attachPort(this, nic);
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class ConnectedServer method rebuild.
/**
* @see com.att.cdp.zones.model.Server#rebuild(java.lang.String)
*/
@Override
public void rebuild(String snapshot) throws ZoneException {
Context context = getContext();
context.getComputeService().rebuildServer(this, snapshot);
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class ConnectedServer method delete.
/**
* Delete the specified server using it's id.
*
* @throws ZoneException
* If the server does not exist or cannot be deleted for some reason.
*/
@Override
public void delete() throws ZoneException {
Context context = getContext();
context.getComputeService().deleteServer(this);
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackStackService method getStacks.
/**
* Obtains a list (unfiltered) of all stacks that exist on the provider and returns them to the caller.
*
* @return A list of all stacks that exist. Note that the list may be empty.
* @throws ZoneException
* - If the context is closed, a login has not occurred, or an error happened trying to contact the
* provider.
* @see com.att.cdp.zones.StackService#getStacks()
*/
@Override
public List<Stack> getStacks() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Orchestration");
RequestState.put(RequestState.SERVICE_URL, connector.getEndpoint());
ArrayList<Stack> list = new ArrayList<>();
Heat heat = connector.getClient();
StackResource resource = heat.getStacks();
try {
/*
* Get a list of stacks, then call byName api for each one to get the detail for the stack.
*/
Stacks osStacks = resource.list().execute();
if (osStacks != null) {
for (com.woorea.openstack.heat.model.Stack osStack : osStacks) {
list.add(getStack(osStack.getStackName(), osStack.getId()));
}
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
Aggregations