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