included scripts for api interaction
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
from common import add_common_arguments, ask, client_from_args, confirm, run
|
||||
parser = argparse.ArgumentParser(description="Route weich löschen")
|
||||
add_common_arguments(parser)
|
||||
parser.add_argument("--route-id", type=int)
|
||||
args = parser.parse_args()
|
||||
def action():
|
||||
client = client_from_args(args)
|
||||
route_id = ask("Route-ID", args.route_id, required=True, cast=int)
|
||||
if not confirm(f"Route {route_id} in den Papierkorb verschieben?"):
|
||||
return {"cancelled": True}
|
||||
return client.request("DELETE", f"/api/routes/{route_id}")
|
||||
run(action)
|
||||
Reference in New Issue
Block a user