Deploy/destroy example
[osm/N2VC.git] / juju / delta.py
index 247c81d..ea15f24 100644 (file)
@@ -4,6 +4,7 @@ from .client import client
 def get_entity_delta(d):
     _delta_types = {
         'application': ApplicationDelta,
+        'annotation': AnnotationDelta,
         'machine': MachineDelta,
         'unit': UnitDelta,
         'action': ActionDelta,
@@ -14,7 +15,7 @@ def get_entity_delta(d):
 
 class EntityDelta(client.Delta):
     def get_id(self):
-        return self.data['Id']
+        return self.data['id']
 
     def get_entity_class(self):
         return None
@@ -22,13 +23,22 @@ class EntityDelta(client.Delta):
 
 class ApplicationDelta(EntityDelta):
     def get_id(self):
-        return self.data['Name']
+        return self.data['name']
 
     def get_entity_class(self):
         from .application import Application
         return Application
 
 
+class AnnotationDelta(EntityDelta):
+    def get_id(self):
+        return self.data['tag']
+
+    def get_entity_class(self):
+        from .annotation import Annotation
+        return Annotation
+
+
 class MachineDelta(EntityDelta):
     def get_entity_class(self):
         from .machine import Machine
@@ -37,7 +47,7 @@ class MachineDelta(EntityDelta):
 
 class UnitDelta(EntityDelta):
     def get_id(self):
-        return self.data['Name']
+        return self.data['name']
 
     def get_entity_class(self):
         from .unit import Unit