コード例 #1
0
def add_ticket(args):
    with open(args.filename) as f:
        data = f.read()
    ticket = json.loads(data)
    cfg = admin.load_config(args.conf_dir)
    with admin.Client(cfg) as c:
        c.add_ticket(ticket)
コード例 #2
0
def show_ticket(args):
    cfg = admin.load_config(args.conf_dir)
    with admin.Client(cfg) as c:
        info = c.get_ticket(args.ticket_id)
    print(json.dumps(info, indent=2))
コード例 #3
0
def del_ticket(args):
    cfg = admin.load_config(args.conf_dir)
    with admin.Client(cfg) as c:
        c.del_ticket(args.ticket_id)
コード例 #4
0
def stop_profile(args):
    cfg = admin.load_config(args.conf_dir)
    with admin.Client(cfg) as c:
        c.stop_profile()
コード例 #5
0
def mod_ticket(args):
    cfg = admin.load_config(args.conf_dir)
    with admin.Client(cfg) as c:
        c.mod_ticket(args.ticket_id, {"timeout": args.timeout})