forked from dmsimard/python-cachetclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple-test.py
49 lines (37 loc) · 1.28 KB
/
simple-test.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
import mscience_cachetclient.cachet as cachet
import json
import os
ENDPOINT = os.environ['QA_CACHET_ENDPOINT']
TOKEN = os.environ['QA_CACHET_TOKEN']
factory = cachet.Factory(api_token=TOKEN, endpoint=ENDPOINT)
ping = factory.get("Ping")
print(ping.get())
components = factory.get('Components')
print(components.get(id=2))
# groups = factory.get('Groups')
# print(groups.get(id=1))
runs = factory.get('Runs')
# print( runs.get(id=23))
# new_run = json.loads(runs.post(name='Test nile component run',
# component_id=2,
# description='API Client Inserted',
# airflow='https://airflow.com'
# )
# )
# print(runs.get(id=new_run['data']['id']))
updated_run = json.loads(runs.put(
id=37,
status=-1
)
)
run = runs.get(id=37)
print(run)
updated_run = json.loads(runs.put(
id=37,
status=1
)
)
run = runs.get(id=37)
print(run)
# testing = factory.get('NotHere')