heat = new Heat(getEndpoint(), getClientConnector()); heat.setLogger(getLogger()); heat.token(getAccess().getToken().getId()); String trustedHosts = context.getProperties().getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS, ""); if (proxyHost != null && proxyHost.length() > 0) { heat.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_HOST, proxyHost); heat.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_PORT, proxyPort); heat.getProperties() .setProperty(com.woorea.openstack.common.client.Constants.TRUST_HOST_LIST, trustedHosts);
Heat heat = new Heat(endpointURL); heat.setTokenProvider(keystone .getProviderByTenant(ExamplesConfiguration.TENANT_NAME)); param.setTemplate(TEMPLATE); System.out.printf("Create: " + heat.getStacks().create(param).execute()); Thread.sleep(3000); for (Stack s : heat.getStacks().list().execute()) { System.out.println(s.getDescription()); System.out.println(s.getId()); System.out.println(s.getLinks()); System.out.println(heat.getStacks().byName(s.getStackName()).execute());
StackResource resource = heat.getStacks();
/** * Updates the expired token by re-authenticating, getting a new unexpired token (in the access object), and then * updating the token held by this client wrapped by this connector to use the new token. * * @see com.att.cdp.openstack.connectors.Connector#updateToken() */ @Override public void updateToken() { super.updateToken(); heat.token(getAccess().getToken().getId()); }
/** * @see com.att.cdp.zones.StackService#deleteStack(java.lang.String, java.lang.String) */ @Override public void deleteStack(String stackName, String stackId) throws ZoneException { connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVICE, "Orchestration"); RequestState.put(RequestState.SERVICE_URL, connector.getEndpoint()); Heat heat = connector.getClient(); try { heat.getStacks().delete(stackName, stackId).execute(); } catch (OpenStackBaseException e) { ExceptionMapper.mapException(e); } }
/** * @see com.att.cdp.zones.StackService#getStack(java.lang.String, java.lang.String) */ @Override public Stack getStack(String name, String id) throws ZoneException { connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVICE, "Orchestration"); RequestState.put(RequestState.SERVICE_URL, connector.getEndpoint()); Heat heat = connector.getClient(); OpenStackStack stack = null; try { com.woorea.openstack.heat.model.Stack osStack = heat.getStacks().get(name, id).execute(); stack = new OpenStackStack(context, osStack); } catch (OpenStackBaseException e) { ExceptionMapper.mapException(e); } // TODO Parse OpenStack stack and construct the generic stack model return stack; }
StackResource resource = heat.getStacks(); CreateStackParam model = new CreateStackParam(); model.setTimeoutMinutes(5);