X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FDelete.py;h=920425629b05b1b92a384a7dc5e12eed6d877350;hb=04a3f20dc71bf8b3f96b1e3172623aa346a638a7;hp=593de28fa74f7892c2e7587185a393beab69d15c;hpb=0eb8d56df7ee56f2ffebeef43c55cc7416fdf278;p=sfa.git diff --git a/sfa/methods/Delete.py b/sfa/methods/Delete.py index 593de28f..92042562 100644 --- a/sfa/methods/Delete.py +++ b/sfa/methods/Delete.py @@ -4,6 +4,7 @@ from sfa.storage.parameter import Parameter, Mixed from sfa.trust.auth import Auth from sfa.trust.credential import Credential + class Delete(Method): """ Remove the slice or slivers and free the allocated resources @@ -14,22 +15,24 @@ class Delete(Method): """ interfaces = ['aggregate', 'slicemgr', 'component'] - + accepts = [ - Parameter(type([str]), "Human readable name of slice to delete (hrn or urn)"), + Parameter( + type([str]), "Human readable name of slice to delete (hrn or urn)"), Parameter(type([dict]), "Credentials"), Parameter(dict, "options"), - ] + ] returns = Parameter(int, "1 if successful") - + def call(self, xrns, creds, options): valid_creds = self.api.auth.checkCredentialsSpeaksFor(creds, 'deletesliver', xrns, - check_sliver_callback = self.api.driver.check_sliver_credentials, + check_sliver_callback=self.api.driver.check_sliver_credentials, options=options) - #log the call + # log the call origin_hrn = Credential(cred=valid_creds[0]).get_gid_caller().get_hrn() - self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, xrns, self.name)) + self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" % + (self.api.interface, origin_hrn, xrns, self.name)) return self.api.manager.Delete(self.api, xrns, creds, options)