summaryrefslogtreecommitdiffstats
path: root/cli/objects/folder.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/objects/folder.py')
-rw-r--r--cli/objects/folder.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/cli/objects/folder.py b/cli/objects/folder.py
index 4b9485b..c4da900 100644
--- a/cli/objects/folder.py
+++ b/cli/objects/folder.py
@@ -18,12 +18,12 @@ class OgFolder():
group.add_argument('--center-id',
nargs='?',
type=int,
- required=True,
+ required=False,
help='provide the id of the center that will contain the folder')
group.add_argument('--room-id',
nargs='?',
type=int,
- required=True,
+ required=False,
help='provide the id of the room that will contain the folder')
parser.add_argument('--name',
@@ -42,6 +42,25 @@ class OgFolder():
rest.post('/folder/add', payload=payload)
@staticmethod
+ def update_folder(rest, args):
+ parser = argparse.ArgumentParser(prog='ogcli update folder')
+ parser.add_argument('--id',
+ type=int,
+ nargs='?',
+ required=True,
+ help='folder id in database')
+ parser.add_argument('--name',
+ nargs='?',
+ required=True,
+ help='the new name for the folder')
+ parsed_args = parser.parse_args(args)
+ payload = {
+ 'id': parsed_args.id,
+ 'name': parsed_args.name,
+ }
+ rest.post('/folder/update', payload=payload)
+
+ @staticmethod
def delete_folder(rest, args):
parser = argparse.ArgumentParser(prog='ogcli delete folder')
parser.add_argument('--id',