Deprecated. Request is now forwarded to ListResources. This method just prepares...
[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     This Method has been deprecated. Use ListResources instead. 
14     Get an resource specification (rspec). The rspec may describe the resources
15     available at an authority or the resources being used by a slice.      
16
17     @param cred credential string specifying the rights of the caller
18     @param hrn human readable name of the slice we are interesed in or None 
19            for an authority.  
20     """
21
22     interfaces = ['aggregate', 'slicemgr']
23     
24     accepts = [
25         Parameter(str, "Credential string"),
26         Mixed(Parameter(str, "Human readable name (hrn or urn)"),
27               Parameter(None, "hrn not specified")),
28         Mixed(Parameter(str, "Human readable name of the original caller"),
29               Parameter(None, "Origin hrn not specified"))
30         ]
31
32     returns = Parameter(str, "String representatin of an rspec")
33     
34     def call(self, cred, xrn=None, origin_hrn=None):
35         options = {'geni_slice_urn': xrn,
36                    'origin_hrn': origin_hrn
37         }
38                   
39         return ListResources.call(self, cred, options)