-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeOrchestra.py
36 lines (26 loc) · 1.25 KB
/
geOrchestra.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from meta_apis.ask_gn_api import Ask_gn_api
from meta_apis.meta_manipulation import Meta_manipulation
from console.console import Console_api
import json
class geOrchestra:
def __init__(self, server, username, password):
self.server = server
self.username = username
self.password = password
self.gn = Ask_gn_api(server, username, password)
self.console = Console_api(server, username, password)
if __name__ == "__main__":
# Set up your username and password:
username = 'testadmin'
password = 'testadmin'
# Set up your server and the authentication URL:
server = "https://georchestra-127-0-1-1.traefik.me"
geOrchestra_api = geOrchestra(server, username, password)
geOrchestra_api.gn.generate_xsfr()
print(geOrchestra_api.gn.get_metadataxml("4b5f8e1b-de37-47cd-9203-37a59f318b09"))
usertestadmin = json.loads(geOrchestra_api.console.getusers(uid="testadmin"))
user_org = json.loads(geOrchestra_api.console.getorgs(uid=usertestadmin["org"]))
print(usertestadmin)
usertestadmin["orgObj"] = user_org
usertestadmin["description"] = "This is another test for console API"
print(geOrchestra_api.console.updateuserdetails(uid="testadmin",json=json.dumps(usertestadmin)))