+
+ snf = ComputeClient(Config())
+
+ images = snf.list_images()
+ for image in images:
+ IMAGE = Mixin("http://schemas.ogf.org/occi/infrastructure#", str(image['name']), [OS_TEMPLATE])
+ self.register_backend(IMAGE, MixinBackend())
+
+ flavors = snf.list_flavors()
+ for flavor in flavors:
+ FLAVOR_ATTRIBUTES = {'occi.compute.cores': snf.get_flavor_details(flavor['id'])['cpu'],
+ 'occi.compute.memory': snf.get_flavor_details(flavor['id'])['ram'],
+ 'occi.storage.size': snf.get_flavor_details(flavor['id'])['disk'],
+ }
+ FLAVOR = Mixin("http://schemas.ogf.org/occi/infrastructure#", str(flavor['name']), [RESOURCE_TEMPLATE], attributes = FLAVOR_ATTRIBUTES)
+ self.register_backend(FLAVOR, MixinBackend())
+
+
+