4 from sfa.util.faults import *
5 from sfa.util.misc import *
6 from sfa.util.method import Method
7 from sfa.util.parameter import Parameter, Mixed
8 from sfa.trust.auth import Auth
9 from sfa.util.slices import Slices
11 class create_slice(Method):
13 Instantiate the specified slice according to whats defined in the specified rspec
15 @param cred credential string specifying the rights of the caller
16 @param hrn human readable name of slice to instantiate
17 @param rspec resource specification
18 @return 1 is successful, faults otherwise
21 interfaces = ['aggregate', 'slicemgr']
24 Parameter(str, "Credential string"),
25 Parameter(str, "Human readable name of slice to instantiate"),
26 Parameter(str, "Resource specification"),
29 returns = Parameter(int, "1 if successful")
31 def call(self, cred, hrn, rspec):
32 self.api.auth.check(cred, 'createslice')
33 slices = Slices(self.api)
34 slices.create_slice(hrn, rspec)