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