Search in sources :

Example 1 with GraphiteService

use of org.platformlayer.service.graphite.model.GraphiteService 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);
    }
}
Also used : GraphiteService(org.platformlayer.service.graphite.model.GraphiteService) OpsException(org.platformlayer.ops.OpsException) DiskImageRecipe(org.platformlayer.service.imagefactory.v1.DiskImageRecipe) PersistentInstance(org.platformlayer.service.instancesupervisor.v1.PersistentInstance) OpenstackClientException(org.platformlayer.OpenstackClientException)

Aggregations

OpenstackClientException (org.platformlayer.OpenstackClientException)1 OpsException (org.platformlayer.ops.OpsException)1 GraphiteService (org.platformlayer.service.graphite.model.GraphiteService)1 DiskImageRecipe (org.platformlayer.service.imagefactory.v1.DiskImageRecipe)1 PersistentInstance (org.platformlayer.service.instancesupervisor.v1.PersistentInstance)1