use of com.att.cdp.zones.model.Stack 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;
}
use of com.att.cdp.zones.model.Stack in project AJSC by att.
the class ConnectedStack method refresh.
/**
* @see com.att.cdp.zones.model.Stack#refresh()
*/
@Override
public void refresh() throws ZoneException {
Context context = getContext();
Stack copy = context.getStackService().getStack(getName(), getId());
ObjectMapper.map(copy, this);
}
Aggregations