zenoss_client 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +5 -2
- data/VERSION +1 -1
- data/lib/zenoss.rb +1 -1
- data/lib/zenoss/jsonapi/device_router.rb +2 -2
- data/lib/zenoss/jsonapi/events_router.rb +12 -0
- data/lib/zenoss/jsonapi/report_router.rb +2 -2
- data/lib/zenoss/model/devices/device.rb +1 -1
- data/lib/zenoss/model/z_device_loader.rb +1 -1
- data/test/zenoss_client_test.rb +0 -1
- metadata +23 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0604c70eea29dc67d7083fb3521bf52ff3a1adff59160791b8756b06cca753c4
|
4
|
+
data.tar.gz: 385c6c6b898364bb88a16832db0846dbaf594ade55859131e6cd08b3c30b6cf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1102a72533a0ca09895d70a9468af7a5766c90f418e63c8bd9fa6616a7f9a4487fb0342d01b3768e2177b8f934755068de39c044d9dbbe50f6e3128c4683fa74
|
7
|
+
data.tar.gz: 5f34aa8d4ce4f292640d6460abfea740aa16857d560e8976468e5f416c72eb5f0910788b49ceffd4e8853135bcad3de3d39c6afc29601b63ed0635ef9016c3bf
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
data/lib/zenoss.rb
CHANGED
@@ -45,7 +45,7 @@ module Zenoss
|
|
45
45
|
def plist_to_array(list)
|
46
46
|
return nil if list.nil?
|
47
47
|
list = sanitize_str(list)
|
48
|
-
|
48
|
+
list.gsub(/[\[\]]/, '').split(/,\s+/)
|
49
49
|
end
|
50
50
|
|
51
51
|
# Some of the REST methods return Strings that are formated like a Python list.
|
@@ -51,14 +51,14 @@ module Zenoss
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def get_templates(device_id)
|
54
|
-
|
54
|
+
json_request('DeviceRouter', 'getTemplates', [{:id => device_id}])
|
55
55
|
end
|
56
56
|
|
57
57
|
def get_info(device_id, keys = nil)
|
58
58
|
data = {}
|
59
59
|
data[:uid] = device_id
|
60
60
|
data[:keys] = keys if keys
|
61
|
-
|
61
|
+
json_request('DeviceRouter', 'getInfo', [data])
|
62
62
|
end
|
63
63
|
|
64
64
|
# =============== Non-API Helper methods ===============
|
@@ -57,7 +57,19 @@ module Zenoss
|
|
57
57
|
events
|
58
58
|
end
|
59
59
|
|
60
|
+
# @param [Hash] data evids that should be closed
|
61
|
+
# @option data [Array] :evids Array of evids that is closed
|
62
|
+
def close_events(data = {})
|
63
|
+
json_request('EventsRouter', 'close', [data])
|
64
|
+
end
|
60
65
|
|
66
|
+
# @param [Hash] data data specifying event that should have a logmessage appended
|
67
|
+
# @option data [String] :evid evid that message should be appended to
|
68
|
+
# @option data [String] :message text that should be appended to the event log
|
69
|
+
def write_log(data= {})
|
70
|
+
json_request('EventsRouter','write_log', [data])
|
71
|
+
end
|
72
|
+
|
61
73
|
# @param [String] uid the uid to query events for. If this isn't specified
|
62
74
|
# the query may take a very long time
|
63
75
|
# @param [Hash] opts misc options to limit/filter events
|
@@ -22,11 +22,11 @@ module Zenoss
|
|
22
22
|
module ReportRouter
|
23
23
|
|
24
24
|
def get_report_types
|
25
|
-
|
25
|
+
json_request('ReportRouter', 'getReportTypes')
|
26
26
|
end
|
27
27
|
|
28
28
|
def get_report_tree(id = '/zport/dmd/Reports')
|
29
|
-
|
29
|
+
json_request('ReportRouter', 'getTree', [{:id => id}])
|
30
30
|
end
|
31
31
|
|
32
32
|
end # ReportRouter
|
@@ -181,7 +181,7 @@ module Zenoss
|
|
181
181
|
components = rest(method)
|
182
182
|
|
183
183
|
# Turn the return string into an array of components
|
184
|
-
|
184
|
+
components.gsub(/[\[\]]/, '').split(/,\s+/)
|
185
185
|
end
|
186
186
|
|
187
187
|
# Return list of all DeviceComponents on this device
|
data/test/zenoss_client_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenoss_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Wanek
|
@@ -10,104 +10,104 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-03-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httpclient
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - ~>
|
19
|
+
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '2.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - ~>
|
26
|
+
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '2.0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: tzinfo
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- - ~>
|
33
|
+
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: 0.3.20
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - ~>
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 0.3.20
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: json
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ~>
|
47
|
+
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '1.5'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - ~>
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '1.5'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rake
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: minitest
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: vcr
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: webmock
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
description: |2
|
@@ -125,8 +125,8 @@ extra_rdoc_files:
|
|
125
125
|
- README.textile
|
126
126
|
- COPYING.txt
|
127
127
|
files:
|
128
|
-
- .gitignore
|
129
|
-
- .travis.yml
|
128
|
+
- ".gitignore"
|
129
|
+
- ".travis.yml"
|
130
130
|
- COPYING.txt
|
131
131
|
- Gemfile
|
132
132
|
- README.textile
|
@@ -205,27 +205,26 @@ licenses:
|
|
205
205
|
metadata: {}
|
206
206
|
post_install_message:
|
207
207
|
rdoc_options:
|
208
|
-
- -x
|
208
|
+
- "-x"
|
209
209
|
- test/
|
210
|
-
- -x
|
210
|
+
- "-x"
|
211
211
|
- examples/
|
212
212
|
require_paths:
|
213
213
|
- lib
|
214
214
|
required_ruby_version: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- -
|
216
|
+
- - ">="
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: 1.8.7
|
219
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
|
-
- -
|
221
|
+
- - ">="
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.7.3
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: A wrapper around the Zenoss JSON and REST APIs
|
230
230
|
test_files: []
|
231
|
-
has_rdoc:
|