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