1 from geni.util.faults import *
2 from geni.util.excep import *
3 from geni.util.misc import *
4 from geni.util.method import Method
5 from geni.util.parameter import Parameter, Mixed
6 from geni.util.auth import Auth
7 from geni.aggregate import Aggregates
11 Get a list of instantiated slices at this authority.
13 @param cred credential string specifying the rights of the caller
14 @return list of human readable slice names (hrn).
17 interfaces = ['aggregate', 'slicemgr']
20 Parameter(str, "Credential string"),
23 returns = [Parameter(str, "Human readable slice name (hrn)")]
27 self.api.auth.check(cred, 'listslices')
30 if self.api.interface in ['aggregate']:
31 slices = self.api.plshell.GetSlices(self.api.plauth, {}, ['name'])
32 slice_hrns = [slicename_to_hrn(self.api.hrn, slice['name']) for slice in slices]
35 aggregates = Aggregates()
36 credential = self.api.getCredential()
37 for aggregate in aggregates:
38 slices = aggregates[aggregate].slices(credential)
39 slice_hrns.extend(slices)