zenoss_client 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +3 -1
  3. data/.travis.yml +9 -0
  4. data/Gemfile +1 -1
  5. data/README.textile +6 -1
  6. data/Rakefile +5 -4
  7. data/VERSION +1 -1
  8. data/lib/zenoss.rb +2 -2
  9. data/lib/zenoss/connection.rb +3 -2
  10. data/lib/zenoss/jsonapi/events_router.rb +0 -1
  11. data/lib/zenoss/model/devices/device.rb +9 -0
  12. data/test/docker/3.2.1/Dockerfile +11 -0
  13. data/test/docker/3.2.1/remote_start.sh +3 -0
  14. data/test/docker/3.2.1/start.sh +2 -0
  15. data/test/docker/4.2.5/Dockerfile +10 -0
  16. data/test/docker/4.2.5/remote_start.sh +12 -0
  17. data/test/docker/4.2.5/start.sh +2 -0
  18. data/test/fixtures/.gitkeep +0 -0
  19. data/test/fixtures/vcr_cassettes/3_2_1_initial_connection.yml +437 -0
  20. data/test/fixtures/vcr_cassettes/3_2_1_test_0001_returns_an_Array_of_devices_when_searched_by_name.yml +85 -0
  21. data/test/fixtures/vcr_cassettes/3_2_1_test_0002_returns_device_uptime_when_asked.yml +110 -0
  22. data/test/fixtures/vcr_cassettes/3_2_1_test_0003_returns_an_Array_of_events_for_a_device.yml +80 -0
  23. data/test/fixtures/vcr_cassettes/3_2_1_test_0004_returns_an_Array_of_historical_events_for_a_device.yml +80 -0
  24. data/test/fixtures/vcr_cassettes/3_2_1_test_0005_returns_info_for_a_device_in_the_form_of_a_Hash.yml +251 -0
  25. data/test/fixtures/vcr_cassettes/3_2_1_test_0006_returns_an_Array_of_events_for_all_devices.yml +86 -0
  26. data/test/fixtures/vcr_cassettes/3_2_1_test_0007_fetches_the_report_tree.yml +181 -0
  27. data/test/fixtures/vcr_cassettes/3_2_1_test_0008_fetches_available_report_types_and_returns_a_Hash.yml +82 -0
  28. data/test/fixtures/vcr_cassettes/3_2_1_test_0009_renames_the_device.yml +151 -0
  29. data/test/fixtures/vcr_cassettes/4_2_5_initial_connection.yml +594 -0
  30. data/test/fixtures/vcr_cassettes/4_2_5_test_0001_returns_an_Array_of_devices_when_searched_by_name.yml +93 -0
  31. data/test/fixtures/vcr_cassettes/4_2_5_test_0002_returns_device_uptime_when_asked.yml +114 -0
  32. data/test/fixtures/vcr_cassettes/4_2_5_test_0003_returns_an_Array_of_events_for_a_device.yml +99 -0
  33. data/test/fixtures/vcr_cassettes/4_2_5_test_0004_returns_an_Array_of_historical_events_for_a_device.yml +99 -0
  34. data/test/fixtures/vcr_cassettes/4_2_5_test_0005_returns_info_for_a_device_in_the_form_of_a_Hash.yml +234 -0
  35. data/test/fixtures/vcr_cassettes/4_2_5_test_0006_returns_an_Array_of_events_for_all_devices.yml +203 -0
  36. data/test/fixtures/vcr_cassettes/4_2_5_test_0007_fetches_the_report_tree.yml +203 -0
  37. data/test/fixtures/vcr_cassettes/4_2_5_test_0008_fetches_available_report_types_and_returns_a_Hash.yml +86 -0
  38. data/test/fixtures/vcr_cassettes/4_2_5_test_0009_renames_the_device.yml +160 -0
  39. data/test/test_helper.rb +20 -11
  40. data/test/zenoss_client_test.rb +140 -114
  41. data/zenoss_client.gemspec +13 -9
  42. metadata +104 -37
@@ -0,0 +1,93 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":17}]'
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Fri, 22 May 2015 12:14:37 GMT
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ Cookie:
19
+ - _ZopeId=47495875A68v.lkNK6o
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
27
+ Date:
28
+ - Fri, 22 May 2015 12:14:37 GMT
29
+ Content-Length:
30
+ - '906'
31
+ Content-Type:
32
+ - application/json
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"uuid": "195e32eb-1d92-4bac-9260-48f72561d8c3", "action": "DeviceRouter",
36
+ "result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
37
+ null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
38
+ null, "collector": "localhost", "osModel": null, "productionState": 1000,
39
+ "systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
40
+ null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
41
+ "ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
42
+ "clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
43
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
44
+ 0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
45
+ "name": "UnitTestDevice"}]}, "tid": 17, "type": "rpc", "method": "getDevices"}'
46
+ http_version:
47
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
48
+ - request:
49
+ method: post
50
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
51
+ body:
52
+ encoding: UTF-8
53
+ string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":18}]'
54
+ headers:
55
+ User-Agent:
56
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
57
+ Accept:
58
+ - "*/*"
59
+ Date:
60
+ - Fri, 22 May 2015 12:14:37 GMT
61
+ Content-Type:
62
+ - application/json; charset=utf-8
63
+ Cookie:
64
+ - _ZopeId=47495875A68v.lkNK6o
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Server:
71
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
72
+ Date:
73
+ - Fri, 22 May 2015 12:14:37 GMT
74
+ Content-Length:
75
+ - '906'
76
+ Content-Type:
77
+ - application/json
78
+ body:
79
+ encoding: UTF-8
80
+ string: '{"uuid": "9c94307c-db71-43d2-954d-a3cb654f271c", "action": "DeviceRouter",
81
+ "result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
82
+ null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
83
+ null, "collector": "localhost", "osModel": null, "productionState": 1000,
84
+ "systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
85
+ null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
86
+ "ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
87
+ "clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
88
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
89
+ 0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
90
+ "name": "UnitTestDevice"}]}, "tid": 18, "type": "rpc", "method": "getDevices"}'
91
+ http_version:
92
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
93
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,114 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":10}]'
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Fri, 22 May 2015 12:14:36 GMT
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ Cookie:
19
+ - _ZopeId=47495875A68v.lkNK6o
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
27
+ Date:
28
+ - Fri, 22 May 2015 12:14:36 GMT
29
+ Content-Length:
30
+ - '906'
31
+ Content-Type:
32
+ - application/json
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"uuid": "24383d45-6737-484a-9a5d-3a3a11264718", "action": "DeviceRouter",
36
+ "result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
37
+ null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
38
+ null, "collector": "localhost", "osModel": null, "productionState": 1000,
39
+ "systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
40
+ null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
41
+ "ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
42
+ "clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
43
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
44
+ 0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
45
+ "name": "UnitTestDevice"}]}, "tid": 10, "type": "rpc", "method": "getDevices"}'
46
+ http_version:
47
+ recorded_at: Fri, 22 May 2015 12:14:36 GMT
48
+ - request:
49
+ method: get
50
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/Devices/Server/devices/UnitTestDevice/sysUpTime
51
+ body:
52
+ encoding: UTF-8
53
+ string: ''
54
+ headers:
55
+ User-Agent:
56
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
57
+ Accept:
58
+ - "*/*"
59
+ Date:
60
+ - Fri, 22 May 2015 12:14:36 GMT
61
+ Cookie:
62
+ - _ZopeId=47495875A68v.lkNK6o
63
+ response:
64
+ status:
65
+ code: 200
66
+ message: OK
67
+ headers:
68
+ Server:
69
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
70
+ Date:
71
+ - Fri, 22 May 2015 12:14:36 GMT
72
+ Content-Length:
73
+ - '3'
74
+ Content-Type:
75
+ - text/plain; charset=utf-8
76
+ body:
77
+ encoding: UTF-8
78
+ string: nan
79
+ http_version:
80
+ recorded_at: Fri, 22 May 2015 12:14:36 GMT
81
+ - request:
82
+ method: get
83
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/Devices/Server/devices/UnitTestDevice/sysUpTime
84
+ body:
85
+ encoding: UTF-8
86
+ string: ''
87
+ headers:
88
+ User-Agent:
89
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
90
+ Accept:
91
+ - "*/*"
92
+ Date:
93
+ - Fri, 22 May 2015 12:14:36 GMT
94
+ Cookie:
95
+ - _ZopeId=47495875A68v.lkNK6o
96
+ response:
97
+ status:
98
+ code: 200
99
+ message: OK
100
+ headers:
101
+ Server:
102
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
103
+ Date:
104
+ - Fri, 22 May 2015 12:14:36 GMT
105
+ Content-Length:
106
+ - '3'
107
+ Content-Type:
108
+ - text/plain; charset=utf-8
109
+ body:
110
+ encoding: UTF-8
111
+ string: nan
112
+ http_version:
113
+ recorded_at: Fri, 22 May 2015 12:14:36 GMT
114
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,99 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":11}]'
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Fri, 22 May 2015 12:14:36 GMT
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ Cookie:
19
+ - _ZopeId=47495875A68v.lkNK6o
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
27
+ Date:
28
+ - Fri, 22 May 2015 12:14:36 GMT
29
+ Content-Length:
30
+ - '906'
31
+ Content-Type:
32
+ - application/json
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"uuid": "ce741537-ab28-42ec-9864-2b938f1c1c8e", "action": "DeviceRouter",
36
+ "result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
37
+ null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
38
+ null, "collector": "localhost", "osModel": null, "productionState": 1000,
39
+ "systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
40
+ null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
41
+ "ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
42
+ "clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
43
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
44
+ 0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
45
+ "name": "UnitTestDevice"}]}, "tid": 11, "type": "rpc", "method": "getDevices"}'
46
+ http_version:
47
+ recorded_at: Fri, 22 May 2015 12:14:36 GMT
48
+ - request:
49
+ method: post
50
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/evconsole_router
51
+ body:
52
+ encoding: UTF-8
53
+ string: '[{"action":"EventsRouter","method":"query","data":[{"limit":100,"start":0,"sort":"lastTime","dir":"DESC","uid":"/zport/dmd/Devices/Server/devices/UnitTestDevice"}],"type":"rpc","tid":12}]'
54
+ headers:
55
+ User-Agent:
56
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
57
+ Accept:
58
+ - "*/*"
59
+ Date:
60
+ - Fri, 22 May 2015 12:14:36 GMT
61
+ Content-Type:
62
+ - application/json; charset=utf-8
63
+ Cookie:
64
+ - _ZopeId=47495875A68v.lkNK6o
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Server:
71
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
72
+ Date:
73
+ - Fri, 22 May 2015 12:14:36 GMT
74
+ Content-Length:
75
+ - '1341'
76
+ Content-Type:
77
+ - application/json
78
+ body:
79
+ encoding: UTF-8
80
+ string: '{"uuid": "ea06b90e-c24d-401e-8b7a-c35b5f48b09e", "action": "EventsRouter",
81
+ "result": {"totalCount": 1, "events": [{"prodState": null, "firstTime": "2015-05-22
82
+ 12:13:50", "facility": null, "eventClassKey": null, "agent": null, "dedupid":
83
+ "UnitTestDevice||/Change/Remove|2|Deleted device: UnitTestDevice", "Location":
84
+ [], "ownerid": null, "eventClass": {"text": "/Change/Remove", "uid": "/zport/dmd/Events/Change/Remove"},
85
+ "id": "0242ac11-0025-9742-11e5-007c0173f789", "DevicePriority": null, "monitor":
86
+ null, "priority": null, "details": {}, "DeviceClass": [], "eventKey": "",
87
+ "evid": "0242ac11-0025-9742-11e5-007c0173f789", "eventClassMapping": "", "component":
88
+ {"url": null, "text": null, "uid": null, "uuid": null}, "clearid": null, "DeviceGroups":
89
+ [], "eventGroup": null, "device": {"url": "/zport/dmd/goto?guid=00217159-594e-49da-889c-7650f8329068",
90
+ "text": "UnitTestDevice", "uuid": "00217159-594e-49da-889c-7650f8329068",
91
+ "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice"}, "message": "Deleted
92
+ device: UnitTestDevice", "severity": 2, "count": 1, "stateChange": "2015-05-22
93
+ 12:13:50", "ntevid": null, "summary": "Deleted device: UnitTestDevice", "eventState":
94
+ "Closed", "lastTime": "2015-05-22 12:13:50", "ipAddress": "", "Systems": []}],
95
+ "success": true, "asof": 1432296876.617308}, "tid": 12, "type": "rpc", "method":
96
+ "query"}'
97
+ http_version:
98
+ recorded_at: Fri, 22 May 2015 12:14:36 GMT
99
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,99 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":15}]'
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Fri, 22 May 2015 12:14:37 GMT
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ Cookie:
19
+ - _ZopeId=47495875A68v.lkNK6o
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
27
+ Date:
28
+ - Fri, 22 May 2015 12:14:37 GMT
29
+ Content-Length:
30
+ - '906'
31
+ Content-Type:
32
+ - application/json
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"uuid": "ccecf673-8e59-44fc-b189-706139dec777", "action": "DeviceRouter",
36
+ "result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
37
+ null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
38
+ null, "collector": "localhost", "osModel": null, "productionState": 1000,
39
+ "systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
40
+ null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
41
+ "ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
42
+ "clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
43
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
44
+ 0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
45
+ "name": "UnitTestDevice"}]}, "tid": 15, "type": "rpc", "method": "getDevices"}'
46
+ http_version:
47
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
48
+ - request:
49
+ method: post
50
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/evconsole_router
51
+ body:
52
+ encoding: UTF-8
53
+ string: '[{"action":"EventsRouter","method":"query","data":[{"limit":100,"start":0,"sort":"lastTime","dir":"DESC","uid":"/zport/dmd/Devices/Server/devices/UnitTestDevice"}],"type":"rpc","tid":16}]'
54
+ headers:
55
+ User-Agent:
56
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
57
+ Accept:
58
+ - "*/*"
59
+ Date:
60
+ - Fri, 22 May 2015 12:14:37 GMT
61
+ Content-Type:
62
+ - application/json; charset=utf-8
63
+ Cookie:
64
+ - _ZopeId=47495875A68v.lkNK6o
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Server:
71
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
72
+ Date:
73
+ - Fri, 22 May 2015 12:14:37 GMT
74
+ Content-Length:
75
+ - '1341'
76
+ Content-Type:
77
+ - application/json
78
+ body:
79
+ encoding: UTF-8
80
+ string: '{"uuid": "0b0e6f34-140e-489e-af49-89b5d4ff7939", "action": "EventsRouter",
81
+ "result": {"totalCount": 1, "events": [{"prodState": null, "firstTime": "2015-05-22
82
+ 12:13:50", "facility": null, "eventClassKey": null, "agent": null, "dedupid":
83
+ "UnitTestDevice||/Change/Remove|2|Deleted device: UnitTestDevice", "Location":
84
+ [], "ownerid": null, "eventClass": {"text": "/Change/Remove", "uid": "/zport/dmd/Events/Change/Remove"},
85
+ "id": "0242ac11-0025-9742-11e5-007c0173f789", "DevicePriority": null, "monitor":
86
+ null, "priority": null, "details": {}, "DeviceClass": [], "eventKey": "",
87
+ "evid": "0242ac11-0025-9742-11e5-007c0173f789", "eventClassMapping": "", "component":
88
+ {"url": null, "text": null, "uid": null, "uuid": null}, "clearid": null, "DeviceGroups":
89
+ [], "eventGroup": null, "device": {"url": "/zport/dmd/goto?guid=00217159-594e-49da-889c-7650f8329068",
90
+ "text": "UnitTestDevice", "uuid": "00217159-594e-49da-889c-7650f8329068",
91
+ "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice"}, "message": "Deleted
92
+ device: UnitTestDevice", "severity": 2, "count": 1, "stateChange": "2015-05-22
93
+ 12:13:50", "ntevid": null, "summary": "Deleted device: UnitTestDevice", "eventState":
94
+ "Closed", "lastTime": "2015-05-22 12:13:50", "ipAddress": "", "Systems": []}],
95
+ "success": true, "asof": 1432296877.137202}, "tid": 16, "type": "rpc", "method":
96
+ "query"}'
97
+ http_version:
98
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
99
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,234 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":19}]'
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Fri, 22 May 2015 12:14:37 GMT
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ Cookie:
19
+ - _ZopeId=47495875A68v.lkNK6o
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
27
+ Date:
28
+ - Fri, 22 May 2015 12:14:37 GMT
29
+ Content-Length:
30
+ - '906'
31
+ Content-Type:
32
+ - application/json
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"uuid": "7f910b72-452c-47b7-b65d-2c74b4cda6fe", "action": "DeviceRouter",
36
+ "result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
37
+ null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
38
+ null, "collector": "localhost", "osModel": null, "productionState": 1000,
39
+ "systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
40
+ null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
41
+ "ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
42
+ "clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
43
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
44
+ 0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
45
+ "name": "UnitTestDevice"}]}, "tid": 19, "type": "rpc", "method": "getDevices"}'
46
+ http_version:
47
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
48
+ - request:
49
+ method: post
50
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
51
+ body:
52
+ encoding: UTF-8
53
+ string: '[{"action":"DeviceRouter","method":"getInfo","data":[{"uid":"/zport/dmd/Devices/Server/devices/UnitTestDevice"}],"type":"rpc","tid":20}]'
54
+ headers:
55
+ User-Agent:
56
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
57
+ Accept:
58
+ - "*/*"
59
+ Date:
60
+ - Fri, 22 May 2015 12:14:37 GMT
61
+ Content-Type:
62
+ - application/json; charset=utf-8
63
+ Cookie:
64
+ - _ZopeId=47495875A68v.lkNK6o
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Server:
71
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
72
+ Date:
73
+ - Fri, 22 May 2015 12:14:37 GMT
74
+ Content-Length:
75
+ - '2198'
76
+ Content-Type:
77
+ - application/json
78
+ body:
79
+ encoding: UTF-8
80
+ string: '{"uuid": "e7b5baa4-3626-450b-9798-9f1fbd5a7dc6", "action": "DeviceRouter",
81
+ "result": {"disabled": false, "data": {"productionState": 1000, "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
82
+ "links": "", "snmpContact": "", "osModel": null, "hwModel": null, "osManufacturer":
83
+ null, "deviceClass": {"uuid": "98db2956-4f5f-42f5-ac1f-173ff47b306d", "name":
84
+ "/Server", "severity": "error", "id": "Server", "meta_type": "DeviceClass",
85
+ "inspector_type": "DeviceClass", "path": "/Devices/Server", "uid": "/zport/dmd/Devices/Server",
86
+ "events": {"info": {"count": 1, "acknowledged_count": 0}, "clear": {"count":
87
+ 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
88
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
89
+ 1, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
90
+ "description": ""}, "hwManufacturer": null, "snmpVersion": "v2c", "collector":
91
+ "localhost", "id": "UnitTestDevice", "uptime": "Unknown", "severity": "clear",
92
+ "locking": {"updates": false, "deletion": false, "events": false}, "comments":
93
+ "", "name": "UnitTestDevice", "priority": 3, "snmpCommunity": "public", "location":
94
+ null, "memory": {"ram": "Unknown", "swap": "Unknown"}, "icon": "/zport/dmd/img/icons/server.png",
95
+ "priorityLabel": "Normal", "lastCollected": "Not Modeled", "events": {"info":
96
+ {"count": 0, "acknowledged_count": 0}, "clear": {"count": 0, "acknowledged_count":
97
+ 0}, "warning": {"count": 0, "acknowledged_count": 0}, "critical": {"count":
98
+ 0, "acknowledged_count": 0}, "error": {"count": 0, "acknowledged_count": 0},
99
+ "debug": {"count": 0, "acknowledged_count": 0}}, "systems": [], "status":
100
+ true, "ipAddressString": null, "description": "", "snmpDescr": "", "groups":
101
+ [], "device": "UnitTestDevice", "firstSeen": "2015/05/22 12:14:21", "snmpSysName":
102
+ "", "pythonClass": "Products.ZenModel.Device", "lastChanged": "2015/05/22
103
+ 12:14:37", "productionStateLabel": "Production", "serialNumber": "", "uuid":
104
+ "00217159-594e-49da-889c-7650f8329068", "tagNumber": "", "meta_type": "Device",
105
+ "inspector_type": "Device", "snmpLocation": "", "snmpAgent": "", "ipAddress":
106
+ null, "rackSlot": 0}, "success": true}, "tid": 20, "type": "rpc", "method":
107
+ "getInfo"}'
108
+ http_version:
109
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
110
+ - request:
111
+ method: post
112
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
113
+ body:
114
+ encoding: UTF-8
115
+ string: '[{"action":"DeviceRouter","method":"getInfo","data":[{"uid":"/zport/dmd/Devices/Server/devices/UnitTestDevice"}],"type":"rpc","tid":21}]'
116
+ headers:
117
+ User-Agent:
118
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
119
+ Accept:
120
+ - "*/*"
121
+ Date:
122
+ - Fri, 22 May 2015 12:14:37 GMT
123
+ Content-Type:
124
+ - application/json; charset=utf-8
125
+ Cookie:
126
+ - _ZopeId=47495875A68v.lkNK6o
127
+ response:
128
+ status:
129
+ code: 200
130
+ message: OK
131
+ headers:
132
+ Server:
133
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
134
+ Date:
135
+ - Fri, 22 May 2015 12:14:37 GMT
136
+ Content-Length:
137
+ - '2198'
138
+ Content-Type:
139
+ - application/json
140
+ body:
141
+ encoding: UTF-8
142
+ string: '{"uuid": "d8be6206-d683-4909-ad26-1b26b47ca08e", "action": "DeviceRouter",
143
+ "result": {"disabled": false, "data": {"productionState": 1000, "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
144
+ "links": "", "snmpContact": "", "osModel": null, "hwModel": null, "osManufacturer":
145
+ null, "deviceClass": {"uuid": "98db2956-4f5f-42f5-ac1f-173ff47b306d", "name":
146
+ "/Server", "severity": "error", "id": "Server", "meta_type": "DeviceClass",
147
+ "inspector_type": "DeviceClass", "path": "/Devices/Server", "uid": "/zport/dmd/Devices/Server",
148
+ "events": {"info": {"count": 1, "acknowledged_count": 0}, "clear": {"count":
149
+ 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
150
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
151
+ 1, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
152
+ "description": ""}, "hwManufacturer": null, "snmpVersion": "v2c", "collector":
153
+ "localhost", "id": "UnitTestDevice", "uptime": "Unknown", "severity": "clear",
154
+ "locking": {"updates": false, "deletion": false, "events": false}, "comments":
155
+ "", "name": "UnitTestDevice", "priority": 3, "snmpCommunity": "public", "location":
156
+ null, "memory": {"ram": "Unknown", "swap": "Unknown"}, "icon": "/zport/dmd/img/icons/server.png",
157
+ "priorityLabel": "Normal", "lastCollected": "Not Modeled", "events": {"info":
158
+ {"count": 0, "acknowledged_count": 0}, "clear": {"count": 0, "acknowledged_count":
159
+ 0}, "warning": {"count": 0, "acknowledged_count": 0}, "critical": {"count":
160
+ 0, "acknowledged_count": 0}, "error": {"count": 0, "acknowledged_count": 0},
161
+ "debug": {"count": 0, "acknowledged_count": 0}}, "systems": [], "status":
162
+ true, "ipAddressString": null, "description": "", "snmpDescr": "", "groups":
163
+ [], "device": "UnitTestDevice", "firstSeen": "2015/05/22 12:14:21", "snmpSysName":
164
+ "", "pythonClass": "Products.ZenModel.Device", "lastChanged": "2015/05/22
165
+ 12:14:37", "productionStateLabel": "Production", "serialNumber": "", "uuid":
166
+ "00217159-594e-49da-889c-7650f8329068", "tagNumber": "", "meta_type": "Device",
167
+ "inspector_type": "Device", "snmpLocation": "", "snmpAgent": "", "ipAddress":
168
+ null, "rackSlot": 0}, "success": true}, "tid": 21, "type": "rpc", "method":
169
+ "getInfo"}'
170
+ http_version:
171
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
172
+ - request:
173
+ method: post
174
+ uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
175
+ body:
176
+ encoding: UTF-8
177
+ string: '[{"action":"DeviceRouter","method":"getInfo","data":[{"uid":"/zport/dmd/Devices/Server/devices/UnitTestDevice"}],"type":"rpc","tid":22}]'
178
+ headers:
179
+ User-Agent:
180
+ - HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
181
+ Accept:
182
+ - "*/*"
183
+ Date:
184
+ - Fri, 22 May 2015 12:14:37 GMT
185
+ Content-Type:
186
+ - application/json; charset=utf-8
187
+ Cookie:
188
+ - _ZopeId=47495875A68v.lkNK6o
189
+ response:
190
+ status:
191
+ code: 200
192
+ message: OK
193
+ headers:
194
+ Server:
195
+ - Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
196
+ Date:
197
+ - Fri, 22 May 2015 12:14:37 GMT
198
+ Content-Length:
199
+ - '2198'
200
+ Content-Type:
201
+ - application/json
202
+ body:
203
+ encoding: UTF-8
204
+ string: '{"uuid": "d4f54b53-7544-432b-8e06-d28b6233070b", "action": "DeviceRouter",
205
+ "result": {"disabled": false, "data": {"productionState": 1000, "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
206
+ "links": "", "snmpContact": "", "osModel": null, "hwModel": null, "osManufacturer":
207
+ null, "deviceClass": {"uuid": "98db2956-4f5f-42f5-ac1f-173ff47b306d", "name":
208
+ "/Server", "severity": "error", "id": "Server", "meta_type": "DeviceClass",
209
+ "inspector_type": "DeviceClass", "path": "/Devices/Server", "uid": "/zport/dmd/Devices/Server",
210
+ "events": {"info": {"count": 1, "acknowledged_count": 0}, "clear": {"count":
211
+ 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
212
+ 0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
213
+ 1, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
214
+ "description": ""}, "hwManufacturer": null, "snmpVersion": "v2c", "collector":
215
+ "localhost", "id": "UnitTestDevice", "uptime": "Unknown", "severity": "clear",
216
+ "locking": {"updates": false, "deletion": false, "events": false}, "comments":
217
+ "", "name": "UnitTestDevice", "priority": 3, "snmpCommunity": "public", "location":
218
+ null, "memory": {"ram": "Unknown", "swap": "Unknown"}, "icon": "/zport/dmd/img/icons/server.png",
219
+ "priorityLabel": "Normal", "lastCollected": "Not Modeled", "events": {"info":
220
+ {"count": 0, "acknowledged_count": 0}, "clear": {"count": 0, "acknowledged_count":
221
+ 0}, "warning": {"count": 0, "acknowledged_count": 0}, "critical": {"count":
222
+ 0, "acknowledged_count": 0}, "error": {"count": 0, "acknowledged_count": 0},
223
+ "debug": {"count": 0, "acknowledged_count": 0}}, "systems": [], "status":
224
+ true, "ipAddressString": null, "description": "", "snmpDescr": "", "groups":
225
+ [], "device": "UnitTestDevice", "firstSeen": "2015/05/22 12:14:21", "snmpSysName":
226
+ "", "pythonClass": "Products.ZenModel.Device", "lastChanged": "2015/05/22
227
+ 12:14:37", "productionStateLabel": "Production", "serialNumber": "", "uuid":
228
+ "00217159-594e-49da-889c-7650f8329068", "tagNumber": "", "meta_type": "Device",
229
+ "inspector_type": "Device", "snmpLocation": "", "snmpAgent": "", "ipAddress":
230
+ null, "rackSlot": 0}, "success": true}, "tid": 22, "type": "rpc", "method":
231
+ "getInfo"}'
232
+ http_version:
233
+ recorded_at: Fri, 22 May 2015 12:14:37 GMT
234
+ recorded_with: VCR 2.9.3