included scripts for api interaction
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
from common import add_common_arguments, ask, ask_path, client_from_args, run
|
||||
parser = argparse.ArgumentParser(description="Audiodatei zu einem POI hochladen")
|
||||
add_common_arguments(parser)
|
||||
parser.add_argument("--route-id", type=int)
|
||||
parser.add_argument("--poi-id", type=int)
|
||||
parser.add_argument("--file")
|
||||
args = parser.parse_args()
|
||||
def action():
|
||||
client = client_from_args(args)
|
||||
route_id = ask("Route-ID", args.route_id, required=True, cast=int)
|
||||
poi_id = ask("POI-ID", args.poi_id, required=True, cast=int)
|
||||
audio = ask_path("Audiodatei", args.file)
|
||||
return client.request("POST", f"/api/routes/{route_id}/pois/{poi_id}/audio", files={"audio": audio})
|
||||
run(action)
|
||||
Reference in New Issue
Block a user