diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-03 10:44:36 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-03 10:44:36 +0300 |
commit | a2bd5bca4c60499b3f9a2b99ec0dd0645bc718fe (patch) | |
tree | d2f385b16355b5f3efe3dc6c2e9699cc1bba59b2 /qvisqvetool | |
parent | 9353d90a656acc45451956b4048f7a5befcf22cd (diff) | |
download | qvisqve-a2bd5bca4c60499b3f9a2b99ec0dd0645bc718fe.tar.gz |
Add: PUT /applications/id
Diffstat (limited to 'qvisqvetool')
-rwxr-xr-x | qvisqvetool | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qvisqvetool b/qvisqvetool index 731606e..bfd92fe 100755 --- a/qvisqvetool +++ b/qvisqvetool @@ -150,6 +150,17 @@ class QvisqveTool(cliapp.Application): self.output.write('Set secret for {}\n'.format(name)) + def cmd_add_callback(self, args): + name, callback = args + + api, token = self.get_api() + + path = '/applications/{}'.format(name) + r = api.GET(token, path) + app = r.json() + app['callbacks'] = app.get('callbacks', []) + [callback] + api.PUT(token, path, json.dumps(app), json_content_type) + def cmd_GET(self, args): api, token = self.get_api() r = api.GET(token, args[0]) @@ -313,6 +324,7 @@ def default_scopes(): scopes.append('uapi_{}_post'.format(resource_type)) scopes.append('uapi_{}_get'.format(resource_type)) scopes.append('uapi_{}_id_get'.format(resource_type)) + scopes.append('uapi_{}_id_put'.format(resource_type)) scopes.append('uapi_{}_id_secret_put'.format(resource_type)) scopes.append('uapi_{}_id_delete'.format(resource_type)) return ' '.join(scopes) |