4 from sfa.util.faults import *
5 from sfa.util.method import Method
6 from sfa.util.parameter import Parameter, Mixed
7 from sfa.trust.auth import Auth
8 from sfa.util.nodes import Nodes
10 class get_resources(Method):
12 Get an resource specification (rspec). The rspec may describe the resources
13 available at an authority or the resources being used by a slice.
15 @param cred credential string specifying the rights of the caller
16 @param hrn human readable name of the slice we are interesed in or None
20 interfaces = ['aggregate', 'slicemgr']
23 Parameter(str, "Credential string"),
24 Mixed(Parameter(str, "Human readable name (hrn)"),
25 Parameter(None, "hrn not specified"))
28 returns = Parameter(str, "String representatin of an rspec")
30 def call(self, cred, hrn=None):
32 self.api.auth.check(cred, 'listnodes')
33 nodes = Nodes(self.api)
35 rspec = nodes.get_rspec(hrn)
38 rspec = nodes['rspec']