Search in sources :

Example 1 with Extension

use of org.openstack.model.common.Extension in project platformlayer by platformlayer.

the class CloudBehaviours method getCachedInfo.

CachedInfo getCachedInfo() throws OpsException {
    // TODO: We key on endpoint, to avoid repeated calls.
    // Is it safe to assume that everyone has the same capabilities on a cloud??
    CachedInfo info = cachedInfo.get(cloud.endpoint);
    if (info == null) {
        OpenstackCloudHelpers helpers = new OpenstackCloudHelpers();
        OpenstackComputeClient compute = helpers.buildOpenstackComputeClient(cloud);
        List<Extension> extensions = Lists.newArrayList(compute.root().extensions().list());
        info = new CachedInfo(extensions);
        cachedInfo.put(cloud.endpoint, info);
    }
    return info;
}
Also used : Extension(org.openstack.model.common.Extension) OpenstackComputeClient(org.openstack.client.common.OpenstackComputeClient)

Aggregations

OpenstackComputeClient (org.openstack.client.common.OpenstackComputeClient)1 Extension (org.openstack.model.common.Extension)1