fixed up the names of new site names/slices to be more PLC compatible
[sfa.git] / sfa / methods / get_resources.py
1 ### $Id$
2 ### $URL$
3
4 from sfa.util.faults import *
5 from sfa.util.method import Method
6 from sfa.util.parameter import Parameter, Mixed
7 from sfa.methods.ListResources import ListResources 
8 # RSpecManager_pl is not used. This line is a check that ensures that everything is in place for the import to work.
9 import sfa.rspecs.aggregates.rspec_manager_pl
10
11 class get_resources(ListResources):
12     """
13     Deprecated. Use ListResources instead. 
14
15     Get an resource specification (rspec). The rspec may describe the resources
16     available at an authority or the resources being used by a slice.      
17
18     @param cred credential string specifying the rights of the caller
19     @param hrn human readable name of the slice we are interesed in or None 
20            for an authority.  
21     """
22
23     interfaces = ['aggregate', 'slicemgr']
24     
25     accepts = [
26         Parameter(str, "Credential string"),
27         Mixed(Parameter(str, "Human readable name (hrn or urn)"),
28               Parameter(None, "hrn not specified")),
29         Mixed(Parameter(str, "Human readable name of the original caller"),
30               Parameter(None, "Origin hrn not specified"))
31         ]
32
33     returns = Parameter(str, "String representatin of an rspec")
34     
35     def call(self, cred, xrn=None, origin_hrn=None):
36         options = {'geni_slice_urn': xrn,
37                    'origin_hrn': origin_hrn
38         }
39                   
40         return ListResources.call(self, cred, options)