def loadSgs(self): """Private: Reloads the service group from the C layers (call load() instead)""" self.log("Loading SG config and status") sgs = asppycustom.GetConfiguredEntities(ServiceGroupType) for sg in sgs: name = sg[1] # Create the entity asg = AmfServiceGroup(name) config = asp.clAmsMgmtServiceGroupGetConfig(self.amf.hdl, name) asg.setConfig(config) state = asp.clAmsMgmtServiceGroupGetStatus(self.amf.hdl, name) asg.setState(state) # Allow it to be indexed by name self.sgs[name] = asg self.entities[name] = asg # Allow an iterator to hit only the SGs self.sgList.append(asg) self.sgList.sort()
def loadSgs(self): """Private: Reloads the service group from the C layers (call load() instead)""" self.log("Loading SG config and status") sgs = asppycustom.GetConfiguredEntities(ServiceGroupType) for sg in sgs: name = sg[1] # Create the entity asg = AmfServiceGroup(name) config = asp.clAmsMgmtServiceGroupGetConfig(self.amf.hdl,name) asg.setConfig(config) state = asp.clAmsMgmtServiceGroupGetStatus(self.amf.hdl,name) asg.setState(state) # Allow it to be indexed by name self.sgs[name] = asg self.entities[name] = asg # Allow an iterator to hit only the SGs self.sgList.append(asg) self.sgList.sort()
def TestGetConfig(): """Internal module unit test""" s = Session() nodes = s.GetConfiguredNodeNames() config = asp.ClAmsNodeConfigT() print "Nodes: ", nodes for n in nodes: config = asp.clAmsMgmtNodeGetConfig(s.hdl,n[1]) print config sgs = s.GetConfiguredEntities(ServiceGroupType) print sgs for sg in sgs: config = asp.clAmsMgmtServiceGroupGetConfig(s.hdl,sg[1]) print config sus = s.GetConfiguredEntities(ServiceUnitType) print sus for su in sgs: config = asp.clAmsMgmtServiceUnitGetConfig(s.hdl,su[1]) print config sis = s.GetConfiguredEntities(WorkAssignmentType) print "SIs: ", sis for si in sis: config = asp.clAmsMgmtServiceInstanceGetConfig(s.hdl,si[1]) print config csis = s.GetConfiguredEntities(ComponentWorkAssignmentType) print "CSIs: ", csis for csi in csis: config = asp.clAmsMgmtCompServiceInstanceGetConfig(s.hdl,csi[1]) print config comps = s.GetConfiguredEntities(ComponentType) print "comps: ", comps for comp in comps: config = asp.clAmsMgmtCompGetConfig(s.hdl,comp[1]) print config
def TestGetConfig(): """Internal module unit test""" s = Session() nodes = s.GetConfiguredNodeNames() config = asp.ClAmsNodeConfigT() print "Nodes: ", nodes for n in nodes: config = asp.clAmsMgmtNodeGetConfig(s.hdl, n[1]) print config sgs = s.GetConfiguredEntities(ServiceGroupType) print sgs for sg in sgs: config = asp.clAmsMgmtServiceGroupGetConfig(s.hdl, sg[1]) print config sus = s.GetConfiguredEntities(ServiceUnitType) print sus for su in sgs: config = asp.clAmsMgmtServiceUnitGetConfig(s.hdl, su[1]) print config sis = s.GetConfiguredEntities(WorkAssignmentType) print "SIs: ", sis for si in sis: config = asp.clAmsMgmtServiceInstanceGetConfig(s.hdl, si[1]) print config csis = s.GetConfiguredEntities(ComponentWorkAssignmentType) print "CSIs: ", csis for csi in csis: config = asp.clAmsMgmtCompServiceInstanceGetConfig(s.hdl, csi[1]) print config comps = s.GetConfiguredEntities(ComponentType) print "comps: ", comps for comp in comps: config = asp.clAmsMgmtCompGetConfig(s.hdl, comp[1]) print config