X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FStatus.py;h=dd15f5dfad83b1463108d151318e8af54fcc8b77;hb=47090c0a12d8ccffa6d67692461da61a7b7f67e7;hp=6935d01638a3e2a5b798f31d253cf153cce0c154;hpb=236084d9ad057eca8686ae8aa75946a737e8bb80;p=sfa.git diff --git a/sfa/methods/Status.py b/sfa/methods/Status.py index 6935d016..dd15f5df 100644 --- a/sfa/methods/Status.py +++ b/sfa/methods/Status.py @@ -3,29 +3,27 @@ from sfa.util.method import Method from sfa.storage.parameter import Parameter, Mixed + class Status(Method): """ Get the status of a sliver - + @param slice_urn (string) URN of slice to allocate to - + """ interfaces = ['aggregate', 'slicemgr', 'component'] accepts = [ - Parameter(str, "Slice URN"), - Mixed(Parameter(str, "Credential string"), - Parameter(type([str]), "List of credentials")), + Parameter(type([str]), "Slice or sliver URNs"), + Parameter(type([dict]), "credentials"), Parameter(dict, "Options") - ] + ] returns = Parameter(dict, "Status details") - def call(self, slice_xrn, creds, options): - hrn, type = urn_to_hrn(slice_xrn) - valid_creds = self.api.auth.checkCredentials(creds, 'sliverstatus', hrn) - - self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, hrn, self.name)) - - status = self.api.manager.Status(self.api, hrn, valid_creds, options) + def call(self, xrns, creds, options): + valid_creds = self.api.auth.checkCredentialsSpeaksFor(creds, 'sliverstatus', xrns, + check_sliver_callback=self.api.driver.check_sliver_credentials, + options=options) - return status - + self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s" % + (self.api.interface, xrns, self.name)) + return self.api.manager.Status(self.api, xrns, creds, options)