summaryrefslogtreecommitdiffstats
path: root/cli/objects
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2023-10-17 13:29:26 +0200
committerJose M. Guisado <jguisado@soleta.eu>2023-10-18 09:29:38 +0200
commit181075e5053f03080f2a82784bf0368d53365e9d (patch)
treea99716f7f588efc36cd8ab4f510f22cab0303e61 /cli/objects
parent8be21d4ac51943c326d368a70c778fb96fa60b94 (diff)
center: add delete command
command to delete center ogcli delete center --id <center id> To delete the center with id 6 $ ogcli delete center --id 6
Diffstat (limited to 'cli/objects')
-rw-r--r--cli/objects/center.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/objects/center.py b/cli/objects/center.py
index 9275703..1869efd 100644
--- a/cli/objects/center.py
+++ b/cli/objects/center.py
@@ -18,3 +18,13 @@ class OgCenter():
payload['comment'] = parsed_args.comment
rest.post('/center/add', payload=payload)
+ @staticmethod
+ def delete_center(rest, args):
+ parser = argparse.ArgumentParser(prog='ogcli delete center')
+ parser.add_argument('--id',
+ nargs='?',
+ required=True,
+ help='center id in database')
+ parsed_args = parser.parse_args(args)
+ payload = {'id': parsed_args.id}
+ rest.post('/center/delete', payload=payload)