Skip to content

Commit 9289290

Browse files
author
Nicolas Georges
committed
Add vipapps.py, an admin tool to manage VIP apps
- Self-contained in vipapps/vipapps.py - Depends on vipclient, with a minor patch for generic GET/PUT requests
1 parent 4df3f95 commit 9289290

3 files changed

Lines changed: 674 additions & 0 deletions

File tree

src/vip_client/utils/vip.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,18 @@ def download_parallel(files):
308308
# Transparent connexion between executor.map() and the caller of download_parallel()
309309
yield from executor.map(download_thread, files)
310310

311+
def generic_get(endpoint)->list:
312+
url = __PREFIX + endpoint
313+
rq = SESSION.get(url, headers=__headers)
314+
manage_errors(rq)
315+
return rq.json()
316+
317+
def generic_put(endpoint,data)->list:
318+
url = __PREFIX + endpoint
319+
rq = SESSION.put(url, headers=__headers, json=data)
320+
manage_errors(rq)
321+
return rq.json()
322+
311323
################################ EXECUTIONS ###################################
312324
# -----------------------------------------------------------------------------
313325
def list_executions()->list:

vipapps/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This is an admin-level tool to manage VIP apps descriptors.
2+
3+
For commands that communicate with a VIP instance, set these two
4+
environment variables:
5+
- `export VIP_API_URL=...` # VIP-portal host URL (without /rest)
6+
- `export VIP_API_KEY=...` # Your API key (admin level required)
7+
8+
Then see usage with:
9+
`python3 ./vipapps/vipapps.py --help`
10+
or `python3 ./vipapps/vipapps.py <command> --help`

0 commit comments

Comments
 (0)