zabbix-api-simple 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +3 -7
- data/exe/zapishell.rb +15 -1
- data/images/2021-09-19_09-38.png +0 -0
- data/images/2021-09-19_09-40.png +0 -0
- data/images/zabbix-api-simple-simplicity.png +0 -0
- data/lib/zabbix/api/client.rb +57 -2
- data/lib/zabbix/api/version.rb +1 -1
- data/lib/zabbix/api.rb +0 -6
- data/public/Zabbix/Api/Client.html +154 -79
- data/public/Zabbix/Api/FaradayMiddleware/ZabbixApiRequest.html +19 -11
- data/public/Zabbix/Api/FaradayMiddleware.html +1 -1
- data/public/Zabbix/Api/OpenStruct.html +384 -0
- data/public/Zabbix/Api/ZabbixStruct.html +384 -0
- data/public/Zabbix/Api.html +5 -5
- data/public/Zabbix.html +3 -3
- data/public/_index.html +7 -7
- data/public/class_list.html +1 -1
- data/public/file.CHANGELOG.html +15 -1
- data/public/file.LICENSE.html +1 -1
- data/public/file.README.html +4 -8
- data/public/images/zabbix-api-simple-simplicity.png +0 -0
- data/public/index.html +4 -8
- data/public/method_list.html +32 -0
- data/public/top-level-namespace.html +1 -1
- data/zabbix-api.gemspec +4 -2
- metadata +39 -5
- data/public/Zabbix/Api/Error.html +0 -124
@@ -230,13 +230,13 @@
|
|
230
230
|
<pre class="lines">
|
231
231
|
|
232
232
|
|
233
|
-
17
|
234
233
|
18
|
235
234
|
19
|
236
|
-
20
|
235
|
+
20
|
236
|
+
21</pre>
|
237
237
|
</td>
|
238
238
|
<td>
|
239
|
-
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line
|
239
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line 18</span>
|
240
240
|
|
241
241
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_app'>app</span><span class='rparen'>)</span>
|
242
242
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_app'>app</span><span class='rparen'>)</span>
|
@@ -269,15 +269,23 @@
|
|
269
269
|
<pre class="lines">
|
270
270
|
|
271
271
|
|
272
|
-
28
|
273
272
|
29
|
274
|
-
30
|
273
|
+
30
|
274
|
+
31
|
275
|
+
32
|
276
|
+
33
|
277
|
+
34
|
278
|
+
35</pre>
|
275
279
|
</td>
|
276
280
|
<td>
|
277
|
-
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line
|
281
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line 29</span>
|
278
282
|
|
279
283
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_complete'>on_complete</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
|
280
|
-
<span class='
|
284
|
+
<span class='kw'>begin</span>
|
285
|
+
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:response_body</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:response_body</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
286
|
+
<span class='kw'>rescue</span> <span class='const'>JSON</span><span class='op'>::</span><span class='const'>ParserError</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
287
|
+
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:response_body</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>error:</span> <span class='id identifier rubyid_e'>e</span><span class='comma'>,</span><span class='label'>note:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Check api web configuration (e.g. url, PHP memory, etc)</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span>
|
288
|
+
<span class='kw'>end</span>
|
281
289
|
<span class='kw'>end</span></pre>
|
282
290
|
</td>
|
283
291
|
</tr>
|
@@ -299,14 +307,14 @@
|
|
299
307
|
<pre class="lines">
|
300
308
|
|
301
309
|
|
302
|
-
22
|
303
310
|
23
|
304
311
|
24
|
305
312
|
25
|
306
|
-
26
|
313
|
+
26
|
314
|
+
27</pre>
|
307
315
|
</td>
|
308
316
|
<td>
|
309
|
-
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line
|
317
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line 23</span>
|
310
318
|
|
311
319
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_request'>on_request</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
|
312
320
|
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:request_body</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:jsonrpc</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2.0</span><span class='tstring_end'>"</span></span>
|
@@ -323,7 +331,7 @@
|
|
323
331
|
</div>
|
324
332
|
|
325
333
|
<div id="footer">
|
326
|
-
Generated on
|
334
|
+
Generated on Sun Sep 19 10:15:06 2021 by
|
327
335
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
328
336
|
0.9.26 (ruby-2.7.4).
|
329
337
|
</div>
|
@@ -105,7 +105,7 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Sun Sep 19 10:15:06 2021 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
110
|
0.9.26 (ruby-2.7.4).
|
111
111
|
</div>
|
@@ -0,0 +1,384 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Zabbix::Api::OpenStruct
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Zabbix::Api::OpenStruct";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (O)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Zabbix.html" title="Zabbix (module)">Zabbix</a></span></span> » <span class='title'><span class='object_link'><a href="../Api.html" title="Zabbix::Api (module)">Api</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">OpenStruct</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Zabbix::Api::OpenStruct
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">OpenStruct</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">OpenStruct</li>
|
78
|
+
|
79
|
+
<li class="next">Zabbix::Api::OpenStruct</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/zabbix/api/client.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Subclass of OpenStruct adds some niceties for REPL etc</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<h2>
|
118
|
+
Constant Summary
|
119
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
120
|
+
</h2>
|
121
|
+
|
122
|
+
<dl class="constants">
|
123
|
+
|
124
|
+
<dt id="prettymode-classvariable" class="">@@prettymode =
|
125
|
+
<div class="docstring">
|
126
|
+
<div class="discussion">
|
127
|
+
|
128
|
+
<p>If true, inspect returns awesome_inspect instead of default</p>
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
<div class="tags">
|
134
|
+
|
135
|
+
|
136
|
+
</div>
|
137
|
+
</dt>
|
138
|
+
<dd><pre class="code"><span class='kw'>false</span></pre></dd>
|
139
|
+
|
140
|
+
</dl>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<h2>
|
151
|
+
Class Method Summary
|
152
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
153
|
+
</h2>
|
154
|
+
|
155
|
+
<ul class="summary">
|
156
|
+
|
157
|
+
<li class="public ">
|
158
|
+
<span class="summary_signature">
|
159
|
+
|
160
|
+
<a href="#prettymode-class_method" title="prettymode (class method)">.<strong>prettymode</strong> ⇒ Object </a>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
</span>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<span class="summary_desc"><div class='inline'>
|
175
|
+
<p>returns current value of prettymode.</p>
|
176
|
+
</div></span>
|
177
|
+
|
178
|
+
</li>
|
179
|
+
|
180
|
+
|
181
|
+
<li class="public ">
|
182
|
+
<span class="summary_signature">
|
183
|
+
|
184
|
+
<a href="#prettymode=-class_method" title="prettymode= (class method)">.<strong>prettymode=</strong>(aBool) ⇒ Object </a>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<span class="summary_desc"><div class='inline'>
|
199
|
+
<p>sets prettymod to aBool.</p>
|
200
|
+
</div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
</ul>
|
206
|
+
|
207
|
+
<h2>
|
208
|
+
Instance Method Summary
|
209
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
210
|
+
</h2>
|
211
|
+
|
212
|
+
<ul class="summary">
|
213
|
+
|
214
|
+
<li class="public ">
|
215
|
+
<span class="summary_signature">
|
216
|
+
|
217
|
+
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> ⇒ Object </a>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
</span>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
232
|
+
|
233
|
+
</li>
|
234
|
+
|
235
|
+
|
236
|
+
</ul>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<div id="class_method_details" class="method_details_list">
|
243
|
+
<h2>Class Method Details</h2>
|
244
|
+
|
245
|
+
|
246
|
+
<div class="method_details first">
|
247
|
+
<h3 class="signature first" id="prettymode-class_method">
|
248
|
+
|
249
|
+
.<strong>prettymode</strong> ⇒ <tt>Object</tt>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</h3><div class="docstring">
|
256
|
+
<div class="discussion">
|
257
|
+
|
258
|
+
<p>returns current value of prettymode</p>
|
259
|
+
|
260
|
+
|
261
|
+
</div>
|
262
|
+
</div>
|
263
|
+
<div class="tags">
|
264
|
+
|
265
|
+
|
266
|
+
</div><table class="source_code">
|
267
|
+
<tr>
|
268
|
+
<td>
|
269
|
+
<pre class="lines">
|
270
|
+
|
271
|
+
|
272
|
+
58
|
273
|
+
59
|
274
|
+
60</pre>
|
275
|
+
</td>
|
276
|
+
<td>
|
277
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line 58</span>
|
278
|
+
|
279
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prettymode'>prettymode</span>
|
280
|
+
<span class='cvar'>@@prettymode</span>
|
281
|
+
<span class='kw'>end</span></pre>
|
282
|
+
</td>
|
283
|
+
</tr>
|
284
|
+
</table>
|
285
|
+
</div>
|
286
|
+
|
287
|
+
<div class="method_details ">
|
288
|
+
<h3 class="signature " id="prettymode=-class_method">
|
289
|
+
|
290
|
+
.<strong>prettymode=</strong>(aBool) ⇒ <tt>Object</tt>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
</h3><div class="docstring">
|
297
|
+
<div class="discussion">
|
298
|
+
|
299
|
+
<p>sets prettymod to aBool</p>
|
300
|
+
|
301
|
+
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
<div class="tags">
|
305
|
+
|
306
|
+
|
307
|
+
</div><table class="source_code">
|
308
|
+
<tr>
|
309
|
+
<td>
|
310
|
+
<pre class="lines">
|
311
|
+
|
312
|
+
|
313
|
+
64
|
314
|
+
65
|
315
|
+
66</pre>
|
316
|
+
</td>
|
317
|
+
<td>
|
318
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line 64</span>
|
319
|
+
|
320
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prettymode='>prettymode=</span><span class='lparen'>(</span><span class='id identifier rubyid_aBool'>aBool</span><span class='rparen'>)</span>
|
321
|
+
<span class='cvar'>@@prettymode</span> <span class='op'>=</span> <span class='id identifier rubyid_aBool'>aBool</span>
|
322
|
+
<span class='kw'>end</span></pre>
|
323
|
+
</td>
|
324
|
+
</tr>
|
325
|
+
</table>
|
326
|
+
</div>
|
327
|
+
|
328
|
+
</div>
|
329
|
+
|
330
|
+
<div id="instance_method_details" class="method_details_list">
|
331
|
+
<h2>Instance Method Details</h2>
|
332
|
+
|
333
|
+
|
334
|
+
<div class="method_details first">
|
335
|
+
<h3 class="signature first" id="inspect-instance_method">
|
336
|
+
|
337
|
+
#<strong>inspect</strong> ⇒ <tt>Object</tt>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
</h3><table class="source_code">
|
344
|
+
<tr>
|
345
|
+
<td>
|
346
|
+
<pre class="lines">
|
347
|
+
|
348
|
+
|
349
|
+
69
|
350
|
+
70
|
351
|
+
71
|
352
|
+
72
|
353
|
+
73
|
354
|
+
74
|
355
|
+
75</pre>
|
356
|
+
</td>
|
357
|
+
<td>
|
358
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix/api/client.rb', line 69</span>
|
359
|
+
|
360
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
|
361
|
+
<span class='kw'>if</span> <span class='cvar'>@@prettymode</span>
|
362
|
+
<span class='id identifier rubyid_awesome_inspect'>awesome_inspect</span>
|
363
|
+
<span class='kw'>else</span>
|
364
|
+
<span class='kw'>super</span>
|
365
|
+
<span class='kw'>end</span>
|
366
|
+
<span class='kw'>end</span></pre>
|
367
|
+
</td>
|
368
|
+
</tr>
|
369
|
+
</table>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
</div>
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
<div id="footer">
|
377
|
+
Generated on Sun Sep 19 10:15:06 2021 by
|
378
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
379
|
+
0.9.26 (ruby-2.7.4).
|
380
|
+
</div>
|
381
|
+
|
382
|
+
</div>
|
383
|
+
</body>
|
384
|
+
</html>
|