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
9 from sfa.plc.nodes import Nodes
11 class get_resources(Method):
13 Get an resource specification (rspec). The rspec may describe the resources
14 available at an authority or the resources being used by a slice.
16 @param cred credential string specifying the rights of the caller
17 @param hrn human readable name of the slice we are interesed in or None
21 interfaces = ['aggregate', 'slicemgr']
24 Parameter(str, "Credential string"),
25 Mixed(Parameter(str, "Human readable name (hrn)"),
26 Parameter(None, "hrn not specified"))
29 returns = Parameter(str, "String representatin of an rspec")
31 def call(self, cred, hrn=None):
33 self.api.auth.check(cred, 'listnodes')
34 nodes = Nodes(self.api)
36 rspec = nodes.get_rspec(hrn)
39 rspec = nodes['rspec']