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)
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))
def del_ticket(args): cfg = admin.load_config(args.conf_dir) with admin.Client(cfg) as c: c.del_ticket(args.ticket_id)
def stop_profile(args): cfg = admin.load_config(args.conf_dir) with admin.Client(cfg) as c: c.stop_profile()
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})