diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-07-13 13:53:10 +0200 |
---|---|---|
committer | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-07-14 11:21:16 +0200 |
commit | 513308fe810ac56457e20778acc18d5a4455b98f (patch) | |
tree | 7ee22d5728d551dee1aad62437b117487a3e51be /cli/objects/client.py | |
parent | f4e1bb767b98ef8370208c79123b6eafac5f4732 (diff) |
Add ogcli list client command
This requests GET /client/properties by calling something like:
ogcli list client --id=6
It is important to notice that 'id' must be a "computer" type
scope id.
Diffstat (limited to 'cli/objects/client.py')
-rw-r--r-- | cli/objects/client.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/objects/client.py b/cli/objects/client.py index 9404635..e7e3d31 100644 --- a/cli/objects/client.py +++ b/cli/objects/client.py @@ -28,3 +28,17 @@ class OgClient(): 'type': 'computer'}} r = rest.get('/hardware', payload=payload) print(r.json()) + + @staticmethod + def get_client_properties(rest, args): + parser = argparse.ArgumentParser() + parser.add_argument('--id', + nargs=1, + required=True, + help='ID of the computer scope') + parsed_args = parser.parse_args(args) + + payload = {'scope': {'id': int(parsed_args.id[0]), + 'type': 'computer'}} + r = rest.get('/client/properties', payload=payload) + print(r.json()) |