CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
o2oMgr.O2OMgrTool Class Reference
Inheritance diagram for o2oMgr.O2OMgrTool:
o2oMgr.CommandTool

Public Member Functions

def __init__
 
def create
 
def disable
 
def enable
 
def listConf
 
def listJobs
 
def migrate
 
def setConfig
 
def setInterval
 
def setup
 
- Public Member Functions inherited from o2oMgr.CommandTool
def __init__
 
def addCommand
 
def addOption
 
def execute
 
def setup
 

Public Attributes

 mgr
 
- Public Attributes inherited from o2oMgr.CommandTool
 args
 
 commands
 
 options
 
 parser
 

Detailed Description

Definition at line 61 of file o2oMgr.py.

Constructor & Destructor Documentation

def o2oMgr.O2OMgrTool.__init__ (   self)

Definition at line 62 of file o2oMgr.py.

62 
63  def __init__(self):
64  CommandTool.__init__(self)
65  self.mgr = None
66  CommandTool.addOption(self,"name", "n", type=str, help="the o2o job name")
67  CommandTool.addOption(self,"configFile", "c", type=str, help="the JSON configuration file path")
68  CommandTool.addOption(self,"interval", "i", type=int, help="the chron job interval")
69  CommandTool.addOption(self,"db", type=str, help="the target database: pro ( for prod ) or dev ( for prep ). default=pro")
70  CommandTool.addOption(self,"auth","a", type=str, help="path of the authentication file")
71  CommandTool.addCommand( self,"create", "create a new O2O job", "name","configFile","interval")
72  CommandTool.addCommand(self,"setConfig","set a new configuration for the specified job","name","configFile" )
73  CommandTool.addCommand(self,"setInterval","set a new execution interval for the specified job","name","interval" )
74  CommandTool.addCommand(self,"enable","enable the O2O job","name" )
75  CommandTool.addCommand(self,"disable", "disable the O2O job" , "name")
76  CommandTool.addCommand(self,"migrate", "migrate the tag info for the jobs in configuration entries" )
77  CommandTool.addCommand(self,"listJobs", "list the registered jobs" )
78  CommandTool.addCommand(self,"listConf", "shows the configurations for the specified job", "name")

Member Function Documentation

def o2oMgr.O2OMgrTool.create (   self)

Definition at line 90 of file o2oMgr.py.

90 
91  def create(self):
92  self.mgr.add( self.args.name, self.args.configFile, self.args.interval, True )
def o2oMgr.O2OMgrTool.disable (   self)

Definition at line 102 of file o2oMgr.py.

103  def disable(self):
104  self.mgr.setConfig( self.args.name, False )
def o2oMgr.O2OMgrTool.enable (   self)

Definition at line 99 of file o2oMgr.py.

99 
100  def enable(self):
101  self.mgr.setConfig( self.args.name, True )
def o2oMgr.O2OMgrTool.listConf (   self)

Definition at line 111 of file o2oMgr.py.

112  def listConf(self):
113  self.mgr.listConfig( self.args.name )
def o2oMgr.O2OMgrTool.listJobs (   self)

Definition at line 108 of file o2oMgr.py.

109  def listJobs(self):
110  self.mgr.listJobs()
def o2oMgr.O2OMgrTool.migrate (   self)

Definition at line 105 of file o2oMgr.py.

106  def migrate(self):
107  self.mgr.migrateConfig()
def o2oMgr.O2OMgrTool.setConfig (   self)

Definition at line 93 of file o2oMgr.py.

93 
94  def setConfig(self):
95  self.mgr.setConfig( self.args.name, self.args.configFile )
def o2oMgr.O2OMgrTool.setInterval (   self)

Definition at line 96 of file o2oMgr.py.

96 
97  def setInterval(self):
98  self.mgr.setConfig( self.args.name, self.args.interval )
def o2oMgr.O2OMgrTool.setup (   self)

Definition at line 79 of file o2oMgr.py.

References o2oMgr.O2OMgrTool.mgr, and o2oMgr.CommandTool.setup().

79 
80  def setup(self):
81  db_service = o2olib.prod_db_service
82  if self.args.db is not None:
83  if self.args.db == 'dev' or self.args.db == 'oradev' :
84  db_service = o2olib.dev_db_service
85  elif self.args.db != 'orapro' and self.args.db != 'onlineorapro' and self.args.db != 'pro':
86  raise Exception("Database '%s' is not known." %self.args.db )
87 
88  self.mgr = o2olib.O2OJobMgr()
89  return self.mgr.connect( db_service, self.args.auth )

Member Data Documentation

o2oMgr.O2OMgrTool.mgr

Definition at line 64 of file o2oMgr.py.

Referenced by o2oMgr.O2OMgrTool.setup().