From 8e199f468aaf48ac1dad3090c149711f38aa6c38 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 28 Nov 2006 22:02:33 +0000 Subject: [PATCH] - added logging vars --- PLC/Methods/GetAddressTypes.py | 3 +++ PLC/Methods/GetAddresses.py | 3 +++ PLC/Methods/GetBootStates.py | 3 +++ PLC/Methods/GetConfFiles.py | 3 +++ PLC/Methods/GetEvents.py | 3 +++ PLC/Methods/GetKeyTypes.py | 3 +++ PLC/Methods/GetKeys.py | 3 +++ PLC/Methods/GetMessages.py | 1 - PLC/Methods/GetNetworkMethods.py | 3 +++ PLC/Methods/GetNetworkTypes.py | 3 +++ PLC/Methods/GetNodeGroups.py | 2 ++ PLC/Methods/GetNodeNetworks.py | 3 +++ PLC/Methods/GetNodes.py | 3 +++ PLC/Methods/GetPCUs.py | 2 ++ PLC/Methods/GetPeerData.py | 2 ++ PLC/Methods/GetPeers.py | 2 ++ PLC/Methods/GetPersons.py | 4 ++++ PLC/Methods/GetRoles.py | 3 +++ PLC/Methods/GetSession.py | 3 +++ PLC/Methods/GetSites.py | 1 - PLC/Methods/GetSliceAttributeTypes.py | 3 +++ PLC/Methods/GetSliceAttributes.py | 3 +++ PLC/Methods/GetSliceInstantiations.py | 3 +++ PLC/Methods/GetSlices.py | 3 +++ PLC/Methods/GetSlivers.py | 3 +++ 25 files changed, 66 insertions(+), 2 deletions(-) diff --git a/PLC/Methods/GetAddressTypes.py b/PLC/Methods/GetAddressTypes.py index 74d4f61..1f3eb32 100644 --- a/PLC/Methods/GetAddressTypes.py +++ b/PLC/Methods/GetAddressTypes.py @@ -27,5 +27,8 @@ class GetAddressTypes(Method): returns = [AddressType.fields] + event_type = 'Get' + object_type = 'AddressType' + def call(self, auth, address_type_filter = None, return_fields = None): return AddressTypes(self.api, address_type_filter, return_fields) diff --git a/PLC/Methods/GetAddresses.py b/PLC/Methods/GetAddresses.py index 3aa9eeb..bff3b73 100644 --- a/PLC/Methods/GetAddresses.py +++ b/PLC/Methods/GetAddresses.py @@ -24,6 +24,9 @@ class GetAddresses(Method): ] returns = [Address.fields] + + event_type = 'Get' + object_type = 'Address' def call(self, auth, address_filter = None, return_fields = None): return Addresses(self.api, address_filter, return_fields) diff --git a/PLC/Methods/GetBootStates.py b/PLC/Methods/GetBootStates.py index 1afa53b..1c9afc3 100644 --- a/PLC/Methods/GetBootStates.py +++ b/PLC/Methods/GetBootStates.py @@ -16,6 +16,9 @@ class GetBootStates(Method): ] returns = [BootState.fields['boot_state']] + + event_type = 'Get' + object_type = 'BootState' def call(self, auth): return [boot_state['boot_state'] for boot_state in BootStates(self.api)] diff --git a/PLC/Methods/GetConfFiles.py b/PLC/Methods/GetConfFiles.py index 6a10f90..582f611 100644 --- a/PLC/Methods/GetConfFiles.py +++ b/PLC/Methods/GetConfFiles.py @@ -26,5 +26,8 @@ class GetConfFiles(Method): returns = [ConfFile.fields] + event_type = 'Get' + object_type = 'ConfFile' + def call(self, auth, conf_file_filter = None, return_fields = None): return ConfFiles(self.api, conf_file_filter, return_fields) diff --git a/PLC/Methods/GetEvents.py b/PLC/Methods/GetEvents.py index 4fbb451..0ee58df 100644 --- a/PLC/Methods/GetEvents.py +++ b/PLC/Methods/GetEvents.py @@ -24,6 +24,9 @@ class GetEvents(Method): ] returns = [Event.fields] + event_type = 'Get' + object_type = 'Event' def call(self, auth, event_filter = None, return_fields = None): return Events(self.api, event_filter, return_fields) + diff --git a/PLC/Methods/GetKeyTypes.py b/PLC/Methods/GetKeyTypes.py index f8a554b..4c742ee 100644 --- a/PLC/Methods/GetKeyTypes.py +++ b/PLC/Methods/GetKeyTypes.py @@ -17,5 +17,8 @@ class GetKeyTypes(Method): returns = [KeyType.fields['key_type']] + event_type = 'Get' + object_type = 'KeyType' + def call(self, auth): return [key_type['key_type'] for key_type in KeyTypes(self.api)] diff --git a/PLC/Methods/GetKeys.py b/PLC/Methods/GetKeys.py index fcbd2b1..b9cf110 100644 --- a/PLC/Methods/GetKeys.py +++ b/PLC/Methods/GetKeys.py @@ -28,6 +28,9 @@ class GetKeys(Method): returns = [Key.fields] + event_type = 'Get' + object_type = 'Key' + def call(self, auth, key_filter = None, return_fields = None): keys = Keys(self.api, key_filter, return_fields) diff --git a/PLC/Methods/GetMessages.py b/PLC/Methods/GetMessages.py index 6605324..3d0473d 100644 --- a/PLC/Methods/GetMessages.py +++ b/PLC/Methods/GetMessages.py @@ -22,7 +22,6 @@ class GetMessages(Method): event_type = 'Get' object_type = 'Message' - object_ids = [] def call(self, auth, message_ids = None): return Messages(self.api, message_ids) diff --git a/PLC/Methods/GetNetworkMethods.py b/PLC/Methods/GetNetworkMethods.py index e857dd5..b29ad37 100644 --- a/PLC/Methods/GetNetworkMethods.py +++ b/PLC/Methods/GetNetworkMethods.py @@ -17,5 +17,8 @@ class GetNetworkMethods(Method): returns = [NetworkMethod.fields['method']] + event_type = 'Get' + object_type = 'NetworkMethod' + def call(self, auth): return [network_method['method'] for network_method in NetworkMethods(self.api)] diff --git a/PLC/Methods/GetNetworkTypes.py b/PLC/Methods/GetNetworkTypes.py index 7187d21..d819761 100644 --- a/PLC/Methods/GetNetworkTypes.py +++ b/PLC/Methods/GetNetworkTypes.py @@ -17,5 +17,8 @@ class GetNetworkTypes(Method): returns = [NetworkType.fields['type']] + event_type = 'Get' + object_type = 'NetworkType' + def call(self, auth): return [network_type['type'] for network_type in NetworkTypes(self.api)] diff --git a/PLC/Methods/GetNodeGroups.py b/PLC/Methods/GetNodeGroups.py index 478eb99..38d0618 100644 --- a/PLC/Methods/GetNodeGroups.py +++ b/PLC/Methods/GetNodeGroups.py @@ -25,6 +25,8 @@ class GetNodeGroups(Method): ] returns = [NodeGroup.fields] + event_type = 'Get' + object_type = 'NodeGroup' def call(self, auth, nodegroup_filter = None, return_fields = None): return NodeGroups(self.api, nodegroup_filter, return_fields) diff --git a/PLC/Methods/GetNodeNetworks.py b/PLC/Methods/GetNodeNetworks.py index 4562c00..db348a5 100644 --- a/PLC/Methods/GetNodeNetworks.py +++ b/PLC/Methods/GetNodeNetworks.py @@ -25,6 +25,9 @@ class GetNodeNetworks(Method): ] returns = [NodeNetwork.fields] + + event_type = 'Get' + object_type = 'NodeNetwork' def call(self, auth, nodenetwork_filter = None, return_fields = None): return NodeNetworks(self.api, nodenetwork_filter, return_fields) diff --git a/PLC/Methods/GetNodes.py b/PLC/Methods/GetNodes.py index 6206a7a..92f0111 100644 --- a/PLC/Methods/GetNodes.py +++ b/PLC/Methods/GetNodes.py @@ -28,6 +28,9 @@ class GetNodes(Method): returns = [Node.fields] + event_type = 'Get' + object_type = 'Node' + def call(self, auth, node_filter = None, return_fields = None): # Get node information nodes = Nodes(self.api, node_filter, return_fields) diff --git a/PLC/Methods/GetPCUs.py b/PLC/Methods/GetPCUs.py index 13bd7dc..1f8e201 100644 --- a/PLC/Methods/GetPCUs.py +++ b/PLC/Methods/GetPCUs.py @@ -27,6 +27,8 @@ class GetPCUs(Method): ] returns = [PCU.fields] + event_type = 'Get' + object_type = 'PCU' def call(self, auth, pcu_filter = None, return_fields = None): # If we are not admin, make sure to only return our own PCUs diff --git a/PLC/Methods/GetPeerData.py b/PLC/Methods/GetPeerData.py index 4b7d433..4b0f068 100644 --- a/PLC/Methods/GetPeerData.py +++ b/PLC/Methods/GetPeerData.py @@ -34,6 +34,8 @@ class GetPeerData (Method): ] # for RefreshPeer returns = Parameter (dict,"Sites, Keys, Nodes, Persons, Slices") + event_type = 'Get' + object_type = 'Peer' def call (self, auth, peer_id): # xxx a peer cannot yet compute it's peer_id under another plc diff --git a/PLC/Methods/GetPeers.py b/PLC/Methods/GetPeers.py index b7509b0..3002e82 100644 --- a/PLC/Methods/GetPeers.py +++ b/PLC/Methods/GetPeers.py @@ -30,6 +30,8 @@ class GetPeers (Method): ] returns = [Peer.fields] + event_type = 'Get' + object_type = 'Peer' def call (self, auth, peer_filter = None, return_fields = None): return Peers(self.api, peer_filter, return_fields) diff --git a/PLC/Methods/GetPersons.py b/PLC/Methods/GetPersons.py index e29d109..56c7cd9 100644 --- a/PLC/Methods/GetPersons.py +++ b/PLC/Methods/GetPersons.py @@ -32,8 +32,12 @@ class GetPersons(Method): can_return = lambda (field, value): field not in ['password'] return_fields = dict(filter(can_return, Person.fields.items())) returns = [return_fields] + + event_type = 'Get' + object_type = 'Person' def call(self, auth, person_filter = None, return_fields = None): + # If we are not admin, make sure to only return viewable accounts if 'admin' not in self.caller['roles']: # Get accounts that we are able to view diff --git a/PLC/Methods/GetRoles.py b/PLC/Methods/GetRoles.py index a53d775..ba15ee1 100644 --- a/PLC/Methods/GetRoles.py +++ b/PLC/Methods/GetRoles.py @@ -16,6 +16,9 @@ class GetRoles(Method): ] returns = [Role.fields] + + event_type = 'Get' + object_type = 'Role' def call(self, auth): return Roles(self.api) diff --git a/PLC/Methods/GetSession.py b/PLC/Methods/GetSession.py index f1263c8..584de64 100644 --- a/PLC/Methods/GetSession.py +++ b/PLC/Methods/GetSession.py @@ -16,6 +16,9 @@ class GetSession(Method): roles = ['admin', 'pi', 'user', 'tech', 'node'] accepts = [Auth()] returns = Session.fields['session_id'] + + event_type = 'Get' + object_type = 'Session' def call(self, auth): # Authenticated with a session key, just return it diff --git a/PLC/Methods/GetSites.py b/PLC/Methods/GetSites.py index 11c2708..0f51b02 100644 --- a/PLC/Methods/GetSites.py +++ b/PLC/Methods/GetSites.py @@ -27,7 +27,6 @@ class GetSites(Method): event_type = 'Get' object_type = 'Site' - object_ids = [] def call(self, auth, site_filter = None, return_fields = None): return Sites(self.api, site_filter, return_fields) diff --git a/PLC/Methods/GetSliceAttributeTypes.py b/PLC/Methods/GetSliceAttributeTypes.py index 5511e58..889346f 100644 --- a/PLC/Methods/GetSliceAttributeTypes.py +++ b/PLC/Methods/GetSliceAttributeTypes.py @@ -26,5 +26,8 @@ class GetSliceAttributeTypes(Method): returns = [SliceAttributeType.fields] + event_type = 'Get' + object_type = 'SliceAttributeType' + def call(self, auth, attribute_type_filter = None, return_fields = None): return SliceAttributeTypes(self.api, attribute_type_filter, return_fields) diff --git a/PLC/Methods/GetSliceAttributes.py b/PLC/Methods/GetSliceAttributes.py index 5a6a447..4107aed 100644 --- a/PLC/Methods/GetSliceAttributes.py +++ b/PLC/Methods/GetSliceAttributes.py @@ -33,6 +33,9 @@ class GetSliceAttributes(Method): ] returns = [SliceAttribute.fields] + + event_type = 'Get' + object_type = 'SliceAttribute' def call(self, auth, slice_attribute_filter = None, return_fields = None): # If we are not admin, make sure to only return our own slice diff --git a/PLC/Methods/GetSliceInstantiations.py b/PLC/Methods/GetSliceInstantiations.py index 25a856d..fc6469d 100644 --- a/PLC/Methods/GetSliceInstantiations.py +++ b/PLC/Methods/GetSliceInstantiations.py @@ -17,5 +17,8 @@ class GetSliceInstantiations(Method): returns = [SliceInstantiation.fields['instantiation']] + event_type = 'Get' + object_type = 'SliceInstantiation' + def call(self, auth): return [slice_instantiation['instantiation'] for slice_instantiation in SliceInstantiations(self.api)] diff --git a/PLC/Methods/GetSlices.py b/PLC/Methods/GetSlices.py index ac3c69e..6cfacac 100644 --- a/PLC/Methods/GetSlices.py +++ b/PLC/Methods/GetSlices.py @@ -29,6 +29,9 @@ class GetSlices(Method): ] returns = [Slice.fields] + + event_type = 'Get' + object_type = 'Slice' def call(self, auth, slice_filter = None, return_fields = None): # If we are not admin, make sure to return only viewable diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index 460f37a..46e13d3 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -61,6 +61,9 @@ class GetSlivers(Method): }] }] + event_type = 'Get' + object_type = 'Sliver' + def call(self, auth, node_filter = None): timestamp = int(time.time()) -- 2.43.0