1 from sfa.util.xrn import urn_to_hrn
2 from sfa.util.method import Method
3 from sfa.util.parameter import Parameter, Mixed
5 class reset_slice(Method):
7 Reset the specified slice
9 @param cred credential string specifying the rights of the caller
10 @param xrn human readable name of slice to instantiate (hrn or urn)
11 @return 1 is successful, faults otherwise
14 interfaces = ['aggregate', 'slicemgr', 'component']
17 Parameter(str, "Credential string"),
18 Parameter(str, "Human readable name of slice to instantiate (hrn or urn)"),
19 Mixed(Parameter(str, "Human readable name of the original caller"),
20 Parameter(None, "Origin hrn not specified"))
23 returns = Parameter(int, "1 if successful")
25 def call(self, cred, xrn, origin_hrn=None):
26 hrn, type = urn_to_hrn(xrn)
27 self.api.auth.check(cred, 'resetslice', hrn)
28 self.api.manager.reset_slice (self.api, xrn)