use of org.platformlayer.OpenstackClientException in project platformlayer by platformlayer.
the class GraphiteServiceController method doOperation.
public void doOperation(Managed<GraphiteService> managed) throws OpsException {
DiskImageRecipe recipe = imageFactory.loadDiskImageResource(getClass(), "DiskImageRecipe.xml");
String imageId = imageFactory.getOrCreateImage(recipe);
GraphiteService model = (GraphiteService) managed.getModel();
PersistentInstance persistentInstance = new PersistentInstance();
persistentInstance.setImageId(imageId);
persistentInstance.setDnsName(model.dnsName);
try {
platformLayer.create(persistentInstance);
} catch (OpenstackClientException e) {
throw new OpsException("Error registering persistent instance", e);
}
}
Aggregations