def usermod(args): url = produce_url( ['admin', 'usermod'], [args.username, args.passw] ) response = place_request("post", url, token=args.apikey) return response.text
def users(args): url = produce_url( ['admin', 'users'], [args.users] ) response = place_request("get", url, token=args.apikey) return response.text
def sessions_per_point(args): url = produce_url( ["SessionsPerPoint"], [args.point, args.datefrom, args.dateto], args.format) response = place_request("get", url, token=args.apikey) return response.text
def login(args): url = produce_url(['login']) data = {'username': args.username, 'password': args.passw} response = place_request("post", url, data=data) if response.status_code == 200: create_token_file(response.json()["token"]) return response.text
def sessionupd(args): source = args.source token = args.apikey url = produce_url(["admin", "system", "sessionupd"]) with open(args.source, "r") as f: response = place_request("post", url, files={"file": f}, token=token) return response.text
def healthcheck(args): url = produce_url(["admin", "healthcheck"]) response = place_request("get", url) return response.text
def resetsessions(args): url = produce_url(["admin", "resetsessions"]) response = place_request("delete", url) return response.text
def sessions_per_station(args): url = produce_url(["SessionsPerStation"], [args.station, args.datefrom, args.dateto], args.format) response = place_request("get", url, token=args.apikey) return response.text
def logout(args): url = produce_url(['logout']) response = place_request("post", url, token=args.apikey) delete_token_file() return response.text