datacentred 0.1.1pre → 1.1.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/.codeclimate.yml +11 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +2 -0
- data/.yardopts +1 -0
- data/CODE_OF_CONDUCT.md +46 -0
- data/Gemfile.lock +39 -2
- data/LICENSE +21 -0
- data/README.md +160 -2
- data/circle.yml +0 -2
- data/datacentred.gemspec +17 -14
- data/docs/Datacentred.html +537 -0
- data/docs/Datacentred/Errors.html +260 -0
- data/docs/Datacentred/Errors/Error.html +139 -0
- data/docs/Datacentred/Errors/NotFound.html +145 -0
- data/docs/Datacentred/Errors/Unauthorized.html +149 -0
- data/docs/Datacentred/Errors/UnprocessableEntity.html +145 -0
- data/docs/Datacentred/Model.html +128 -0
- data/docs/Datacentred/Model/Base.html +255 -0
- data/docs/Datacentred/Model/Project.html +1729 -0
- data/docs/Datacentred/Model/Role.html +1830 -0
- data/docs/Datacentred/Model/Usage.html +510 -0
- data/docs/Datacentred/Model/User.html +832 -0
- data/docs/Datacentred/Model/Version.html +451 -0
- data/docs/Datacentred/Project.html +142 -0
- data/docs/Datacentred/Request.html +128 -0
- data/docs/Datacentred/Request/Base.html +675 -0
- data/docs/Datacentred/Request/Projects.html +1286 -0
- data/docs/Datacentred/Request/Roles.html +1286 -0
- data/docs/Datacentred/Request/Usage.html +315 -0
- data/docs/Datacentred/Request/Users.html +841 -0
- data/docs/Datacentred/Request/Versions.html +258 -0
- data/docs/Datacentred/Response.html +410 -0
- data/docs/Datacentred/Role.html +142 -0
- data/docs/Datacentred/Usage.html +142 -0
- data/docs/Datacentred/User.html +142 -0
- data/docs/Datacentred/Version.html +142 -0
- data/docs/_index.html +349 -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 +492 -0
- data/docs/file.README.html +231 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +231 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +643 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/datacentred.rb +65 -12
- data/lib/datacentred/error.rb +37 -15
- data/lib/datacentred/model/base.rb +21 -0
- data/lib/datacentred/model/project.rb +90 -31
- data/lib/datacentred/model/role.rb +89 -31
- data/lib/datacentred/model/usage.rb +16 -9
- data/lib/datacentred/model/user.rb +54 -22
- data/lib/datacentred/model/version.rb +17 -8
- data/lib/datacentred/request/base.rb +68 -31
- data/lib/datacentred/request/projects.rb +92 -24
- data/lib/datacentred/request/roles.rb +92 -24
- data/lib/datacentred/request/usage.rb +10 -1
- data/lib/datacentred/request/users.rb +58 -15
- data/lib/datacentred/request/versions.rb +13 -1
- data/lib/datacentred/response.rb +6 -2
- data/test/integration/authorization_test.rb +30 -0
- data/test/integration/projects_test.rb +11 -11
- data/test/integration/roles_test.rb +17 -17
- data/test/integration/usage_test.rb +8 -8
- data/test/integration/users_test.rb +23 -19
- data/test/integration/versions_test.rb +1 -2
- data/test/test_helper.rb +8 -5
- data/test/vcr_cassettes/not_authorized.yml +57 -0
- data/test/vcr_cassettes/unexpected_error.yml +56 -0
- metadata +115 -9
@@ -0,0 +1,510 @@
|
|
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: Datacentred::Model::Usage
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
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 = "Datacentred::Model::Usage";
|
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 (U)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Datacentred.html" title="Datacentred (module)">Datacentred</a></span></span> » <span class='title'><span class='object_link'><a href="../Model.html" title="Datacentred::Model (module)">Model</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Usage</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: Datacentred::Model::Usage
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Datacentred::Model::Base (class)">Base</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">RecursiveOpenStruct</li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="Base.html" title="Datacentred::Model::Base (class)">Base</a></span></li>
|
80
|
+
|
81
|
+
<li class="next">Datacentred::Model::Usage</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/datacentred/model/usage.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>Usage data for a given month/year.</p>
|
110
|
+
|
111
|
+
<p>Data is updated every few hours for the current month.</p>
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
124
|
+
<ul class="summary">
|
125
|
+
|
126
|
+
<li class="public ">
|
127
|
+
<span class="summary_signature">
|
128
|
+
|
129
|
+
<a href="#last_updated_at-instance_method" title="#last_updated_at (instance method)">#<strong>last_updated_at</strong> ⇒ Time </a>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</span>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<span class="summary_desc"><div class='inline'>
|
147
|
+
<p>The current value of last_updated_at.</p>
|
148
|
+
</div></span>
|
149
|
+
|
150
|
+
</li>
|
151
|
+
|
152
|
+
|
153
|
+
<li class="public ">
|
154
|
+
<span class="summary_signature">
|
155
|
+
|
156
|
+
<a href="#projects-instance_method" title="#projects (instance method)">#<strong>projects</strong> ⇒ [Hash] </a>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</span>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="summary_desc"><div class='inline'>
|
174
|
+
<p>The current value of projects.</p>
|
175
|
+
</div></span>
|
176
|
+
|
177
|
+
</li>
|
178
|
+
|
179
|
+
|
180
|
+
</ul>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<h2>
|
187
|
+
Class Method Summary
|
188
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
189
|
+
</h2>
|
190
|
+
|
191
|
+
<ul class="summary">
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#find-class_method" title="find (class method)">.<strong>find</strong>(year, month) ⇒ Usage </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>Retrieve account usage data for a given year/month.</p>
|
212
|
+
</div></span>
|
213
|
+
|
214
|
+
</li>
|
215
|
+
|
216
|
+
|
217
|
+
</ul>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Datacentred::Model::Base (class)">Base</a></span></h3>
|
230
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#initialize-instance_method" title="Datacentred::Model::Base#initialize (method)">#initialize</a></span></p>
|
231
|
+
|
232
|
+
<div id="constructor_details" class="method_details_list">
|
233
|
+
<h2>Constructor Details</h2>
|
234
|
+
|
235
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="Datacentred::Model::Base#initialize (method)">Datacentred::Model::Base</a></span></p>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div id="instance_attr_details" class="attr_details">
|
240
|
+
<h2>Instance Attribute Details</h2>
|
241
|
+
|
242
|
+
|
243
|
+
<span id="last_updated_at=-instance_method"></span>
|
244
|
+
<div class="method_details first">
|
245
|
+
<h3 class="signature first" id="last_updated_at-instance_method">
|
246
|
+
|
247
|
+
#<strong>last_updated_at</strong> ⇒ <tt>Time</tt>
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</h3><div class="docstring">
|
254
|
+
<div class="discussion">
|
255
|
+
|
256
|
+
<p>Returns the current value of last_updated_at</p>
|
257
|
+
|
258
|
+
|
259
|
+
</div>
|
260
|
+
</div>
|
261
|
+
<div class="tags">
|
262
|
+
|
263
|
+
<p class="tag_title">Returns:</p>
|
264
|
+
<ul class="return">
|
265
|
+
|
266
|
+
<li>
|
267
|
+
|
268
|
+
|
269
|
+
<span class='type'>(<tt>Time</tt>)</span>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
—
|
274
|
+
<div class='inline'>
|
275
|
+
<p>the current value of last_updated_at</p>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</li>
|
279
|
+
|
280
|
+
</ul>
|
281
|
+
|
282
|
+
</div><table class="source_code">
|
283
|
+
<tr>
|
284
|
+
<td>
|
285
|
+
<pre class="lines">
|
286
|
+
|
287
|
+
|
288
|
+
9
|
289
|
+
10
|
290
|
+
11</pre>
|
291
|
+
</td>
|
292
|
+
<td>
|
293
|
+
<pre class="code"><span class="info file"># File 'lib/datacentred/model/usage.rb', line 9</span>
|
294
|
+
|
295
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_last_updated_at'>last_updated_at</span>
|
296
|
+
<span class='ivar'>@last_updated_at</span>
|
297
|
+
<span class='kw'>end</span></pre>
|
298
|
+
</td>
|
299
|
+
</tr>
|
300
|
+
</table>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
|
304
|
+
<span id="projects=-instance_method"></span>
|
305
|
+
<div class="method_details ">
|
306
|
+
<h3 class="signature " id="projects-instance_method">
|
307
|
+
|
308
|
+
#<strong>projects</strong> ⇒ <tt>[Hash]</tt>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</h3><div class="docstring">
|
315
|
+
<div class="discussion">
|
316
|
+
|
317
|
+
<p>Returns the current value of projects</p>
|
318
|
+
|
319
|
+
|
320
|
+
</div>
|
321
|
+
</div>
|
322
|
+
<div class="tags">
|
323
|
+
|
324
|
+
<p class="tag_title">Returns:</p>
|
325
|
+
<ul class="return">
|
326
|
+
|
327
|
+
<li>
|
328
|
+
|
329
|
+
|
330
|
+
<span class='type'>(<tt>[Hash]</tt>)</span>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
—
|
335
|
+
<div class='inline'>
|
336
|
+
<p>the current value of projects</p>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
</li>
|
340
|
+
|
341
|
+
</ul>
|
342
|
+
|
343
|
+
</div><table class="source_code">
|
344
|
+
<tr>
|
345
|
+
<td>
|
346
|
+
<pre class="lines">
|
347
|
+
|
348
|
+
|
349
|
+
9
|
350
|
+
10
|
351
|
+
11</pre>
|
352
|
+
</td>
|
353
|
+
<td>
|
354
|
+
<pre class="code"><span class="info file"># File 'lib/datacentred/model/usage.rb', line 9</span>
|
355
|
+
|
356
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_projects'>projects</span>
|
357
|
+
<span class='ivar'>@projects</span>
|
358
|
+
<span class='kw'>end</span></pre>
|
359
|
+
</td>
|
360
|
+
</tr>
|
361
|
+
</table>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</div>
|
365
|
+
|
366
|
+
|
367
|
+
<div id="class_method_details" class="method_details_list">
|
368
|
+
<h2>Class Method Details</h2>
|
369
|
+
|
370
|
+
|
371
|
+
<div class="method_details first">
|
372
|
+
<h3 class="signature first" id="find-class_method">
|
373
|
+
|
374
|
+
.<strong>find</strong>(year, month) ⇒ <tt><span class='object_link'><a href="" title="Datacentred::Model::Usage (class)">Usage</a></span></tt>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
</h3><div class="docstring">
|
381
|
+
<div class="discussion">
|
382
|
+
|
383
|
+
<p>Retrieve account usage data for a given year/month.</p>
|
384
|
+
|
385
|
+
|
386
|
+
</div>
|
387
|
+
</div>
|
388
|
+
<div class="tags">
|
389
|
+
<p class="tag_title">Parameters:</p>
|
390
|
+
<ul class="param">
|
391
|
+
|
392
|
+
<li>
|
393
|
+
|
394
|
+
<span class='name'>year</span>
|
395
|
+
|
396
|
+
|
397
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
—
|
402
|
+
<div class='inline'>
|
403
|
+
<p>The year.</p>
|
404
|
+
</div>
|
405
|
+
|
406
|
+
</li>
|
407
|
+
|
408
|
+
<li>
|
409
|
+
|
410
|
+
<span class='name'>month</span>
|
411
|
+
|
412
|
+
|
413
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
—
|
418
|
+
<div class='inline'>
|
419
|
+
<p>The month.</p>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</li>
|
423
|
+
|
424
|
+
</ul>
|
425
|
+
|
426
|
+
<p class="tag_title">Returns:</p>
|
427
|
+
<ul class="return">
|
428
|
+
|
429
|
+
<li>
|
430
|
+
|
431
|
+
|
432
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Datacentred::Model::Usage (class)">Usage</a></span></tt>)</span>
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
—
|
437
|
+
<div class='inline'>
|
438
|
+
<p>Usage for given year/month pair.</p>
|
439
|
+
</div>
|
440
|
+
|
441
|
+
</li>
|
442
|
+
|
443
|
+
</ul>
|
444
|
+
<p class="tag_title">Raises:</p>
|
445
|
+
<ul class="raise">
|
446
|
+
|
447
|
+
<li>
|
448
|
+
|
449
|
+
|
450
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Errors/NotFound.html" title="Datacentred::Errors::NotFound (class)">Errors::NotFound</a></span></tt>)</span>
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
—
|
455
|
+
<div class='inline'>
|
456
|
+
<p>Raised if no usage data found for given year/month pair.</p>
|
457
|
+
</div>
|
458
|
+
|
459
|
+
</li>
|
460
|
+
|
461
|
+
<li>
|
462
|
+
|
463
|
+
|
464
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
—
|
469
|
+
<div class='inline'>
|
470
|
+
<p>Raised if credentials aren't valid.</p>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</li>
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
</div><table class="source_code">
|
478
|
+
<tr>
|
479
|
+
<td>
|
480
|
+
<pre class="lines">
|
481
|
+
|
482
|
+
|
483
|
+
17
|
484
|
+
18
|
485
|
+
19</pre>
|
486
|
+
</td>
|
487
|
+
<td>
|
488
|
+
<pre class="code"><span class="info file"># File 'lib/datacentred/model/usage.rb', line 17</span>
|
489
|
+
|
490
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='rparen'>)</span>
|
491
|
+
<span class='id identifier rubyid_new'>new</span> <span class='const'><span class='object_link'><a href="../Request.html" title="Datacentred::Request (module)">Request</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Request/Usage.html" title="Datacentred::Request::Usage (class)">Usage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_show'><span class='object_link'><a href="../Request/Usage.html#show-class_method" title="Datacentred::Request::Usage.show (method)">show</a></span></span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span>
|
492
|
+
<span class='kw'>end</span></pre>
|
493
|
+
</td>
|
494
|
+
</tr>
|
495
|
+
</table>
|
496
|
+
</div>
|
497
|
+
|
498
|
+
</div>
|
499
|
+
|
500
|
+
</div>
|
501
|
+
|
502
|
+
<div id="footer">
|
503
|
+
Generated on Fri Sep 15 16:27:42 2017 by
|
504
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
505
|
+
0.9.9 (ruby-2.3.1).
|
506
|
+
</div>
|
507
|
+
|
508
|
+
</div>
|
509
|
+
</body>
|
510
|
+
</html>
|