1 from sfa.util.faults import *
2 from sfa.util.method import Method
3 from sfa.util.parameter import Parameter, Mixed
4 from sfa.trust.auth import Auth
5 from sfa.trust.credential import Credential
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(str, "call_id"),
23 returns = Parameter(list, "List of slice names")
25 def call(self, creds, call_id=""):
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 manager = self.api.get_interface_manager()
33 return manager.ListSlices(self.api, creds, call_id)