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