1 from sfa.util.faults import *
2 from sfa.util.xrn import Xrn
3 from sfa.util.method import Method
4 from sfa.util.parameter import Parameter, Mixed
5 from sfa.trust.credential import Credential
9 Remove an object from the registry. If the object represents a PLC object,
10 then the PLC records will also be removed.
12 @param cred credential string
13 @param type record type
14 @param xrn human readable name of record to remove (hrn or urn)
16 @return 1 if successful, faults otherwise
19 interfaces = ['registry']
22 Parameter(str, "Human readable name of slice to instantiate (hrn or urn)"),
23 Mixed(Parameter(str, "Credential string"),
24 Parameter(type([str]), "List of credentials")),
25 Mixed(Parameter(str, "Record type"),
26 Parameter(None, "Type not specified")),
29 returns = Parameter(int, "1 if successful")
31 def call(self, xrn, creds, type):
32 xrn=Xrn(xrn,type=type)
35 valid_creds = self.api.auth.checkCredentials(creds, "remove")
36 self.api.auth.verify_object_permission(xrn.get_hrn())
39 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
40 self.api.logger.info("interface: %s\tmethod-name: %s\tcaller-hrn: %s\ttarget-urn: %s"%(
41 self.api.interface, self.name, origin_hrn, xrn.get_urn()))
43 manager = self.api.get_interface_manager()
45 return manager.remove(self.api, xrn)