vipruby 0.1.4 → 0.1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.yardoc/checksums +7 -0
  4. data/.yardoc/object_types +0 -0
  5. data/.yardoc/objects/root.dat +0 -0
  6. data/.yardoc/proxy_types +0 -0
  7. data/.yardopts +1 -0
  8. data/Gemfile +4 -0
  9. data/Gemfile.lock +22 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +49 -0
  12. data/Rakefile +2 -0
  13. data/doc/Host.html +910 -0
  14. data/doc/Vipr.html +656 -0
  15. data/doc/ViprBase.html +928 -0
  16. data/doc/ViprHost.html +1952 -0
  17. data/doc/ViprStorageSystem.html +2695 -0
  18. data/doc/ViprVcenter.html +1540 -0
  19. data/doc/Vipruby.html +139 -0
  20. data/doc/Vipruby/Auth.html +745 -0
  21. data/doc/_index.html +135 -0
  22. data/doc/class_list.html +58 -0
  23. data/doc/css/common.css +1 -0
  24. data/doc/css/full_list.css +57 -0
  25. data/doc/css/style.css +339 -0
  26. data/doc/file.README.html +121 -0
  27. data/doc/file_list.html +60 -0
  28. data/doc/frames.html +26 -0
  29. data/doc/index.html +121 -0
  30. data/doc/js/app.js +219 -0
  31. data/doc/js/full_list.js +181 -0
  32. data/doc/js/jquery.js +4 -0
  33. data/doc/method_list.html +333 -0
  34. data/doc/top-level-namespace.html +114 -0
  35. data/lib/.yardoc/checksums +0 -0
  36. data/lib/.yardoc/object_types +0 -0
  37. data/lib/.yardoc/objects/root.dat +0 -0
  38. data/lib/.yardoc/proxy_types +0 -0
  39. data/lib/vipruby.rb +6 -426
  40. data/lib/vipruby/.yardoc/checksums +0 -0
  41. data/lib/vipruby/.yardoc/object_types +0 -0
  42. data/lib/vipruby/.yardoc/objects/root.dat +0 -0
  43. data/lib/vipruby/.yardoc/proxy_types +0 -0
  44. data/lib/vipruby/objects/host.rb +234 -0
  45. data/lib/vipruby/objects/storagesystem.rb +278 -0
  46. data/lib/vipruby/objects/vcenter.rb +162 -0
  47. data/lib/vipruby/version.rb +6 -0
  48. data/lib/vipruby/vipr.rb +45 -0
  49. data/lib/vipruby/viprbase.rb +84 -0
  50. data/vipruby.gemspec +29 -0
  51. metadata +100 -9
data/doc/ViprBase.html ADDED
@@ -0,0 +1,928 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: ViprBase
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!ViprBase.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (V)</a> &raquo;
35
+
36
+
37
+ <span class="title">ViprBase</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: ViprBase
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+ <dt class="r1">Included in:</dt>
81
+ <dd class="r1"><span class='object_link'><a href="Vipr.html" title="Vipr (class)">Vipr</a></span></dd>
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/vipruby/viprbase.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+
94
+ <p>Base methods used for all operations such as logging in and performing API
95
+ calls</p>
96
+
97
+
98
+ </div>
99
+ </div>
100
+ <div class="tags">
101
+
102
+
103
+ </div>
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ <h2>
112
+ Instance Method Summary
113
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
114
+ </h2>
115
+
116
+ <ul class="summary">
117
+
118
+ <li class="public ">
119
+ <span class="summary_signature">
120
+
121
+ <a href="#generate_base_url-instance_method" title="#generate_base_url (instance method)">- (strong) <strong>generate_base_url</strong>(ip_or_fqdn) </a>
122
+
123
+
124
+
125
+ </span>
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+ <span class="summary_desc"><div class='inline'>
136
+ <p>Generate the URL for standard ViPR instances using https: and port :443.</p>
137
+ </div></span>
138
+
139
+ </li>
140
+
141
+
142
+ <li class="public ">
143
+ <span class="summary_signature">
144
+
145
+ <a href="#get_auth_token-instance_method" title="#get_auth_token (instance method)">- (String) <strong>get_auth_token</strong>(user_name, password, cert = nil, base = nil) </a>
146
+
147
+
148
+
149
+ </span>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ <span class="summary_desc"><div class='inline'>
160
+ <p>Get User&#39;s Authentication Token.</p>
161
+ </div></span>
162
+
163
+ </li>
164
+
165
+
166
+ <li class="public ">
167
+ <span class="summary_signature">
168
+
169
+ <a href="#get_tenant_uid-instance_method" title="#get_tenant_uid (instance method)">- (Hash) <strong>get_tenant_uid</strong>(base = nil, auth = nil, cert = nil) </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'>
184
+ <p>Get the current users Tenant UID.</p>
185
+ </div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#login-instance_method" title="#login (instance method)">- (HTML) <strong>login</strong>(user_name, password, cert = nil, base = nil) </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ <span class="summary_desc"><div class='inline'>
208
+ <p>Login to ViPR.</p>
209
+ </div></span>
210
+
211
+ </li>
212
+
213
+
214
+ <li class="public ">
215
+ <span class="summary_signature">
216
+
217
+ <a href="#rest_get-instance_method" title="#rest_get (instance method)">- (Hash) <strong>rest_get</strong>(api_url, auth = nil, cert = nil) </a>
218
+
219
+
220
+
221
+ </span>
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <span class="summary_desc"><div class='inline'>
232
+ <p>Generic API get call.</p>
233
+ </div></span>
234
+
235
+ </li>
236
+
237
+
238
+ <li class="public ">
239
+ <span class="summary_signature">
240
+
241
+ <a href="#rest_post-instance_method" title="#rest_post (instance method)">- (Hash) <strong>rest_post</strong>(payload, api_url, auth = nil, cert = nil) </a>
242
+
243
+
244
+
245
+ </span>
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+ <span class="summary_desc"><div class='inline'>
256
+ <p>Generic API post call.</p>
257
+ </div></span>
258
+
259
+ </li>
260
+
261
+
262
+ <li class="public ">
263
+ <span class="summary_signature">
264
+
265
+ <a href="#to_boolean-instance_method" title="#to_boolean (instance method)">- (bool) <strong>to_boolean</strong>(str) </a>
266
+
267
+
268
+
269
+ </span>
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+ <span class="summary_desc"><div class='inline'>
280
+ <p>Ensure value is a boolean.</p>
281
+ </div></span>
282
+
283
+ </li>
284
+
285
+
286
+ </ul>
287
+
288
+
289
+
290
+
291
+ <div id="instance_method_details" class="method_details_list">
292
+ <h2>Instance Method Details</h2>
293
+
294
+
295
+ <div class="method_details first">
296
+ <h3 class="signature first" id="generate_base_url-instance_method">
297
+
298
+ - (<tt>strong</tt>) <strong>generate_base_url</strong>(ip_or_fqdn)
299
+
300
+
301
+
302
+
303
+
304
+ </h3><div class="docstring">
305
+ <div class="discussion">
306
+
307
+ <p>Generate the URL for standard ViPR instances using https: and port :443</p>
308
+
309
+
310
+ </div>
311
+ </div>
312
+ <div class="tags">
313
+ <p class="tag_title">Parameters:</p>
314
+ <ul class="param">
315
+
316
+ <li>
317
+
318
+ <span class='name'>ip_or_fqdn</span>
319
+
320
+
321
+ <span class='type'>(<tt>string</tt>)</span>
322
+
323
+
324
+
325
+ &mdash;
326
+ <div class='inline'>
327
+ <p>String representation of the IP Address or Fully Qualified Domain Name of
328
+ the ViPR instance</p>
329
+ </div>
330
+
331
+ </li>
332
+
333
+ </ul>
334
+
335
+ <p class="tag_title">Returns:</p>
336
+ <ul class="return">
337
+
338
+ <li>
339
+
340
+
341
+ <span class='type'>(<tt>strong</tt>)</span>
342
+
343
+
344
+
345
+ &mdash;
346
+ <div class='inline'>
347
+ <p>returns the full URL for API called</p>
348
+ </div>
349
+
350
+ </li>
351
+
352
+ </ul>
353
+
354
+ </div><table class="source_code">
355
+ <tr>
356
+ <td>
357
+ <pre class="lines">
358
+
359
+
360
+ 63
361
+ 64
362
+ 65</pre>
363
+ </td>
364
+ <td>
365
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 63</span>
366
+
367
+ <span class='kw'>def</span> <span class='id identifier rubyid_generate_base_url'>generate_base_url</span><span class='lparen'>(</span><span class='id identifier rubyid_ip_or_fqdn'>ip_or_fqdn</span><span class='rparen'>)</span>
368
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ip_or_fqdn'>ip_or_fqdn</span><span class='embexpr_end'>}</span><span class='tstring_content'>:4443</span><span class='tstring_end'>&quot;</span></span>
369
+ <span class='kw'>end</span></pre>
370
+ </td>
371
+ </tr>
372
+ </table>
373
+ </div>
374
+
375
+ <div class="method_details ">
376
+ <h3 class="signature " id="get_auth_token-instance_method">
377
+
378
+ - (<tt>String</tt>) <strong>get_auth_token</strong>(user_name, password, cert = nil, base = nil)
379
+
380
+
381
+
382
+
383
+
384
+ </h3><div class="docstring">
385
+ <div class="discussion">
386
+
387
+ <p>Get User&#39;s Authentication Token</p>
388
+
389
+
390
+ </div>
391
+ </div>
392
+ <div class="tags">
393
+ <p class="tag_title">Parameters:</p>
394
+ <ul class="param">
395
+
396
+ <li>
397
+
398
+ <span class='name'>user_name</span>
399
+
400
+
401
+ <span class='type'>(<tt>string</tt>)</span>
402
+
403
+
404
+
405
+ &mdash;
406
+ <div class='inline'>
407
+ <p>the username used to login</p>
408
+ </div>
409
+
410
+ </li>
411
+
412
+ <li>
413
+
414
+ <span class='name'>password</span>
415
+
416
+
417
+ <span class='type'>(<tt>string</tt>)</span>
418
+
419
+
420
+
421
+ &mdash;
422
+ <div class='inline'>
423
+ <p>the password for the username</p>
424
+ </div>
425
+
426
+ </li>
427
+
428
+ </ul>
429
+
430
+ <p class="tag_title">Returns:</p>
431
+ <ul class="return">
432
+
433
+ <li>
434
+
435
+
436
+ <span class='type'>(<tt>String</tt>)</span>
437
+
438
+
439
+
440
+ &mdash;
441
+ <div class='inline'>
442
+ <p>returns authentication token for the user</p>
443
+ </div>
444
+
445
+ </li>
446
+
447
+ </ul>
448
+
449
+ </div><table class="source_code">
450
+ <tr>
451
+ <td>
452
+ <pre class="lines">
453
+
454
+
455
+ 72
456
+ 73
457
+ 74</pre>
458
+ </td>
459
+ <td>
460
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 72</span>
461
+
462
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_auth_token'>get_auth_token</span><span class='lparen'>(</span><span class='id identifier rubyid_user_name'>user_name</span><span class='comma'>,</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_base'>base</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
463
+ <span class='id identifier rubyid_login'>login</span><span class='lparen'>(</span><span class='id identifier rubyid_user_name'>user_name</span><span class='comma'>,</span> <span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@verify_cert</span> <span class='op'>:</span> <span class='id identifier rubyid_cert'>cert</span><span class='comma'>,</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@base_url</span> <span class='op'>:</span> <span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:x_sds_auth_token</span><span class='rbracket'>]</span>
464
+ <span class='kw'>end</span></pre>
465
+ </td>
466
+ </tr>
467
+ </table>
468
+ </div>
469
+
470
+ <div class="method_details ">
471
+ <h3 class="signature " id="get_tenant_uid-instance_method">
472
+
473
+ - (<tt>Hash</tt>) <strong>get_tenant_uid</strong>(base = nil, auth = nil, cert = nil)
474
+
475
+
476
+
477
+
478
+
479
+ </h3><div class="docstring">
480
+ <div class="discussion">
481
+
482
+ <p>Get the current users Tenant UID</p>
483
+
484
+
485
+ </div>
486
+ </div>
487
+ <div class="tags">
488
+
489
+ <p class="tag_title">Returns:</p>
490
+ <ul class="return">
491
+
492
+ <li>
493
+
494
+
495
+ <span class='type'>(<tt>Hash</tt>)</span>
496
+
497
+
498
+
499
+ &mdash;
500
+ <div class='inline'>
501
+ <p>Hash return with the Tenant UID [&#39;id&#39;].</p>
502
+ </div>
503
+
504
+ </li>
505
+
506
+ </ul>
507
+
508
+ </div><table class="source_code">
509
+ <tr>
510
+ <td>
511
+ <pre class="lines">
512
+
513
+
514
+ 41
515
+ 42
516
+ 43</pre>
517
+ </td>
518
+ <td>
519
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 41</span>
520
+
521
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_tenant_uid'>get_tenant_uid</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_auth'>auth</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
522
+ <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@base_url</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/tenant</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_base'>base</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/tenant</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_auth'>auth</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@auth_token</span> <span class='op'>:</span> <span class='id identifier rubyid_auth'>auth</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@verify_cert</span> <span class='op'>:</span> <span class='id identifier rubyid_cert'>cert</span><span class='rparen'>)</span>
523
+ <span class='kw'>end</span></pre>
524
+ </td>
525
+ </tr>
526
+ </table>
527
+ </div>
528
+
529
+ <div class="method_details ">
530
+ <h3 class="signature " id="login-instance_method">
531
+
532
+ - (<tt>HTML</tt>) <strong>login</strong>(user_name, password, cert = nil, base = nil)
533
+
534
+
535
+
536
+
537
+
538
+ </h3><div class="docstring">
539
+ <div class="discussion">
540
+
541
+ <p>Login to ViPR</p>
542
+
543
+
544
+ </div>
545
+ </div>
546
+ <div class="tags">
547
+ <p class="tag_title">Parameters:</p>
548
+ <ul class="param">
549
+
550
+ <li>
551
+
552
+ <span class='name'>user_name</span>
553
+
554
+
555
+ <span class='type'>(<tt>string</tt>)</span>
556
+
557
+
558
+
559
+ &mdash;
560
+ <div class='inline'>
561
+ <p>the username used to login</p>
562
+ </div>
563
+
564
+ </li>
565
+
566
+ <li>
567
+
568
+ <span class='name'>password</span>
569
+
570
+
571
+ <span class='type'>(<tt>string</tt>)</span>
572
+
573
+
574
+
575
+ &mdash;
576
+ <div class='inline'>
577
+ <p>the password for the username</p>
578
+ </div>
579
+
580
+ </li>
581
+
582
+ </ul>
583
+
584
+ <p class="tag_title">Returns:</p>
585
+ <ul class="return">
586
+
587
+ <li>
588
+
589
+
590
+ <span class='type'>(<tt>HTML</tt>)</span>
591
+
592
+
593
+
594
+ &mdash;
595
+ <div class='inline'>
596
+ <p>returns token information in headers</p>
597
+ </div>
598
+
599
+ </li>
600
+
601
+ </ul>
602
+
603
+ </div><table class="source_code">
604
+ <tr>
605
+ <td>
606
+ <pre class="lines">
607
+
608
+
609
+ 50
610
+ 51
611
+ 52
612
+ 53
613
+ 54
614
+ 55
615
+ 56
616
+ 57</pre>
617
+ </td>
618
+ <td>
619
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 50</span>
620
+
621
+ <span class='kw'>def</span> <span class='id identifier rubyid_login'>login</span><span class='lparen'>(</span><span class='id identifier rubyid_user_name'>user_name</span><span class='comma'>,</span> <span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_base'>base</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
622
+ <span class='const'>RestClient</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='symbol'>:get</span><span class='comma'>,</span>
623
+ <span class='label'>url:</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@base_url</span> <span class='op'>:</span> <span class='id identifier rubyid_base'>base</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/login</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
624
+ <span class='label'>user:</span> <span class='id identifier rubyid_user_name'>user_name</span><span class='comma'>,</span>
625
+ <span class='label'>password:</span> <span class='id identifier rubyid_password'>password</span><span class='comma'>,</span>
626
+ <span class='label'>verify_ssl:</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@verify_cert</span> <span class='op'>:</span> <span class='id identifier rubyid_cert'>cert</span>
627
+ <span class='rparen'>)</span>
628
+ <span class='kw'>end</span></pre>
629
+ </td>
630
+ </tr>
631
+ </table>
632
+ </div>
633
+
634
+ <div class="method_details ">
635
+ <h3 class="signature " id="rest_get-instance_method">
636
+
637
+ - (<tt>Hash</tt>) <strong>rest_get</strong>(api_url, auth = nil, cert = nil)
638
+
639
+
640
+
641
+
642
+
643
+ </h3><div class="docstring">
644
+ <div class="discussion">
645
+
646
+ <p>Generic API get call</p>
647
+
648
+
649
+ </div>
650
+ </div>
651
+ <div class="tags">
652
+ <p class="tag_title">Parameters:</p>
653
+ <ul class="param">
654
+
655
+ <li>
656
+
657
+ <span class='name'>api_url</span>
658
+
659
+
660
+ <span class='type'>(<tt>string</tt>)</span>
661
+
662
+
663
+
664
+ &mdash;
665
+ <div class='inline'>
666
+ <p>the full API URL path</p>
667
+ </div>
668
+
669
+ </li>
670
+
671
+ </ul>
672
+
673
+ <p class="tag_title">Returns:</p>
674
+ <ul class="return">
675
+
676
+ <li>
677
+
678
+
679
+ <span class='type'>(<tt>Hash</tt>)</span>
680
+
681
+
682
+
683
+ &mdash;
684
+ <div class='inline'>
685
+ <p>the object converted into Hash format and can be parsed with <a
686
+ href="0">object</a> or <a href="'id'">object</a> notation</p>
687
+ </div>
688
+
689
+ </li>
690
+
691
+ </ul>
692
+
693
+ </div><table class="source_code">
694
+ <tr>
695
+ <td>
696
+ <pre class="lines">
697
+
698
+
699
+ 28
700
+ 29
701
+ 30
702
+ 31
703
+ 32
704
+ 33
705
+ 34
706
+ 35
707
+ 36</pre>
708
+ </td>
709
+ <td>
710
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 28</span>
711
+
712
+ <span class='kw'>def</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='id identifier rubyid_api_url'>api_url</span><span class='comma'>,</span> <span class='id identifier rubyid_auth'>auth</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
713
+ <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='const'>RestClient</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='symbol'>:get</span><span class='comma'>,</span>
714
+ <span class='label'>url:</span> <span class='id identifier rubyid_api_url'>api_url</span><span class='comma'>,</span>
715
+ <span class='label'>verify_ssl:</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@verify_cert</span> <span class='op'>:</span> <span class='id identifier rubyid_cert'>cert</span><span class='comma'>,</span>
716
+ <span class='label'>headers:</span> <span class='lbrace'>{</span>
717
+ <span class='symbol'>:X-SDS-AUTH-TOKEN</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_auth'>auth</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@auth_token</span> <span class='op'>:</span> <span class='id identifier rubyid_auth'>auth</span><span class='comma'>,</span>
718
+ <span class='label'>accept:</span> <span class='symbol'>:json</span>
719
+ <span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
720
+ <span class='kw'>end</span></pre>
721
+ </td>
722
+ </tr>
723
+ </table>
724
+ </div>
725
+
726
+ <div class="method_details ">
727
+ <h3 class="signature " id="rest_post-instance_method">
728
+
729
+ - (<tt>Hash</tt>) <strong>rest_post</strong>(payload, api_url, auth = nil, cert = nil)
730
+
731
+
732
+
733
+
734
+
735
+ </h3><div class="docstring">
736
+ <div class="discussion">
737
+
738
+ <p>Generic API post call</p>
739
+
740
+
741
+ </div>
742
+ </div>
743
+ <div class="tags">
744
+ <p class="tag_title">Parameters:</p>
745
+ <ul class="param">
746
+
747
+ <li>
748
+
749
+ <span class='name'>payload</span>
750
+
751
+
752
+ <span class='type'>(<tt>JSON</tt>)</span>
753
+
754
+
755
+
756
+ &mdash;
757
+ <div class='inline'>
758
+ <p>the JSON payload to be posted</p>
759
+ </div>
760
+
761
+ </li>
762
+
763
+ <li>
764
+
765
+ <span class='name'>api_url</span>
766
+
767
+
768
+ <span class='type'>(<tt>string</tt>)</span>
769
+
770
+
771
+
772
+ &mdash;
773
+ <div class='inline'>
774
+ <p>the full API URL path</p>
775
+ </div>
776
+
777
+ </li>
778
+
779
+ </ul>
780
+
781
+ <p class="tag_title">Returns:</p>
782
+ <ul class="return">
783
+
784
+ <li>
785
+
786
+
787
+ <span class='type'>(<tt>Hash</tt>)</span>
788
+
789
+
790
+
791
+ &mdash;
792
+ <div class='inline'>
793
+ <p>the object converted into Hash format and can be parsed with <a
794
+ href="0">object</a> or <a href="'id'">object</a> notation</p>
795
+ </div>
796
+
797
+ </li>
798
+
799
+ </ul>
800
+
801
+ </div><table class="source_code">
802
+ <tr>
803
+ <td>
804
+ <pre class="lines">
805
+
806
+
807
+ 12
808
+ 13
809
+ 14
810
+ 15
811
+ 16
812
+ 17
813
+ 18
814
+ 19
815
+ 20
816
+ 21
817
+ 22</pre>
818
+ </td>
819
+ <td>
820
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 12</span>
821
+
822
+ <span class='kw'>def</span> <span class='id identifier rubyid_rest_post'>rest_post</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='id identifier rubyid_api_url'>api_url</span><span class='comma'>,</span> <span class='id identifier rubyid_auth'>auth</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
823
+ <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='const'>RestClient</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='symbol'>:post</span><span class='comma'>,</span>
824
+ <span class='label'>url:</span> <span class='id identifier rubyid_api_url'>api_url</span><span class='comma'>,</span>
825
+ <span class='label'>verify_ssl:</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@verify_cert</span> <span class='op'>:</span> <span class='id identifier rubyid_cert'>cert</span><span class='comma'>,</span>
826
+ <span class='label'>payload:</span> <span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span>
827
+ <span class='label'>headers:</span> <span class='lbrace'>{</span>
828
+ <span class='symbol'>:X-SDS-AUTH-TOKEN</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_auth'>auth</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='ivar'>@auth_token</span> <span class='op'>:</span> <span class='id identifier rubyid_auth'>auth</span><span class='comma'>,</span>
829
+ <span class='label'>content_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
830
+ <span class='label'>accept:</span> <span class='symbol'>:json</span>
831
+ <span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
832
+ <span class='kw'>end</span></pre>
833
+ </td>
834
+ </tr>
835
+ </table>
836
+ </div>
837
+
838
+ <div class="method_details ">
839
+ <h3 class="signature " id="to_boolean-instance_method">
840
+
841
+ - (<tt>bool</tt>) <strong>to_boolean</strong>(str)
842
+
843
+
844
+
845
+
846
+
847
+ </h3><div class="docstring">
848
+ <div class="discussion">
849
+
850
+ <p>Ensure value is a boolean</p>
851
+
852
+
853
+ </div>
854
+ </div>
855
+ <div class="tags">
856
+ <p class="tag_title">Parameters:</p>
857
+ <ul class="param">
858
+
859
+ <li>
860
+
861
+ <span class='name'>str</span>
862
+
863
+
864
+ <span class='type'>(<tt>string</tt>, <tt>bool</tt>)</span>
865
+
866
+
867
+
868
+ &mdash;
869
+ <div class='inline'>
870
+ <p>the value to convert or verify</p>
871
+ </div>
872
+
873
+ </li>
874
+
875
+ </ul>
876
+
877
+ <p class="tag_title">Returns:</p>
878
+ <ul class="return">
879
+
880
+ <li>
881
+
882
+
883
+ <span class='type'>(<tt>bool</tt>)</span>
884
+
885
+
886
+
887
+ &mdash;
888
+ <div class='inline'>
889
+ <p>returns True or False</p>
890
+ </div>
891
+
892
+ </li>
893
+
894
+ </ul>
895
+
896
+ </div><table class="source_code">
897
+ <tr>
898
+ <td>
899
+ <pre class="lines">
900
+
901
+
902
+ 80
903
+ 81
904
+ 82</pre>
905
+ </td>
906
+ <td>
907
+ <pre class="code"><span class="info file"># File 'lib/vipruby/viprbase.rb', line 80</span>
908
+
909
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_boolean'>to_boolean</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
910
+ <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>true</span><span class='tstring_end'>&quot;</span></span>
911
+ <span class='kw'>end</span></pre>
912
+ </td>
913
+ </tr>
914
+ </table>
915
+ </div>
916
+
917
+ </div>
918
+
919
+ </div>
920
+
921
+ <div id="footer">
922
+ Generated on Mon Dec 15 13:52:44 2014 by
923
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
924
+ 0.8.7.6 (ruby-2.1.2).
925
+ </div>
926
+
927
+ </body>
928
+ </html>