|
33 | 33 | status=1, |
34 | 34 | description='Test component')) |
35 | 35 | print(components.get()) |
36 | | -components.put(id=new_component['id'], description='Updated component') |
37 | | -print(components.get(id=new_component['id'])) |
38 | | -components.delete(id=new_component['id']) |
| 36 | +components.put(id=new_component['data']['id'], description='Updated component') |
| 37 | +print(components.get(id=new_component['data']['id'])) |
| 38 | +components.delete(id=new_component['data']['id']) |
39 | 39 |
|
40 | 40 | # /components/groups |
41 | 41 | groups = cachet.Groups(endpoint=ENDPOINT, api_token=API_TOKEN) |
42 | 42 | new_group = json.loads(groups.post(name='Test group')) |
43 | 43 | print(groups.get()) |
44 | | -groups.put(id=new_group['id'], name='Updated group') |
45 | | -print(groups.get(id=new_group['id'])) |
46 | | -groups.delete(new_group['id']) |
| 44 | +groups.put(id=new_group['data']['id'], name='Updated group') |
| 45 | +print(groups.get(id=new_group['data']['id'])) |
| 46 | +groups.delete(new_group['data']['id']) |
47 | 47 |
|
48 | 48 | # /incidents |
49 | 49 | incidents = cachet.Incidents(endpoint=ENDPOINT, api_token=API_TOKEN) |
50 | 50 | new_incident = json.loads(incidents.post(name='Test incident', |
51 | 51 | message='Houston, we have a problem.', |
52 | 52 | status=1)) |
53 | 53 | print(incidents.get()) |
54 | | -incidents.put(id=new_incident['id'], |
| 54 | +incidents.put(id=new_incident['data']['id'], |
55 | 55 | message="There's another problem, Houston.") |
56 | | -print(incidents.get(id=new_incident['id'])) |
57 | | -incidents.delete(id=new_incident['id']) |
| 56 | +print(incidents.get(id=new_incident['data']['id'])) |
| 57 | +incidents.delete(id=new_incident['data']['id']) |
58 | 58 |
|
59 | 59 | # /metrics |
60 | 60 | # /metrics/points |
|
64 | 64 | description='How many numbers per hour', |
65 | 65 | default_value=0)) |
66 | 66 | print(metrics.get()) |
67 | | -print(metrics.get(id=new_metric['id'])) |
| 67 | +print(metrics.get(id=new_metric['data']['id'])) |
68 | 68 |
|
69 | 69 | points = cachet.Points(endpoint=ENDPOINT, api_token=API_TOKEN) |
70 | | -new_point = json.loads(points.post(id=new_metric['id'], value=5)) |
71 | | -print(points.get(metric_id=new_metric['id'])) |
| 70 | +new_point = json.loads(points.post(id=new_metric['data']['id'], value=5)) |
| 71 | +print(points.get(metric_id=new_metric['data']['id'])) |
72 | 72 |
|
73 | | -points.delete(metric_id=new_metric['id'], point_id=new_point['id']) |
74 | | -metrics.delete(id=new_metric['id']) |
| 73 | +points.delete(metric_id=new_metric['data']['id'], |
| 74 | + point_id=new_point['data']['id']) |
| 75 | +metrics.delete(id=new_metric['data']['id']) |
75 | 76 |
|
76 | 77 | # /subscribers |
77 | 78 | subscribers = cachet.Subscribers(endpoint=ENDPOINT, api_token=API_TOKEN) |
78 | 79 | new_subscriber = json.loads(subscribers.post(email='test@test.org')) |
79 | | -subscribers.delete(id=new_subscriber['id']) |
| 80 | +subscribers.delete(id=new_subscriber['data']['id']) |
0 commit comments