1 from sfa.util.method import Method
3 from sfa.trust.credential import Credential
5 from sfa.storage.parameter import Parameter, Mixed
7 class ListSlices(Method):
9 List the slices instantiated at this interface
11 @param cred credential string specifying the rights of the caller
12 @return 1 is successful, faults otherwise
15 interfaces = ['aggregate', 'slicemgr', 'component']
18 Mixed(Parameter(str, "Credential string"),
19 Parameter(type([str]), "List of credentials")),
20 Parameter(dict, "options"),
23 returns = Parameter(list, "List of slice names")
25 def call(self, creds, options):
26 valid_creds = self.api.auth.checkCredentials(creds, 'listslices')
29 origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
30 self.api.logger.info("interface: %s\tcaller-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, self.name))
32 return self.api.manager.ListSlices(self.api, creds, options)