I was trying to come up with a configure string equivalent to the following lines (which can be passed to scheduler.configure() after creating a scheduler instance):
__MYSQL_url = 'mysql://root:<password>@localhost/jobstore'
scheduler = Scheduler(standalone=True)
scheduler.add_jobstore(SQLAlchemyJobStore(url=__MYSQL_url), 'default')
I referred http://packages.python.org/APScheduler/#job-stores and came up with the following for SQLAlchemyJobStore (and also referred files in examples and tests directories): The following are the instruction found in the above url to create a job store and its input (like file, path, db, etc)
jobstores.X.class Class of the jobstore named X (specified as module.name:classname)
jobstores.X.Y Constructor option Y of jobstore X
To find out jobstores.X.Y, I looked into the SQLAlchemyJobStore class and came up with the following options:
Option #1: (engine)
__configure = { 'apscheduler.standalone': True,
'apscheduler.jobstores.sqlalchemy_store.class': 'apscheduler.jobstores.sqlalchemy_store:SQLAlchemyJobStore',
'apscheduler.jobstores.sqlalchemy_store.engine': create_engine(__MYSQL_url)}
scheduler = Scheduler()
scheduler.configure(__configure)
Option #2: (url)
__configure = { 'apscheduler.standalone': True,
'apscheduler.jobstores.sqlalchemy_store.class': 'apscheduler.jobstores.sqlalchemy_store:SQLAlchemyJobStore',
'apscheduler.jobstores.sqlalchemy_store.url': __MYSQL_url}
scheduler = Scheduler()
scheduler.configure(__configure)
Sadly none of them are working. So my questions are as follows:
#1. What is the equivalent of jobstores.X.Y for SQLAlchemyJobStore that should be used in the configure()?
#2. How do we make a particular job store as a __default__ job store in the scheduler configure()?
#3. The database name goes in the url but how should we mention the table name?
Thank you,
Sangeeth