triglav-agent 1.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +3 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +59 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Triglav/Agent/ApiClient/AuthenticationError.html +150 -0
- data/docs/Triglav/Agent/ApiClient/ConnectionError.html +150 -0
- data/docs/Triglav/Agent/ApiClient/Error.html +296 -0
- data/docs/Triglav/Agent/ApiClient.html +545 -0
- data/docs/Triglav/Agent/Base/CLI.html +498 -0
- data/docs/Triglav/Agent/Base/Connection.html +258 -0
- data/docs/Triglav/Agent/Base/Monitor.html +370 -0
- data/docs/Triglav/Agent/Base/Processor.html +623 -0
- data/docs/Triglav/Agent/Base/Setting.html +1081 -0
- data/docs/Triglav/Agent/Base/Worker.html +635 -0
- data/docs/Triglav/Agent/Base.html +121 -0
- data/docs/Triglav/Agent/Configuration.html +967 -0
- data/docs/Triglav/Agent/Error.html +130 -0
- data/docs/Triglav/Agent/HashUtil.html +351 -0
- data/docs/Triglav/Agent/LogFormatter.html +271 -0
- data/docs/Triglav/Agent/Logger.html +287 -0
- data/docs/Triglav/Agent/StorageFile.html +1130 -0
- data/docs/Triglav/Agent/Timer.html +424 -0
- data/docs/Triglav/Agent/TooManyError.html +134 -0
- data/docs/Triglav/Agent.html +131 -0
- data/docs/Triglav.html +119 -0
- data/docs/_index.html +335 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +481 -0
- data/docs/file.LICENSE.html +72 -0
- data/docs/file.README.html +137 -0
- data/docs/file_list.html +61 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +137 -0
- data/docs/js/app.js +243 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +659 -0
- data/docs/top-level-namespace.html +112 -0
- data/example/config.yml +40 -0
- data/lib/triglav/agent/api_client.rb +199 -0
- data/lib/triglav/agent/base/cli.rb +98 -0
- data/lib/triglav/agent/base/connection.rb +30 -0
- data/lib/triglav/agent/base/monitor.rb +32 -0
- data/lib/triglav/agent/base/processor.rb +136 -0
- data/lib/triglav/agent/base/setting.rb +112 -0
- data/lib/triglav/agent/base/worker.rb +95 -0
- data/lib/triglav/agent/configuration.rb +79 -0
- data/lib/triglav/agent/error.rb +4 -0
- data/lib/triglav/agent/hash_util.rb +36 -0
- data/lib/triglav/agent/logger.rb +50 -0
- data/lib/triglav/agent/storage_file.rb +144 -0
- data/lib/triglav/agent/timer.rb +80 -0
- data/lib/triglav/agent/version.rb +5 -0
- data/lib/triglav/agent.rb +20 -0
- data/lib/triglav-agent.rb +1 -0
- data/triglav-agent.gemspec +33 -0
- metadata +250 -0
@@ -0,0 +1,545 @@
|
|
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: Triglav::Agent::ApiClient
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Triglav::Agent::ApiClient";
|
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"></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 (A)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Triglav.html" title="Triglav (module)">Triglav</a></span></span> » <span class='title'><span class='object_link'><a href="../Agent.html" title="Triglav::Agent (module)">Agent</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ApiClient</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
|
+
<iframe id="search_frame" src="../../class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Class: Triglav::Agent::ApiClient
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName">Object</span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next">Triglav::Agent::ApiClient</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/triglav/agent/api_client.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>This Triglav client connects to triglav API with $setting.triglav.url, and
|
108
|
+
authenticates with $setting.triglav.credential, and stores the token into
|
109
|
+
$setting.token_file.</p>
|
110
|
+
|
111
|
+
<p>Re-authenticate automatically if token is expired</p>
|
112
|
+
|
113
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>triglav/agent/api_client</span><span class='tstring_end'>'</span></span>
|
114
|
+
|
115
|
+
<span class='id identifier rubyid_api_client'>api_client</span> <span class='op'>=</span> <span class='const'>Triglav</span><span class='op'>::</span><span class='const'>Agent</span><span class='op'>::</span><span class='const'>ApiClient</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
116
|
+
<span class='id identifier rubyid_resources'>resources</span> <span class='op'>=</span> <span class='id identifier rubyid_api_client'>api_client</span><span class='period'>.</span><span class='id identifier rubyid_list_resources'>list_resources</span><span class='lparen'>(</span><span class='id identifier rubyid_uri_prefix'>uri_prefix</span><span class='rparen'>)</span>
|
117
|
+
<span class='id identifier rubyid_resources'>resources</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_resource'>resource</span><span class='op'>|</span>
|
118
|
+
<span class='id identifier rubyid_events'>events</span> <span class='op'>=</span> <span class='id identifier rubyid_get_events'>get_events</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='rparen'>)</span> <span class='comment'># implement this!
|
119
|
+
</span> <span class='id identifier rubyid_api_client'>api_client</span><span class='period'>.</span><span class='id identifier rubyid_send_messages'>send_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_events'>events</span><span class='rparen'>)</span>
|
120
|
+
<span class='kw'>end</span>
|
121
|
+
</code></pre>
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
<div class="tags">
|
127
|
+
|
128
|
+
|
129
|
+
</div><h2>Defined Under Namespace</h2>
|
130
|
+
<p class="children">
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ApiClient/AuthenticationError.html" title="Triglav::Agent::ApiClient::AuthenticationError (class)">AuthenticationError</a></span>, <span class='object_link'><a href="ApiClient/ConnectionError.html" title="Triglav::Agent::ApiClient::ConnectionError (class)">ConnectionError</a></span>, <span class='object_link'><a href="ApiClient/Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span>
|
136
|
+
|
137
|
+
|
138
|
+
</p>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<h2>
|
148
|
+
Instance Method Summary
|
149
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
150
|
+
</h2>
|
151
|
+
|
152
|
+
<ul class="summary">
|
153
|
+
|
154
|
+
<li class="public ">
|
155
|
+
<span class="summary_signature">
|
156
|
+
|
157
|
+
<a href="#authorized%3F-instance_method" title="#authorized? (instance method)">#<strong>authorized?</strong> ⇒ Boolean </a>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ ApiClient </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
<span class="note title constructor">constructor</span>
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<span class="summary_desc"><div class='inline'>
|
196
|
+
<p>Initialize TriglavClient.</p>
|
197
|
+
</div></span>
|
198
|
+
|
199
|
+
</li>
|
200
|
+
|
201
|
+
|
202
|
+
<li class="public ">
|
203
|
+
<span class="summary_signature">
|
204
|
+
|
205
|
+
<a href="#list_aggregated_resources-instance_method" title="#list_aggregated_resources (instance method)">#<strong>list_aggregated_resources</strong>(uri_prefix) ⇒ Array of TriglavClient::ResourceEachResponse </a>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
</span>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<span class="summary_desc"><div class='inline'>
|
220
|
+
<p>List resources required to be monitored.</p>
|
221
|
+
</div></span>
|
222
|
+
|
223
|
+
</li>
|
224
|
+
|
225
|
+
|
226
|
+
<li class="public ">
|
227
|
+
<span class="summary_signature">
|
228
|
+
|
229
|
+
<a href="#send_messages-instance_method" title="#send_messages (instance method)">#<strong>send_messages</strong>(events) ⇒ Object </a>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
</span>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<span class="summary_desc"><div class='inline'>
|
244
|
+
<p>Send messages.</p>
|
245
|
+
</div></span>
|
246
|
+
|
247
|
+
</li>
|
248
|
+
|
249
|
+
|
250
|
+
</ul>
|
251
|
+
|
252
|
+
|
253
|
+
<div id="constructor_details" class="method_details_list">
|
254
|
+
<h2>Constructor Details</h2>
|
255
|
+
|
256
|
+
<div class="method_details first">
|
257
|
+
<h3 class="signature first" id="initialize-instance_method">
|
258
|
+
|
259
|
+
#<strong>initialize</strong>(opts = {}) ⇒ <tt><span class='object_link'><a href="" title="Triglav::Agent::ApiClient (class)">ApiClient</a></span></tt>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
</h3><div class="docstring">
|
266
|
+
<div class="discussion">
|
267
|
+
|
268
|
+
<p>Initialize TriglavClient</p>
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
</div>
|
273
|
+
<div class="tags">
|
274
|
+
|
275
|
+
|
276
|
+
</div><table class="source_code">
|
277
|
+
<tr>
|
278
|
+
<td>
|
279
|
+
<pre class="lines">
|
280
|
+
|
281
|
+
|
282
|
+
31
|
283
|
+
32
|
284
|
+
33
|
285
|
+
34
|
286
|
+
35
|
287
|
+
36
|
288
|
+
37
|
289
|
+
38
|
290
|
+
39
|
291
|
+
40
|
292
|
+
41
|
293
|
+
42
|
294
|
+
43</pre>
|
295
|
+
</td>
|
296
|
+
<td>
|
297
|
+
<pre class="code"><span class="info file"># File 'lib/triglav/agent/api_client.rb', line 31</span>
|
298
|
+
|
299
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
300
|
+
<span class='ivar'>@opts</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
301
|
+
<span class='id identifier rubyid_config'>config</span> <span class='op'>=</span> <span class='const'>TriglavClient</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
302
|
+
<span class='id identifier rubyid_uri'>uri</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_triglav_url'>triglav_url</span><span class='rparen'>)</span>
|
303
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_scheme'>scheme</span> <span class='op'>=</span> <span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_scheme'>scheme</span>
|
304
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
305
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_timeout'>timeout</span> <span class='kw'>if</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
306
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_debugging'>debugging</span> <span class='op'>=</span> <span class='id identifier rubyid_debugging'>debugging</span> <span class='kw'>if</span> <span class='id identifier rubyid_debugging'>debugging</span>
|
307
|
+
<span class='kw'>end</span>
|
308
|
+
<span class='ivar'>@api_client</span> <span class='op'>=</span> <span class='const'>TriglavClient</span><span class='op'>::</span><span class='const'>ApiClient</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
|
309
|
+
<span class='id identifier rubyid_initialize_current_token'>initialize_current_token</span>
|
310
|
+
<span class='id identifier rubyid_authenticate'>authenticate</span>
|
311
|
+
<span class='kw'>end</span></pre>
|
312
|
+
</td>
|
313
|
+
</tr>
|
314
|
+
</table>
|
315
|
+
</div>
|
316
|
+
|
317
|
+
</div>
|
318
|
+
|
319
|
+
|
320
|
+
<div id="instance_method_details" class="method_details_list">
|
321
|
+
<h2>Instance Method Details</h2>
|
322
|
+
|
323
|
+
|
324
|
+
<div class="method_details first">
|
325
|
+
<h3 class="signature first" id="authorized?-instance_method">
|
326
|
+
|
327
|
+
#<strong>authorized?</strong> ⇒ <tt>Boolean</tt>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
</h3><div class="docstring">
|
334
|
+
<div class="discussion">
|
335
|
+
|
336
|
+
|
337
|
+
</div>
|
338
|
+
</div>
|
339
|
+
<div class="tags">
|
340
|
+
|
341
|
+
<p class="tag_title">Returns:</p>
|
342
|
+
<ul class="return">
|
343
|
+
|
344
|
+
<li>
|
345
|
+
|
346
|
+
|
347
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
</li>
|
352
|
+
|
353
|
+
</ul>
|
354
|
+
|
355
|
+
</div><table class="source_code">
|
356
|
+
<tr>
|
357
|
+
<td>
|
358
|
+
<pre class="lines">
|
359
|
+
|
360
|
+
|
361
|
+
66
|
362
|
+
67
|
363
|
+
68</pre>
|
364
|
+
</td>
|
365
|
+
<td>
|
366
|
+
<pre class="code"><span class="info file"># File 'lib/triglav/agent/api_client.rb', line 66</span>
|
367
|
+
|
368
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_authorized?'>authorized?</span>
|
369
|
+
<span class='ivar'>@current_token</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:access_token</span><span class='rparen'>)</span>
|
370
|
+
<span class='kw'>end</span></pre>
|
371
|
+
</td>
|
372
|
+
</tr>
|
373
|
+
</table>
|
374
|
+
</div>
|
375
|
+
|
376
|
+
<div class="method_details ">
|
377
|
+
<h3 class="signature " id="list_aggregated_resources-instance_method">
|
378
|
+
|
379
|
+
#<strong>list_aggregated_resources</strong>(uri_prefix) ⇒ <tt>Array of TriglavClient::ResourceEachResponse</tt>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
</h3><div class="docstring">
|
386
|
+
<div class="discussion">
|
387
|
+
|
388
|
+
<p>List resources required to be monitored</p>
|
389
|
+
|
390
|
+
|
391
|
+
</div>
|
392
|
+
</div>
|
393
|
+
<div class="tags">
|
394
|
+
<p class="tag_title">Parameters:</p>
|
395
|
+
<ul class="param">
|
396
|
+
|
397
|
+
<li>
|
398
|
+
|
399
|
+
<span class='name'>uri_prefix</span>
|
400
|
+
|
401
|
+
|
402
|
+
<span class='type'>(<tt>String</tt>)</span>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
</li>
|
407
|
+
|
408
|
+
</ul>
|
409
|
+
|
410
|
+
<p class="tag_title">Returns:</p>
|
411
|
+
<ul class="return">
|
412
|
+
|
413
|
+
<li>
|
414
|
+
|
415
|
+
|
416
|
+
<span class='type'>(<tt>Array of TriglavClient::ResourceEachResponse</tt>)</span>
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
—
|
421
|
+
<div class='inline'>
|
422
|
+
<p>array of resources</p>
|
423
|
+
</div>
|
424
|
+
|
425
|
+
</li>
|
426
|
+
|
427
|
+
</ul>
|
428
|
+
|
429
|
+
<p class="tag_title">See Also:</p>
|
430
|
+
<ul class="see">
|
431
|
+
|
432
|
+
<li>TriglavClient::ResourceEachResponse</li>
|
433
|
+
|
434
|
+
</ul>
|
435
|
+
|
436
|
+
</div><table class="source_code">
|
437
|
+
<tr>
|
438
|
+
<td>
|
439
|
+
<pre class="lines">
|
440
|
+
|
441
|
+
|
442
|
+
50
|
443
|
+
51
|
444
|
+
52
|
445
|
+
53
|
446
|
+
54</pre>
|
447
|
+
</td>
|
448
|
+
<td>
|
449
|
+
<pre class="code"><span class="info file"># File 'lib/triglav/agent/api_client.rb', line 50</span>
|
450
|
+
|
451
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_list_aggregated_resources'>list_aggregated_resources</span><span class='lparen'>(</span><span class='id identifier rubyid_uri_prefix'>uri_prefix</span><span class='rparen'>)</span>
|
452
|
+
<span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ApiClient#list_aggregated_resources(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_uri_prefix'>uri_prefix</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
453
|
+
<span class='id identifier rubyid_resources_api'>resources_api</span> <span class='op'>=</span> <span class='const'>TriglavClient</span><span class='op'>::</span><span class='const'>ResourcesApi</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@api_client</span><span class='rparen'>)</span>
|
454
|
+
<span class='id identifier rubyid_handle_error'>handle_error</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_resources_api'>resources_api</span><span class='period'>.</span><span class='id identifier rubyid_list_aggregated_resources'>list_aggregated_resources</span><span class='lparen'>(</span><span class='id identifier rubyid_uri_prefix'>uri_prefix</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
455
|
+
<span class='kw'>end</span></pre>
|
456
|
+
</td>
|
457
|
+
</tr>
|
458
|
+
</table>
|
459
|
+
</div>
|
460
|
+
|
461
|
+
<div class="method_details ">
|
462
|
+
<h3 class="signature " id="send_messages-instance_method">
|
463
|
+
|
464
|
+
#<strong>send_messages</strong>(events) ⇒ <tt>Object</tt>
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
</h3><div class="docstring">
|
471
|
+
<div class="discussion">
|
472
|
+
|
473
|
+
<p>Send messages</p>
|
474
|
+
|
475
|
+
|
476
|
+
</div>
|
477
|
+
</div>
|
478
|
+
<div class="tags">
|
479
|
+
<p class="tag_title">Parameters:</p>
|
480
|
+
<ul class="param">
|
481
|
+
|
482
|
+
<li>
|
483
|
+
|
484
|
+
<span class='name'>array</span>
|
485
|
+
|
486
|
+
|
487
|
+
<span class='type'>(<tt>Array of TriglavClient::MessageRequest</tt>)</span>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
—
|
492
|
+
<div class='inline'>
|
493
|
+
<p>of event messages</p>
|
494
|
+
</div>
|
495
|
+
|
496
|
+
</li>
|
497
|
+
|
498
|
+
</ul>
|
499
|
+
|
500
|
+
|
501
|
+
<p class="tag_title">See Also:</p>
|
502
|
+
<ul class="see">
|
503
|
+
|
504
|
+
<li>TriglavClient::MessageRequest</li>
|
505
|
+
|
506
|
+
</ul>
|
507
|
+
|
508
|
+
</div><table class="source_code">
|
509
|
+
<tr>
|
510
|
+
<td>
|
511
|
+
<pre class="lines">
|
512
|
+
|
513
|
+
|
514
|
+
60
|
515
|
+
61
|
516
|
+
62
|
517
|
+
63
|
518
|
+
64</pre>
|
519
|
+
</td>
|
520
|
+
<td>
|
521
|
+
<pre class="code"><span class="info file"># File 'lib/triglav/agent/api_client.rb', line 60</span>
|
522
|
+
|
523
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_send_messages'>send_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_events'>events</span><span class='rparen'>)</span>
|
524
|
+
<span class='gvar'>$logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ApiClient#send_messages(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_events'>events</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
525
|
+
<span class='id identifier rubyid_messages_api'>messages_api</span> <span class='op'>=</span> <span class='const'>TriglavClient</span><span class='op'>::</span><span class='const'>MessagesApi</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@api_client</span><span class='rparen'>)</span>
|
526
|
+
<span class='id identifier rubyid_handle_error'>handle_error</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_messages_api'>messages_api</span><span class='period'>.</span><span class='id identifier rubyid_send_messages'>send_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_events'>events</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
527
|
+
<span class='kw'>end</span></pre>
|
528
|
+
</td>
|
529
|
+
</tr>
|
530
|
+
</table>
|
531
|
+
</div>
|
532
|
+
|
533
|
+
</div>
|
534
|
+
|
535
|
+
</div>
|
536
|
+
|
537
|
+
<div id="footer">
|
538
|
+
Generated on Thu Feb 23 23:20:33 2017 by
|
539
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
540
|
+
0.9.5 (ruby-2.3.2).
|
541
|
+
</div>
|
542
|
+
|
543
|
+
</div>
|
544
|
+
</body>
|
545
|
+
</html>
|