use of com.woorea.openstack.heat.model.CreateStackParam in project AJSC by att.
the class OpenStackStackService method createNativeStack.
/**
* This method is used to request a stack construction using whatever the native capabilities of the provider are.
* The caller of this method must know the inherent capabilities of the underlying provider they are using in order
* to use this method. Also, using this method partially violates and nullifies the benefits of the abstraction. The
* return value from this method will still be the <code>Stack</code> object that is represented in the abstraction.
*
* @throws ZoneException
* If there is a problem making the request
* @see com.att.cdp.zones.StackService#createNativeStack(java.lang.String, java.lang.String)
*/
@Override
public Stack createNativeStack(String stackName, String content) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Orchestration");
RequestState.put(RequestState.SERVICE_URL, connector.getEndpoint());
Heat heat = connector.getClient();
StackResource resource = heat.getStacks();
CreateStackParam model = new CreateStackParam();
model.setTimeoutMinutes(5);
model.setStackName(stackName);
model.setTemplate(content);
OpenStackStack stack = null;
try {
com.woorea.openstack.heat.model.Stack osStack = resource.create(model).execute();
if (osStack != null) {
stack = (OpenStackStack) getStack(stackName, osStack.getId());
// stack = new OpenStackStack(context, osStack);
// stack.setName(stackName);
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return stack;
}
Aggregations