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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 981ffe9b6d5043244cd38fbf2edf62bdccbd62b9
4
- data.tar.gz: 80f7544773d814c72ccae5a3d2e657064e5af513
2
+ SHA256:
3
+ metadata.gz: 0604c70eea29dc67d7083fb3521bf52ff3a1adff59160791b8756b06cca753c4
4
+ data.tar.gz: 385c6c6b898364bb88a16832db0846dbaf594ade55859131e6cd08b3c30b6cf6
5
5
  SHA512:
6
- metadata.gz: a70d8df6d60198b6807bcc5ed44b89c80532961563f00684914abcdc4700d1459143d234519aac926b842eeeae4f5a378b8381973345347275355b76cc6e5497
7
- data.tar.gz: 8fb27680573b2bd8cc81f10bcf1700849d9acd784e963d58ea785fef9487c1bbc9204cfc05b90584ea13ac463e510f7dd31c04c3a0e002b8061d91bba9084dfc
6
+ metadata.gz: 1102a72533a0ca09895d70a9468af7a5766c90f418e63c8bd9fa6616a7f9a4487fb0342d01b3768e2177b8f934755068de39c044d9dbbe50f6e3128c4683fa74
7
+ data.tar.gz: 5f34aa8d4ce4f292640d6460abfea740aa16857d560e8976468e5f416c72eb5f0910788b49ceffd4e8853135bcad3de3d39c6afc29601b63ed0635ef9016c3bf
@@ -3,8 +3,11 @@ script: bundle exec rake test
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
- - 2.1.0
7
- - 2.2.0
6
+ - 2.1.10
7
+ - 2.2.8
8
+ - 2.3.6
9
+ - 2.4.3
10
+ - 2.5.0
8
11
  - ruby-head
9
12
  - jruby-head
10
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.7.0
@@ -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
- (list.gsub /[\[\]]/,'').split /,\s+/
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
- resp = json_request('DeviceRouter', 'getTemplates', [{:id => device_id}])
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
- resp = json_request('DeviceRouter', 'getInfo', [data])
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
- resp = json_request('ReportRouter', 'getReportTypes')
25
+ json_request('ReportRouter', 'getReportTypes')
26
26
  end
27
27
 
28
28
  def get_report_tree(id = '/zport/dmd/Reports')
29
- resp = json_request('ReportRouter', 'getTree', [{:id => id}])
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
- (components.gsub /[\[\]]/,'').split /,\s+/
184
+ components.gsub(/[\[\]]/, '').split(/,\s+/)
185
185
  end
186
186
 
187
187
  # Return list of all DeviceComponents on this device
@@ -48,7 +48,7 @@ module Zenoss
48
48
  def add_system(system_path)
49
49
  method = "addSystem?newSystemPath=#{system_path}"
50
50
  rest(method)
51
- sys = System.new("/Systems/#{system_path}")
51
+ System.new("/Systems/#{system_path}")
52
52
  end
53
53
 
54
54
 
@@ -1,5 +1,4 @@
1
1
  require_relative './test_helper'
2
- require 'minitest/spec'
3
2
  require 'minitest/autorun'
4
3
  require 'logger'
5
4
 
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.6.1
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: 2016-10-19 00:00:00.000000000 Z
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.0.14
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: