From fa39ba7039d9ebfdcfe085c2337dfda57e575342 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sat, 26 Sep 2009 01:57:35 +0000 Subject: [PATCH] added register_peer_object(), remove_peer_object() --- sfa/util/geniclient.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/sfa/util/geniclient.py b/sfa/util/geniclient.py index 3bc00126..fb99a8f7 100644 --- a/sfa/util/geniclient.py +++ b/sfa/util/geniclient.py @@ -145,7 +145,7 @@ class GeniClient: # # # @param cred credential object specifying rights of the caller - # @return record to register + # @param record to register # # @return GID object for the newly-registered record @@ -153,6 +153,19 @@ class GeniClient: gid_str = self.server.register(cred.save_to_string(save_parents=True), record.as_dict(), caller_cred) return GID(string = gid_str) + + ## + # Register a peer object with the registry. + # + # + # @param cred credential object specifying rights of the caller + # @param record to register + # + # @return GID object for the newly-registered record + + def register_peer_object(self, cred, record, caller_cred=None): + return self.server.register_peer_object(cred.save_to_string(save_parents=True), record, caller_cred) + ## # Remove an object from the registry. If the object represents a PLC object, # then the PLC records will also be removed. @@ -162,7 +175,18 @@ class GeniClient: # @param hrn def remove(self, cred, type, hrn, caller_cred=None): - result = self.server.remove(cred.save_to_string(save_parents=True), type, hrn, caller_cred) + return self.server.remove(cred.save_to_string(save_parents=True), type, hrn, caller_cred) + + ## + # Remove a peer object from the registry. If the object represents a PLC object, + # then the PLC records will also be removed. + # + # @param cred credential object specifying rights of the caller + # @param type + # @param hrn + + def remove_peer_object(self, cred, type, hrn, peer_auth, caller_cred=None): + result = self.server.remove_peer_object(cred.save_to_string(save_parents=True), type, hrn, peer_auth, caller_cred) return result ## -- 2.47.0