17 parser.add_argument(
"-c",
"--create", type=str, help=
"create a new O2O job" )
18 parser.add_argument(
"-1",
"--enable", type=str, help=
"enable the O2O job" )
19 parser.add_argument(
"-0",
"--disable", type=str, help=
"disable the O2O job" )
21 parser.add_argument(
"-t",
"--tag", type=str, help=
"the CondDB Tag name")
22 parser.add_argument(
"-i",
"--interval", type=str, help=
"the chron job interval")
23 parser.add_argument(
"-d",
"--dev", action=
"store_true", help=
"bookkeeping in dev database")
24 parser.add_argument(
"-p",
"--private", action=
"store_true", help=
"bookkeeping in private database")
25 parser.add_argument(
"-a",
"--auth", type=str, help=
"path of the authentication file")
26 args = parser.parse_args()
28 if not args.create
and not args.enable
and not args.disable:
29 parser.error(
"Command not given. Possible choices: create, enable, disable")
34 db_service = o2olib.dev_db_service
36 db_service = o2olib.prod_db_service
37 mgr = o2olib.O2OJobMgr()
39 if mgr.connect( db_service, args.auth ):
42 parser.error(
"Option 'tag' not provided.")
44 parser.error(
"Option 'interval' not provided.")
46 created = mgr.add( args.create, args.tag, args.interval,
True )
49 mgr.set( args.enable,
True )
51 mgr.set( args.disable,
False )