Author: eallen
Date: 2008-10-21 16:32:06 -0400 (Tue, 21 Oct 2008)
New Revision: 2672
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added start/stop to master.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-10-21 20:31:38 UTC (rev 2671)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-10-21 20:32:06 UTC (rev 2672)
@@ -52,6 +52,7 @@
CuminPool(self)
CuminCollector(self)
CuminNegotiator(self)
+ CuminMaster(self)
# Systems
@@ -603,6 +604,37 @@
return "%08x-%04x-%04x-%04x-%04x%08x" % unpack("!LHHHHL",
val)
+class CuminMaster(RemoteClass):
+ def __init__(self, model):
+ super(CuminMaster, self).__init__(model, "master", Master,
MasterStats)
+
+ self.Start(self, "start")
+ self.Stop(self, "stop")
+
+ def get_title(self, session):
+ return "System"
+
+ def get_icon_href(self, session):
+ return "resource?name=system-36.png"
+
+ def show_object(self, session, system):
+ return self.cumin_model.show_main(session).show_system(session, system)
+
+ def get_object_name(self, object):
+ return object.nodeName
+
+ class Start(CuminAction):
+ def do_invoke(self, object, args, completion):
+ system_name = object.System
+ master = Master.select("System = '%s'" % system_name)[0]
+ master.Start(self.cumin_model.data, completion, args["subsystem"])
+
+ class Stop(CuminAction):
+ def do_invoke(self, object, args, completion):
+ system_name = object.System
+ master = Master.select("System = '%s'" % system_name)[0]
+ master.Stop(self.cumin_model.data, completion, args["subsystem"])
+
class CuminBroker(RemoteClass):
def __init__(self, model):
super(CuminBroker, self).__init__(model, "broker", Broker,
BrokerStats)
@@ -2149,8 +2181,9 @@
def get_title(self, session):
return "Start"
+ # the actual start/stop is done my master
def do_invoke(self, scheduler, args, completion):
- scheduler.Start(self.cumin_model.data, completion)
+ pass
class Stop(CuminAction):
def show(self, session, sched):
@@ -2163,8 +2196,9 @@
def get_title(self, session):
return "Stop"
+ # the actual start/stop is done my master
def do_invoke(self, scheduler, args, completion):
- scheduler.Stop(self.cumin_model.data, completion)
+ pass
class CuminSubmitter(RemoteClass):
def __init__(self, model):
@@ -2242,8 +2276,9 @@
def get_title(self, session):
return "Start"
+ # the actual start/stop is done my master
def do_invoke(self, collector, args, completion):
- collector.Start(self.cumin_model.data, completion)
+ pass
class Stop(CuminAction):
def show(self, session, collector):
@@ -2256,8 +2291,9 @@
def get_title(self, session):
return "Stop"
+ # the actual start/stop is done my master
def do_invoke(self, collector, args, completion):
- collector.Stop(self.cumin_model.data, completion)
+ pass
class CuminNegotiator(RemoteClass):
def __init__(self, model):
@@ -2272,24 +2308,33 @@
prop = CuminProperty(self, "MyAddress")
prop.title = "Address"
+
+ prop = CuminProperty(self, "DaemonStartTime")
+ prop.title = "Start Time"
stat = CuminStat(self, "MonitorSelfAge")
stat.title = "Age"
+ stat.category = "general"
stat = CuminStat(self, "MonitorSelfCPUUsage")
stat.title = "CPU Usage"
+ stat.category = "general"
stat = CuminStat(self, "MonitorSelfImageSize")
stat.title = "Image Size"
+ stat.category = "general"
stat = CuminStat(self, "MonitorSelfRegisteredSocketCount")
stat.title = "Registered Socket Count"
+ stat.category = "general"
stat = CuminStat(self, "MonitorSelfResidentSetSize")
stat.title = "Resident Set Size"
+ stat.category = "general"
- stat = CuminStat(self, "MonitorSelfTime")
- stat.title = "Time"
+# stat = CuminStat(self, "MonitorSelfTime")
+# stat.title = "Time"
+# stat.category = "general"
action = self.Start(self, "start")
action.summary = True
@@ -2328,8 +2373,9 @@
def get_title(self, session):
return "Start"
+ # the actual start/stop is done my master
def do_invoke(self, negotiator, args, completion):
- negotiator.Start(self.cumin_model.data, completion)
+ pass
class Stop(CuminAction):
def show(self, session, neg):
@@ -2342,8 +2388,9 @@
def get_title(self, session):
return "Stop"
+ # the actual start/stop is done my master
def do_invoke(self, negotiator, args, completion):
- negotiator.Stop(self.cumin_model.data, completion)
+ pass
class GetLimitCount(CuminAction):
def do_invoke(self, negotiator):