1 from sfa.storage.parameter import Parameter
2 from sfa.trust.credential import Credential
3 from sfa.util.method import Method
6 class Shutdown(Method):
8 Perform an emergency shut down of a sliver. This operation is intended for administrative use.
9 The sliver is shut down but remains available for further forensics.
11 @param slice_urn (string) URN of slice to renew
12 @param credentials ([string]) of credentials
14 interfaces = ['aggregate', 'slicemgr']
16 Parameter(str, "Slice URN"),
17 Parameter(type([dict]), "Credentials"),
19 returns = Parameter(bool, "Success or Failure")
21 def call(self, xrn, creds):
23 valid_creds = self.api.auth.checkCredentials(creds, 'stopslice', xrn,
24 check_sliver_callback=self.api.driver.check_sliver_credentials)
26 origin_hrn = Credential(cred=valid_creds[0]).get_gid_caller().get_hrn()
27 self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" %
28 (self.api.interface, origin_hrn, xrn, self.name))
30 return self.api.manager.Shutdown(self.api, xrn, creds)