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