1 from sfa.util.xrn import urn_to_hrn
2 from sfa.util.method import Method
3 from sfa.util.parameter import Parameter, Mixed
4 from sfa.server.aggregate import Aggregates
6 class get_aggregates(Method):
8 Get a list of connection information for all known aggregates.
10 @param cred credential string specifying the rights of the caller
11 @param a Human readable name (hrn or urn), or list of hrns or None
12 @return list of dictionaries with aggregate information.
15 interfaces = ['registry', 'aggregate', 'slicemgr']
18 Parameter(str, "Credential string"),
19 Mixed(Parameter(str, "Human readable name (hrn or urn)"),
20 Parameter(None, "hrn not specified"))
23 returns = [Parameter(dict, "Aggregate interface information")]
25 def call(self, cred, xrn = None):
26 hrn, type = urn_to_hrn(xrn)
27 self.api.auth.check(cred, 'list')
28 aggregates = Aggregates(self.api).interfaces.values()
30 aggregates = [agg for agg in aggregates if agg['hrn'] == hrn]