- define/modify logging variables
authorTony Mack <tmack@cs.princeton.edu>
Wed, 15 Nov 2006 21:36:04 +0000 (21:36 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 15 Nov 2006 21:36:04 +0000 (21:36 +0000)
30 files changed:
PLC/Methods/DeleteAddress.py
PLC/Methods/DeleteAddressType.py
PLC/Methods/DeleteAddressTypeFromAddress.py
PLC/Methods/DeleteBootState.py
PLC/Methods/DeleteConfFile.py
PLC/Methods/DeleteConfFileFromNode.py
PLC/Methods/DeleteConfFileFromNodeGroup.py
PLC/Methods/DeleteKey.py
PLC/Methods/DeleteKeyType.py
PLC/Methods/DeleteMessage.py
PLC/Methods/DeleteNetworkMethod.py
PLC/Methods/DeleteNetworkType.py
PLC/Methods/DeleteNode.py
PLC/Methods/DeleteNodeFromNodeGroup.py
PLC/Methods/DeleteNodeFromPCU.py
PLC/Methods/DeleteNodeGroup.py
PLC/Methods/DeleteNodeNetwork.py
PLC/Methods/DeletePCU.py
PLC/Methods/DeletePerson.py
PLC/Methods/DeletePersonFromSite.py
PLC/Methods/DeletePersonFromSlice.py
PLC/Methods/DeleteRole.py
PLC/Methods/DeleteRoleFromPerson.py
PLC/Methods/DeleteSession.py
PLC/Methods/DeleteSite.py
PLC/Methods/DeleteSlice.py
PLC/Methods/DeleteSliceAttribute.py
PLC/Methods/DeleteSliceAttributeType.py
PLC/Methods/DeleteSliceFromNodes.py
PLC/Methods/DeleteSliceInstantiation.py

index 99f1f51..24ec758 100644 (file)
@@ -21,6 +21,9 @@ class DeleteAddress(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+    
+    event_type = 'Delete'
+    object_type = 'Address'
 
     def call(self, auth, address_id):
         # Get associated address details
@@ -34,5 +37,6 @@ class DeleteAddress(Method):
                 raise PLCPermissionDenied, "Address must be associated with one of your sites"
 
         address.delete()
+        self.object_ids = [address['address_id']]
 
         return 1
index 662af3d..e3ed947 100644 (file)
@@ -21,12 +21,15 @@ class DeleteAddressType(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'AddressType'
+
     def call(self, auth, address_type_id_or_name):
         address_types = AddressTypes(self.api, [address_type_id_or_name])
         if not address_types:
             raise PLCInvalidArgument, "No such address type"
         address_type = address_types[0]
-
         address_type.delete()
+       self.object_ids = [address_type['address_type_id']]
 
         return 1
index 3078737..9cd279c 100644 (file)
@@ -24,6 +24,9 @@ class DeleteAddressTypeFromAddress(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+    
+    event_type = 'DeleteFrom'
+    object_type = 'Address'
 
     def call(self, auth, address_type_id_or_name, address_id):
         address_types = AddressTypes(self.api, [address_type_id_or_name])
@@ -41,5 +44,6 @@ class DeleteAddressTypeFromAddress(Method):
                 raise PLCPermissionDenied, "Address must be associated with one of your sites"
 
         address.remove_address_type(address_type)
+       self.object_ids = [address['address_id']]
 
         return 1
index b7bce21..4773d60 100644 (file)
@@ -23,6 +23,9 @@ class DeleteBootState(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'BootState'
+
     def call(self, auth, name):
         boot_states = BootStates(self.api, [name])
         if not boot_states:
@@ -30,5 +33,5 @@ class DeleteBootState(Method):
         boot_state = boot_states[0]
 
         boot_state.delete()
-
+       
         return 1
index e36d677..a07964a 100644 (file)
@@ -19,6 +19,9 @@ class DeleteConfFile(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+    
+    event_type = 'Delete'
+    object_type = 'ConfFile'
 
     def call(self, auth, conf_file_id):
         conf_files = ConfFiles(self.api, [conf_file_id])
@@ -27,5 +30,6 @@ class DeleteConfFile(Method):
 
         conf_file = conf_files[0]
         conf_file.delete()
+       self.object_ids = [conf_file['conf_file_id']]
 
         return 1
index 80985dd..43c3e90 100644 (file)
@@ -26,7 +26,6 @@ class DeleteConfFileFromNode(Method):
 
     event_type = 'DeleteFrom'
     object_type = 'ConfFile'
-    object_ids = []
 
     def call(self, auth, conf_file_id, node_id_or_hostname):
        # Get configuration file
index 300d311..2c29309 100644 (file)
@@ -26,7 +26,6 @@ class DeleteConfFileFromNodeGroup(Method):
 
     event_type = 'DeleteFrom'
     object_type = 'ConfFile'
-    object_ids = []
 
     def call(self, auth, conf_file_id, nodegroup_id_or_name):
        # Get configuration file
index ae39f31..c137f7c 100644 (file)
@@ -22,6 +22,9 @@ class DeleteKey(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Key'
+
     def call(self, auth, key_id):
         # Get associated key details
         keys = Keys(self.api, [key_id])
@@ -34,5 +37,6 @@ class DeleteKey(Method):
                 raise PLCPermissionDenied, "Key must be associated with your account"
 
         key.delete()
+       self.object_ids = [key['key_id']]
 
         return 1
index dc05655..2554cb0 100644 (file)
@@ -21,7 +21,10 @@ class DeleteKeyType(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
-
+    
+    event_type = 'Delete'
+    object_type = 'KeyType'
+    
     def call(self, auth, name):
         key_types = KeyTypes(self.api, [name])
         if not key_types:
index 82fbbaf..fc7e2d0 100644 (file)
@@ -19,6 +19,9 @@ class DeleteMessage(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+       
+    event_type = 'Delete'
+    object_type = 'Message'
 
     def call(self, auth, message_id):
         # Get message information
@@ -28,5 +31,6 @@ class DeleteMessage(Method):
         message = messages[0]
 
         message.delete()
+       self.object_ids = [message['message_id']]
 
         return 1
index aa9e273..c31c181 100644 (file)
@@ -22,6 +22,9 @@ class DeleteNetworkMethod(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+   
+    event_type = 'Delete'
+    object_type = 'NetworkMethod'
 
     def call(self, auth, name):
         network_methods = NetworkMethods(self.api, [name])
index c84735f..2fa3c9a 100644 (file)
@@ -22,6 +22,9 @@ class DeleteNetworkType(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+    
+    event_type = 'Delete'
+    object_type = 'NetworkType'
 
     def call(self, auth, name):
         network_types = NetworkTypes(self.api, [name])
index c4a2812..c6023c5 100644 (file)
@@ -24,6 +24,9 @@ class DeleteNode(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Node'
+
     def call(self, auth, node_id_or_hostname):
         # Get account information
         nodes = Nodes(self.api, [node_id_or_hostname])
@@ -42,5 +45,6 @@ class DeleteNode(Method):
                 raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
 
         node.delete()
+       self.object_ids = [node['node_id']]
 
         return 1
index 380c2cc..dc289fa 100644 (file)
@@ -24,6 +24,9 @@ class DeleteNodeFromNodeGroup(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'DeleteFrom'
+    object_type = 'NodeGroup'
+
     def call(self, auth, node_id_or_hostname, nodegroup_id_or_name):
         # Get node info
        nodes = Nodes(self.api, [node_id_or_hostname])
@@ -42,5 +45,7 @@ class DeleteNodeFromNodeGroup(Method):
        # Remove node from nodegroup
         if node['node_id'] in nodegroup['node_ids']:
             nodegroup.remove_node(node)
+       
+       self.object_ids = [nodegroup['nodegroup_id']]
 
         return 1
index 67a45f4..02ddfcc 100644 (file)
@@ -25,6 +25,9 @@ class DeleteNodeFromPCU(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'DeleteFrom'
+    object_type = 'PCU'
+
     def call(self, auth, node_id_or_hostname, pcu_id):
         # Get node
         nodes = Nodes(self.api, [node_id_or_hostname])
@@ -54,4 +57,6 @@ class DeleteNodeFromPCU(Method):
         if node['node_id'] in pcu['node_ids']:
             pcu.remove_node(node)
 
-        return 1
+       self.object_ids = [pcu['pcu_id']]
+        
+       return 1
index 59615f3..c038401 100644 (file)
@@ -23,6 +23,9 @@ class DeleteNodeGroup(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'NodeGroup'
+
     def call(self, auth, node_group_id_or_name):
         # Get account information
         nodegroups = NodeGroups(self.api, [node_group_id_or_name])
@@ -32,5 +35,6 @@ class DeleteNodeGroup(Method):
         nodegroup = nodegroups[0]
 
         nodegroup.delete()
+       self.object_ids = [nodegroup['nodegroup_id']]
 
         return 1
index d14a5b1..f59b35f 100644 (file)
@@ -24,7 +24,11 @@ class DeleteNodeNetwork(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'NodeNetwork'
+
     def call(self, auth, nodenetwork_id):
+
         # Get node network information
         nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
         if not nodenetworks:
@@ -47,5 +51,6 @@ class DeleteNodeNetwork(Method):
                 raise PLCPermissionDenied, "Not allowed to delete this node network"
 
         nodenetwork.delete()
+       self.object_ids = [nodenetwork['nodenetwork_id']]
 
         return 1
index 01382b1..50adb88 100644 (file)
@@ -22,6 +22,9 @@ class DeletePCU(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'PCU'
+
     def call(self, auth, pcu_id):
         # Get associated PCU details
         pcus = PCUs(self.api, [pcu_id])
@@ -34,5 +37,6 @@ class DeletePCU(Method):
                 raise PLCPermissionDenied, "Not allowed to update that PCU"
 
         pcu.delete()
+       self.object_ids = [pcu['pcu_id']]
 
         return 1
index e8a1030..7046e81 100644 (file)
@@ -25,6 +25,9 @@ class DeletePerson(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Person'
+
     def call(self, auth, person_id_or_email):
         # Get account information
         persons = Persons(self.api, [person_id_or_email])
@@ -41,5 +44,6 @@ class DeletePerson(Method):
             raise PLCPermissionDenied, "Not allowed to delete specified account"
 
         person.delete()
+       self.object_ids = [person['person_id']]
 
         return 1
index 9004eae..f7bd630 100644 (file)
@@ -25,6 +25,9 @@ class DeletePersonFromSite(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
+    
+    event_type = 'DeleteFrom'
+    object_type = 'Site'
 
     def call(self, auth, person_id_or_email, site_id_or_login_base):
         # Get account information
@@ -44,4 +47,6 @@ class DeletePersonFromSite(Method):
         if site['site_id'] in person['site_ids']:
             site.remove_person(person)
 
+       self.object_ids = [site['site_id']]
+       
         return 1
index f21db58..4ccf40a 100644 (file)
@@ -25,6 +25,9 @@ class DeletePersonFromSlice(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'DeleteFrom'
+    object_type = 'Slice'
+
     def call(self, auth, person_id_or_email, slice_id_or_name):
         # Get account information
         persons = Persons(self.api, [person_id_or_email])
@@ -48,5 +51,7 @@ class DeletePersonFromSlice(Method):
 
        if slice['slice_id'] in person['slice_ids']:
             slice.remove_person(person)
+       
+       self.object_ids = [slice['slice_id']]
 
         return 1
index 53a3903..c557851 100644 (file)
@@ -25,6 +25,9 @@ class DeleteRole(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Role'
+    
     def call(self, auth, role_id_or_name):
         roles = Roles(self.api, [role_id_or_name])
         if not roles:
@@ -32,5 +35,6 @@ class DeleteRole(Method):
         role = roles[0]
 
         role.delete()
+       self.object_ids = [role['role_id']]
 
         return 1
index 60ed91e..2f0d579 100644 (file)
@@ -27,6 +27,9 @@ class DeleteRoleFromPerson(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'DeleteFrom'
+    object_type = 'Person'
+
     def call(self, auth, role_id_or_name, person_id_or_email):
         # Get all roles
         roles = {}
@@ -63,5 +66,7 @@ class DeleteRoleFromPerson(Method):
 
         if role_id in person['role_ids']:
             person.remove_role(role_id)
+       
+       self.object_ids = [person['person_id']]
 
         return 1
index be5a8ae..1b8bbb7 100644 (file)
@@ -16,6 +16,9 @@ class DeleteSession(Method):
     accepts = [SessionAuth()]
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Session'
+
     def call(self, auth):
         assert auth.has_key('session')
 
index d56d711..e84466e 100644 (file)
@@ -27,6 +27,9 @@ class DeleteSite(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Site'
+
     def call(self, auth, site_id_or_login_base):
         # Get account information
         sites = Sites(self.api, [site_id_or_login_base])
@@ -35,5 +38,6 @@ class DeleteSite(Method):
 
         site = sites[0]
         site.delete()
+       self.object_ids = [site['site_id']]
 
         return 1
index 1607d9c..5c171e1 100644 (file)
@@ -25,6 +25,9 @@ class DeleteSlice(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'Slice'
+
     def call(self, auth, slice_id_or_name):
         slices = Slices(self.api, [slice_id_or_name])
         if not slices:
@@ -40,5 +43,6 @@ class DeleteSlice(Method):
                 raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
 
         slice.delete()
+        self.object_ids = [slice['slice_id']]
 
         return 1
index 7584f46..c84c622 100644 (file)
@@ -28,6 +28,9 @@ class DeleteSliceAttribute(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'SliceAttribute'
+
     def call(self, auth, slice_attribute_id):
         slice_attributes = SliceAttributes(self.api, [slice_attribute_id])
         if not slice_attributes:
@@ -51,8 +54,9 @@ class DeleteSliceAttribute(Method):
 
             if slice_attribute['min_role_id'] is not None and \
                min(self.caller['role_ids']) > slice_attribute['min_role_id']:
-                raise PLCPermissionDenied, "Not allowed to delete the specified attribute"
+                raise PLCPermissioinDenied, "Not allowed to delete the specified attribute"
 
         slice_attribute.delete()
+       self.object_ids = [slice_attribute['slice_attribute_id']]
 
         return 1
index db7816a..37a7065 100644 (file)
@@ -21,6 +21,9 @@ class DeleteSliceAttributeType(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete'
+    object_type = 'SliceAttributeType'
+
     def call(self, auth, attribute_type_id_or_name):
         attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
         if not attribute_types:
@@ -28,5 +31,6 @@ class DeleteSliceAttributeType(Method):
         attribute_type = attribute_types[0]
 
         attribute_type.delete()
+       self.object_ids = [attribute_type['attribute_type_id']]
 
         return 1
index 912f3b1..71809b7 100644 (file)
@@ -25,6 +25,9 @@ class DeleteSliceFromNodes(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'DeleteFrom'
+    object_type = 'Node'
+
     def call(self, auth, slice_id_or_name, node_id_or_hostname_list):
         # Get slice information
         slices = Slices(self.api, [slice_id_or_name])
@@ -48,5 +51,7 @@ class DeleteSliceFromNodes(Method):
        for node in nodes:
             if slice['slice_id'] in node['slice_ids']:
                 slice.remove_node(node)
+       
+       self.object_ids = [node['node_id'] for node in nodes]
 
         return 1
index 5c3c875..d6b4091 100644 (file)
@@ -22,6 +22,9 @@ class DeleteSliceInstantiation(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    event_type = 'Delete' 
+    object_type = 'SliceInstantiation'
+
     def call(self, auth, instantiation):
         slice_instantiations = SliceInstantiations(self.api, [instantiation])
         if not slice_instantiations: