1 from sfa.util.faults import *
2 from sfa.util.namespace import *
3 from sfa.util.method import Method
4 from sfa.util.parameter import Parameter
6 class SliverStatus(Method):
8 Get the status of a sliver
10 @param slice_urn (string) URN of slice to allocate to
13 interfaces = ['geni_am']
15 Parameter(str, "Slice URN"),
17 returns = Parameter(bool, "Success or Failure")
19 def call(self, slice_xrn, creds):
20 hrn, type = urn_to_hrn(slice_xrn)
22 ValidCreds = self.api.auth.checkCredentials(creds, 'sliverstatus', hrn)
24 self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, hrn, self.name))
26 manager_base = 'sfa.managers'
28 if self.api.interface in ['geni_am']:
29 mgr_type = self.api.config.SFA_GENI_AGGREGATE_TYPE
30 manager_module = manager_base + ".geni_am_%s" % mgr_type
31 manager = __import__(manager_module, fromlist=[manager_base])
32 return manager.SliverStatus(self.api, slice_xrn, ValidCreds)