wf_node_api 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/Gemfile +28 -0
  4. data/Gemfile.lock +66 -0
  5. data/LICENSE +340 -0
  6. data/Makefile +19 -0
  7. data/README.md +78 -0
  8. data/Rakefile +2 -0
  9. data/Vagrantfile +102 -0
  10. data/_docs/api/Api/NodeApi.html +123 -0
  11. data/_docs/api/Api.html +149 -0
  12. data/_docs/api/Config/Check.html +331 -0
  13. data/_docs/api/Config.html +115 -0
  14. data/_docs/api/ConfigCheck.html +365 -0
  15. data/_docs/api/ContainerManager.html +1632 -0
  16. data/_docs/api/ContainerManagerAdapter/Lxc.html +1352 -0
  17. data/_docs/api/ContainerManagerAdapter/Vserver.html +1358 -0
  18. data/_docs/api/ContainerManagerAdapter.html +151 -0
  19. data/_docs/api/Error/NotFound.html +134 -0
  20. data/_docs/api/Error.html +115 -0
  21. data/_docs/api/NotFoundError.html +157 -0
  22. data/_docs/api/OS.html +234 -0
  23. data/_docs/api/ResourceManager.html +322 -0
  24. data/_docs/api/ResourceManagerAdapter/Linux.html +326 -0
  25. data/_docs/api/ResourceManagerAdapter.html +149 -0
  26. data/_docs/api/WfNodeApi.html +163 -0
  27. data/_docs/api/_index.html +239 -0
  28. data/_docs/api/class_list.html +58 -0
  29. data/_docs/api/css/common.css +1 -0
  30. data/_docs/api/css/full_list.css +57 -0
  31. data/_docs/api/css/style.css +339 -0
  32. data/_docs/api/file.README.html +146 -0
  33. data/_docs/api/file_list.html +60 -0
  34. data/_docs/api/frames.html +26 -0
  35. data/_docs/api/index.html +146 -0
  36. data/_docs/api/js/app.js +219 -0
  37. data/_docs/api/js/full_list.js +181 -0
  38. data/_docs/api/js/jquery.js +4 -0
  39. data/_docs/api/method_list.html +273 -0
  40. data/_docs/api/top-level-namespace.html +244 -0
  41. data/_docs/rest/api_data.js +1 -0
  42. data/_docs/rest/api_data.json +1 -0
  43. data/_docs/rest/api_project.js +1 -0
  44. data/_docs/rest/api_project.json +1 -0
  45. data/_docs/rest/css/style.css +538 -0
  46. data/_docs/rest/header.md +3 -0
  47. data/_docs/rest/img/favicon.ico +0 -0
  48. data/_docs/rest/img/glyphicons-halflings-white.png +0 -0
  49. data/_docs/rest/img/glyphicons-halflings.png +0 -0
  50. data/_docs/rest/index.html +658 -0
  51. data/_docs/rest/locales/de.js +25 -0
  52. data/_docs/rest/locales/fr.js +25 -0
  53. data/_docs/rest/locales/locale.js +43 -0
  54. data/_docs/rest/locales/nl.js +25 -0
  55. data/_docs/rest/locales/pl.js +25 -0
  56. data/_docs/rest/locales/pt_br.js +25 -0
  57. data/_docs/rest/locales/ru.js +25 -0
  58. data/_docs/rest/locales/zh.js +25 -0
  59. data/_docs/rest/main.js +691 -0
  60. data/_docs/rest/utils/handlebars_helper.js +327 -0
  61. data/_docs/rest/utils/send_sample_request.js +158 -0
  62. data/_docs/rest/vendor/bootstrap-responsive.min.css +9 -0
  63. data/_docs/rest/vendor/bootstrap.min.css +9 -0
  64. data/_docs/rest/vendor/bootstrap.min.js +6 -0
  65. data/_docs/rest/vendor/diff_match_patch.min.js +49 -0
  66. data/_docs/rest/vendor/handlebars.min.js +28 -0
  67. data/_docs/rest/vendor/jquery.min.js +4 -0
  68. data/_docs/rest/vendor/lodash.min.js +61 -0
  69. data/_docs/rest/vendor/path-to-regexp/LICENSE +21 -0
  70. data/_docs/rest/vendor/path-to-regexp/index.js +205 -0
  71. data/_docs/rest/vendor/polyfill.js +100 -0
  72. data/_docs/rest/vendor/prettify/lang-apollo.js +2 -0
  73. data/_docs/rest/vendor/prettify/lang-basic.js +3 -0
  74. data/_docs/rest/vendor/prettify/lang-clj.js +18 -0
  75. data/_docs/rest/vendor/prettify/lang-css.js +2 -0
  76. data/_docs/rest/vendor/prettify/lang-dart.js +3 -0
  77. data/_docs/rest/vendor/prettify/lang-erlang.js +2 -0
  78. data/_docs/rest/vendor/prettify/lang-go.js +1 -0
  79. data/_docs/rest/vendor/prettify/lang-hs.js +2 -0
  80. data/_docs/rest/vendor/prettify/lang-lisp.js +3 -0
  81. data/_docs/rest/vendor/prettify/lang-llvm.js +1 -0
  82. data/_docs/rest/vendor/prettify/lang-lua.js +2 -0
  83. data/_docs/rest/vendor/prettify/lang-matlab.js +6 -0
  84. data/_docs/rest/vendor/prettify/lang-ml.js +2 -0
  85. data/_docs/rest/vendor/prettify/lang-mumps.js +2 -0
  86. data/_docs/rest/vendor/prettify/lang-n.js +4 -0
  87. data/_docs/rest/vendor/prettify/lang-pascal.js +3 -0
  88. data/_docs/rest/vendor/prettify/lang-proto.js +1 -0
  89. data/_docs/rest/vendor/prettify/lang-r.js +2 -0
  90. data/_docs/rest/vendor/prettify/lang-rd.js +1 -0
  91. data/_docs/rest/vendor/prettify/lang-scala.js +2 -0
  92. data/_docs/rest/vendor/prettify/lang-sql.js +2 -0
  93. data/_docs/rest/vendor/prettify/lang-tcl.js +3 -0
  94. data/_docs/rest/vendor/prettify/lang-tex.js +1 -0
  95. data/_docs/rest/vendor/prettify/lang-vb.js +2 -0
  96. data/_docs/rest/vendor/prettify/lang-vhdl.js +3 -0
  97. data/_docs/rest/vendor/prettify/lang-wiki.js +2 -0
  98. data/_docs/rest/vendor/prettify/lang-xq.js +3 -0
  99. data/_docs/rest/vendor/prettify/lang-yaml.js +2 -0
  100. data/_docs/rest/vendor/prettify/prettify.css +1 -0
  101. data/_docs/rest/vendor/prettify/prettify.js +30 -0
  102. data/_docs/rest/vendor/prettify/run_prettify.js +34 -0
  103. data/_docs/rest/vendor/prettify.css +101 -0
  104. data/_docs/rest/vendor/require.min.js +36 -0
  105. data/apidoc.json +23 -0
  106. data/bin/wf_node_api +80 -0
  107. data/lib/wf_node_api/api/node_api.rb +360 -0
  108. data/lib/wf_node_api/config/config_template.erb +50 -0
  109. data/lib/wf_node_api/config_check.rb +50 -0
  110. data/lib/wf_node_api/container_manager.rb +286 -0
  111. data/lib/wf_node_api/container_manager_adapter/lxc.rb +431 -0
  112. data/lib/wf_node_api/container_manager_adapter/vserver.rb +448 -0
  113. data/lib/wf_node_api/error/not_found.rb +27 -0
  114. data/lib/wf_node_api/os.rb +32 -0
  115. data/lib/wf_node_api/resource_manager.rb +49 -0
  116. data/lib/wf_node_api/resource_manager_adapter/linux.rb +53 -0
  117. data/lib/wf_node_api/translations.rb +38 -0
  118. data/lib/wf_node_api/version.rb +28 -0
  119. data/lib/wf_node_api.rb +57 -0
  120. data/manifests/files/dhozac-vserver.repo +4 -0
  121. data/wf-node-api.gemspec +53 -0
  122. metadata +221 -0
@@ -0,0 +1,1632 @@
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
+ Class: ContainerManager
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#!ContainerManager.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 (C)</a> &raquo;
35
+
36
+
37
+ <span class="title">ContainerManager</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>Class: ContainerManager
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">ContainerManager</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/wf_node_api/container_manager.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Manager for containers, meta class</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <h2>
122
+ Instance Method Summary
123
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
124
+ </h2>
125
+
126
+ <ul class="summary">
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#check-instance_method" title="#check (instance method)">- (Object) <strong>check</strong> </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <span class="summary_desc"><div class='inline'>
146
+ <p>Checks the installation with a simple test procedure.</p>
147
+ </div></span>
148
+
149
+ </li>
150
+
151
+
152
+ <li class="public ">
153
+ <span class="summary_signature">
154
+
155
+ <a href="#container-instance_method" title="#container (instance method)">- (Hash) <strong>container</strong>(name) </a>
156
+
157
+
158
+
159
+ </span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <span class="summary_desc"><div class='inline'>
170
+ <p>Returns information for a single container.</p>
171
+ </div></span>
172
+
173
+ </li>
174
+
175
+
176
+ <li class="public ">
177
+ <span class="summary_signature">
178
+
179
+ <a href="#containers-instance_method" title="#containers (instance method)">- (Array) <strong>containers</strong> </a>
180
+
181
+
182
+
183
+ </span>
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <span class="summary_desc"><div class='inline'>
194
+ <p>Lists all available containers.</p>
195
+ </div></span>
196
+
197
+ </li>
198
+
199
+
200
+ <li class="public ">
201
+ <span class="summary_signature">
202
+
203
+ <a href="#create_container-instance_method" title="#create_container (instance method)">- (String) <strong>create_container</strong>(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count) </a>
204
+
205
+
206
+
207
+ </span>
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+ <span class="summary_desc"><div class='inline'>
218
+ <p>Creates a container with the given parameters.</p>
219
+ </div></span>
220
+
221
+ </li>
222
+
223
+
224
+ <li class="public ">
225
+ <span class="summary_signature">
226
+
227
+ <a href="#delete-instance_method" title="#delete (instance method)">- (String) <strong>delete</strong>(name) </a>
228
+
229
+
230
+
231
+ </span>
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ <span class="summary_desc"><div class='inline'>
242
+ <p>Deletes a container with the given name.</p>
243
+ </div></span>
244
+
245
+ </li>
246
+
247
+
248
+ <li class="public ">
249
+ <span class="summary_signature">
250
+
251
+ <a href="#free_cpu_core_count-instance_method" title="#free_cpu_core_count (instance method)">- (Integer) <strong>free_cpu_core_count</strong>(resman) </a>
252
+
253
+
254
+
255
+ </span>
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <span class="summary_desc"><div class='inline'>
266
+ <p>Returns the amount of free cpu cores.</p>
267
+ </div></span>
268
+
269
+ </li>
270
+
271
+
272
+ <li class="public ">
273
+ <span class="summary_signature">
274
+
275
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (ContainerManager) <strong>initialize</strong>(container_type) </a>
276
+
277
+
278
+
279
+ </span>
280
+
281
+
282
+ <span class="note title constructor">constructor</span>
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+ <span class="summary_desc"><div class='inline'>
292
+ <p>Initializes the manager with the matching adapter.</p>
293
+ </div></span>
294
+
295
+ </li>
296
+
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#kill-instance_method" title="#kill (instance method)">- (String) <strong>kill</strong>(name) </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+ <span class="summary_desc"><div class='inline'>
316
+ <p>Kills a container with the given name.</p>
317
+ </div></span>
318
+
319
+ </li>
320
+
321
+
322
+ <li class="public ">
323
+ <span class="summary_signature">
324
+
325
+ <a href="#start-instance_method" title="#start (instance method)">- (String) <strong>start</strong>(name) </a>
326
+
327
+
328
+
329
+ </span>
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+ <span class="summary_desc"><div class='inline'>
340
+ <p>Starts a container with the given name.</p>
341
+ </div></span>
342
+
343
+ </li>
344
+
345
+
346
+ <li class="public ">
347
+ <span class="summary_signature">
348
+
349
+ <a href="#stop-instance_method" title="#stop (instance method)">- (String) <strong>stop</strong>(name) </a>
350
+
351
+
352
+
353
+ </span>
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+ <span class="summary_desc"><div class='inline'>
364
+ <p>Stops a container with the given name.</p>
365
+ </div></span>
366
+
367
+ </li>
368
+
369
+
370
+ </ul>
371
+
372
+
373
+ <div id="constructor_details" class="method_details_list">
374
+ <h2>Constructor Details</h2>
375
+
376
+ <div class="method_details first">
377
+ <h3 class="signature first" id="initialize-instance_method">
378
+
379
+ - (<tt><span class='object_link'><a href="" title="ContainerManager (class)">ContainerManager</a></span></tt>) <strong>initialize</strong>(container_type)
380
+
381
+
382
+
383
+
384
+
385
+ </h3><div class="docstring">
386
+ <div class="discussion">
387
+
388
+ <p>Initializes the manager with the matching adapter</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'>container_type</span>
400
+
401
+
402
+ <span class='type'>(<tt>String</tt>)</span>
403
+
404
+
405
+
406
+ &mdash;
407
+ <div class='inline'>
408
+ <p>Container adapter</p>
409
+ </div>
410
+
411
+ </li>
412
+
413
+ </ul>
414
+
415
+ <p class="tag_title">Raises:</p>
416
+ <ul class="raise">
417
+
418
+ <li>
419
+
420
+
421
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
422
+
423
+
424
+
425
+ &mdash;
426
+ <div class='inline'>
427
+ <p>if the container type is invalid</p>
428
+ </div>
429
+
430
+ </li>
431
+
432
+ </ul>
433
+
434
+ </div><table class="source_code">
435
+ <tr>
436
+ <td>
437
+ <pre class="lines">
438
+
439
+
440
+ 149
441
+ 150
442
+ 151
443
+ 152
444
+ 153
445
+ 154
446
+ 155
447
+ 156
448
+ 157</pre>
449
+ </td>
450
+ <td>
451
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 149</span>
452
+
453
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_container_type'>container_type</span><span class='rparen'>)</span>
454
+ <span class='kw'>if</span> <span class='id identifier rubyid_container_type'>container_type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>lxc</span><span class='tstring_end'>&#39;</span></span>
455
+ <span class='ivar'>@adapter</span> <span class='op'>=</span> <span class='const'>ContainerManagerAdapter</span><span class='op'>::</span><span class='const'>Lxc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
456
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_container_type'>container_type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>vserver</span><span class='tstring_end'>&#39;</span></span>
457
+ <span class='ivar'>@adapter</span> <span class='op'>=</span> <span class='const'>ContainerManagerAdapter</span><span class='op'>::</span><span class='const'>Vserver</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
458
+ <span class='kw'>else</span>
459
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>invalid container type</span><span class='tstring_end'>&#39;</span></span>
460
+ <span class='kw'>end</span>
461
+ <span class='kw'>end</span></pre>
462
+ </td>
463
+ </tr>
464
+ </table>
465
+ </div>
466
+
467
+ </div>
468
+
469
+
470
+ <div id="instance_method_details" class="method_details_list">
471
+ <h2>Instance Method Details</h2>
472
+
473
+
474
+ <div class="method_details first">
475
+ <h3 class="signature first" id="check-instance_method">
476
+
477
+ - (<tt>Object</tt>) <strong>check</strong>
478
+
479
+
480
+
481
+
482
+
483
+ </h3><div class="docstring">
484
+ <div class="discussion">
485
+
486
+ <p>Checks the installation with a simple test procedure</p>
487
+
488
+
489
+ </div>
490
+ </div>
491
+ <div class="tags">
492
+
493
+ <p class="tag_title">Raises:</p>
494
+ <ul class="raise">
495
+
496
+ <li>
497
+
498
+
499
+ <span class='type'>(<tt>StandardError</tt>)</span>
500
+
501
+
502
+
503
+ </li>
504
+
505
+ </ul>
506
+
507
+ </div><table class="source_code">
508
+ <tr>
509
+ <td>
510
+ <pre class="lines">
511
+
512
+
513
+ 31
514
+ 32
515
+ 33
516
+ 34
517
+ 35
518
+ 36
519
+ 37
520
+ 38
521
+ 39
522
+ 40
523
+ 41
524
+ 42
525
+ 43
526
+ 44
527
+ 45
528
+ 46
529
+ 47
530
+ 48
531
+ 49
532
+ 50
533
+ 51
534
+ 52
535
+ 53
536
+ 54
537
+ 55
538
+ 56
539
+ 57
540
+ 58
541
+ 59
542
+ 60
543
+ 61
544
+ 62
545
+ 63
546
+ 64
547
+ 65
548
+ 66
549
+ 67
550
+ 68
551
+ 69
552
+ 70
553
+ 71
554
+ 72
555
+ 73
556
+ 74
557
+ 75
558
+ 76
559
+ 77
560
+ 78
561
+ 79
562
+ 80
563
+ 81
564
+ 82
565
+ 83
566
+ 84
567
+ 85
568
+ 86
569
+ 87
570
+ 88
571
+ 89
572
+ 90
573
+ 91
574
+ 92
575
+ 93
576
+ 94
577
+ 95
578
+ 96
579
+ 97
580
+ 98
581
+ 99
582
+ 100
583
+ 101
584
+ 102
585
+ 103
586
+ 104
587
+ 105
588
+ 106
589
+ 107
590
+ 108
591
+ 109
592
+ 110
593
+ 111
594
+ 112
595
+ 113
596
+ 114
597
+ 115
598
+ 116
599
+ 117
600
+ 118
601
+ 119
602
+ 120
603
+ 121
604
+ 122
605
+ 123
606
+ 124
607
+ 125
608
+ 126
609
+ 127
610
+ 128
611
+ 129
612
+ 130
613
+ 131
614
+ 132
615
+ 133
616
+ 134
617
+ 135
618
+ 136
619
+ 137
620
+ 138
621
+ 139
622
+ 140
623
+ 141
624
+ 142</pre>
625
+ </td>
626
+ <td>
627
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 31</span>
628
+
629
+ <span class='kw'>def</span> <span class='id identifier rubyid_check'>check</span>
630
+ <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='int'>8</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='lparen'>(</span><span class='int'>65</span> <span class='op'>+</span> <span class='id identifier rubyid_rand'>rand</span><span class='lparen'>(</span><span class='int'>26</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_chr'>chr</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
631
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Random name for the container: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
632
+
633
+ <span class='comment'># containers should return an array
634
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Listing containers</span><span class='tstring_end'>&quot;</span></span>
635
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_containers'>containers</span><span class='lparen'>(</span><span class='rparen'>)</span>
636
+ <span class='comment'>#puts res.inspect
637
+ </span>
638
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>containers() failed</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
639
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
640
+
641
+ <span class='comment'># container should not work
642
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Getting container info on non-existant container (should not work)</span><span class='tstring_end'>&quot;</span></span>
643
+
644
+ <span class='kw'>begin</span>
645
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_container'>container</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
646
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>container() failed</span><span class='tstring_end'>&#39;</span></span>
647
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
648
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
649
+ <span class='kw'>end</span>
650
+
651
+ <span class='comment'># delete should not work
652
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Delete non-existing container (should not work)</span><span class='tstring_end'>&quot;</span></span>
653
+
654
+ <span class='kw'>begin</span>
655
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
656
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>delete() failed</span><span class='tstring_end'>&#39;</span></span>
657
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
658
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
659
+ <span class='kw'>end</span>
660
+
661
+ <span class='comment'># start should not work
662
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Starting non-existing container (should not work)</span><span class='tstring_end'>&quot;</span></span>
663
+
664
+ <span class='kw'>begin</span>
665
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
666
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>start() failed</span><span class='tstring_end'>&#39;</span></span>
667
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
668
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
669
+ <span class='kw'>end</span>
670
+
671
+ <span class='comment'># stop should not work
672
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Stopping non-existing container (should not work)</span><span class='tstring_end'>&quot;</span></span>
673
+
674
+ <span class='kw'>begin</span>
675
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_stop'>stop</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
676
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>stop() failed</span><span class='tstring_end'>&#39;</span></span>
677
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
678
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
679
+ <span class='kw'>end</span>
680
+
681
+ <span class='comment'># kill should not work
682
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Killing non-existing container (should not work)</span><span class='tstring_end'>&quot;</span></span>
683
+
684
+ <span class='kw'>begin</span>
685
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
686
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>kill() failed</span><span class='tstring_end'>&#39;</span></span>
687
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
688
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
689
+ <span class='kw'>end</span>
690
+
691
+ <span class='comment'># create should work
692
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Create container</span><span class='tstring_end'>&quot;</span></span>
693
+ <span class='id identifier rubyid_create_container'>create_container</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.2.3.4</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>64</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
694
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
695
+
696
+ <span class='comment'># start should work
697
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Starting container</span><span class='tstring_end'>&quot;</span></span>
698
+ <span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
699
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
700
+
701
+ <span class='comment'># stop should work
702
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Stopping container</span><span class='tstring_end'>&quot;</span></span>
703
+ <span class='id identifier rubyid_stop'>stop</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
704
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
705
+
706
+ <span class='comment'># kill should not work
707
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Killing stopped container (should not work)</span><span class='tstring_end'>&quot;</span></span>
708
+
709
+ <span class='kw'>begin</span>
710
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
711
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>kill() failed</span><span class='tstring_end'>&#39;</span></span>
712
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
713
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
714
+ <span class='kw'>end</span>
715
+
716
+ <span class='comment'># stop should not work
717
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Stopping stopped container (should not work)</span><span class='tstring_end'>&quot;</span></span>
718
+
719
+ <span class='kw'>begin</span>
720
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='id identifier rubyid_stop'>stop</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
721
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>stop() failed</span><span class='tstring_end'>&#39;</span></span>
722
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
723
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
724
+ <span class='kw'>end</span>
725
+
726
+ <span class='comment'># start should work
727
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Starting container</span><span class='tstring_end'>&quot;</span></span>
728
+ <span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
729
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
730
+
731
+ <span class='comment'># kill should work
732
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Killing container</span><span class='tstring_end'>&quot;</span></span>
733
+ <span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
734
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
735
+
736
+ <span class='comment'># delete should work
737
+ </span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; Deleting container</span><span class='tstring_end'>&quot;</span></span>
738
+ <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
739
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>==&gt; PASS</span><span class='tstring_end'>&quot;</span></span>
740
+ <span class='kw'>end</span></pre>
741
+ </td>
742
+ </tr>
743
+ </table>
744
+ </div>
745
+
746
+ <div class="method_details ">
747
+ <h3 class="signature " id="container-instance_method">
748
+
749
+ - (<tt>Hash</tt>) <strong>container</strong>(name)
750
+
751
+
752
+
753
+
754
+
755
+ </h3><div class="docstring">
756
+ <div class="discussion">
757
+
758
+ <p>Returns information for a single container</p>
759
+
760
+
761
+ </div>
762
+ </div>
763
+ <div class="tags">
764
+ <p class="tag_title">Parameters:</p>
765
+ <ul class="param">
766
+
767
+ <li>
768
+
769
+ <span class='name'>name</span>
770
+
771
+
772
+ <span class='type'>(<tt>String</tt>)</span>
773
+
774
+
775
+
776
+ &mdash;
777
+ <div class='inline'>
778
+ <p>The container name</p>
779
+ </div>
780
+
781
+ </li>
782
+
783
+ </ul>
784
+
785
+ <p class="tag_title">Returns:</p>
786
+ <ul class="return">
787
+
788
+ <li>
789
+
790
+
791
+ <span class='type'>(<tt>Hash</tt>)</span>
792
+
793
+
794
+
795
+ &mdash;
796
+ <div class='inline'>
797
+ <p>Hash with information about the container</p>
798
+ </div>
799
+
800
+ </li>
801
+
802
+ </ul>
803
+ <p class="tag_title">Raises:</p>
804
+ <ul class="raise">
805
+
806
+ <li>
807
+
808
+
809
+ <span class='type'>(<tt><span class='object_link'><a href="NotFoundError.html" title="NotFoundError (class)">NotFoundError</a></span></tt>)</span>
810
+
811
+
812
+
813
+ </li>
814
+
815
+ </ul>
816
+
817
+ </div><table class="source_code">
818
+ <tr>
819
+ <td>
820
+ <pre class="lines">
821
+
822
+
823
+ 173
824
+ 174
825
+ 175
826
+ 176
827
+ 177
828
+ 178
829
+ 179</pre>
830
+ </td>
831
+ <td>
832
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 173</span>
833
+
834
+ <span class='kw'>def</span> <span class='id identifier rubyid_container'>container</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
835
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
836
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>NotFoundError</span>
837
+ <span class='kw'>end</span>
838
+
839
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_container'>container</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
840
+ <span class='kw'>end</span></pre>
841
+ </td>
842
+ </tr>
843
+ </table>
844
+ </div>
845
+
846
+ <div class="method_details ">
847
+ <h3 class="signature " id="containers-instance_method">
848
+
849
+ - (<tt>Array</tt>) <strong>containers</strong>
850
+
851
+
852
+
853
+
854
+
855
+ </h3><div class="docstring">
856
+ <div class="discussion">
857
+
858
+ <p>Lists all available containers</p>
859
+
860
+
861
+ </div>
862
+ </div>
863
+ <div class="tags">
864
+
865
+ <p class="tag_title">Returns:</p>
866
+ <ul class="return">
867
+
868
+ <li>
869
+
870
+
871
+ <span class='type'>(<tt>Array</tt>)</span>
872
+
873
+
874
+
875
+ </li>
876
+
877
+ </ul>
878
+
879
+ </div><table class="source_code">
880
+ <tr>
881
+ <td>
882
+ <pre class="lines">
883
+
884
+
885
+ 162
886
+ 163
887
+ 164</pre>
888
+ </td>
889
+ <td>
890
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 162</span>
891
+
892
+ <span class='kw'>def</span> <span class='id identifier rubyid_containers'>containers</span>
893
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_containers'>containers</span>
894
+ <span class='kw'>end</span></pre>
895
+ </td>
896
+ </tr>
897
+ </table>
898
+ </div>
899
+
900
+ <div class="method_details ">
901
+ <h3 class="signature " id="create_container-instance_method">
902
+
903
+ - (<tt>String</tt>) <strong>create_container</strong>(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
904
+
905
+
906
+
907
+
908
+
909
+ </h3><div class="docstring">
910
+ <div class="discussion">
911
+
912
+ <p>Creates a container with the given parameters</p>
913
+
914
+
915
+ </div>
916
+ </div>
917
+ <div class="tags">
918
+ <p class="tag_title">Parameters:</p>
919
+ <ul class="param">
920
+
921
+ <li>
922
+
923
+ <span class='name'>name</span>
924
+
925
+
926
+ <span class='type'>(<tt>String</tt>)</span>
927
+
928
+
929
+
930
+ &mdash;
931
+ <div class='inline'>
932
+ <p>The container name</p>
933
+ </div>
934
+
935
+ </li>
936
+
937
+ <li>
938
+
939
+ <span class='name'>ip_address</span>
940
+
941
+
942
+ <span class='type'>(<tt>String</tt>)</span>
943
+
944
+
945
+
946
+ &mdash;
947
+ <div class='inline'>
948
+ <p>A valid IPv4 address</p>
949
+ </div>
950
+
951
+ </li>
952
+
953
+ <li>
954
+
955
+ <span class='name'>disk_size_gb</span>
956
+
957
+
958
+ <span class='type'>(<tt>Integer</tt>)</span>
959
+
960
+
961
+
962
+ &mdash;
963
+ <div class='inline'>
964
+ <p>The disk size in GB</p>
965
+ </div>
966
+
967
+ </li>
968
+
969
+ <li>
970
+
971
+ <span class='name'>memory_limit_mb</span>
972
+
973
+
974
+ <span class='type'>(<tt>Integer</tt>)</span>
975
+
976
+
977
+
978
+ &mdash;
979
+ <div class='inline'>
980
+ <p>The memory limit in MB</p>
981
+ </div>
982
+
983
+ </li>
984
+
985
+ <li>
986
+
987
+ <span class='name'>cpu_core_count</span>
988
+
989
+
990
+ <span class='type'>(<tt>Integer</tt>)</span>
991
+
992
+
993
+
994
+ &mdash;
995
+ <div class='inline'>
996
+ <p>Amount of Vcores to assign</p>
997
+ </div>
998
+
999
+ </li>
1000
+
1001
+ </ul>
1002
+
1003
+ <p class="tag_title">Returns:</p>
1004
+ <ul class="return">
1005
+
1006
+ <li>
1007
+
1008
+
1009
+ <span class='type'>(<tt>String</tt>)</span>
1010
+
1011
+
1012
+
1013
+ &mdash;
1014
+ <div class='inline'>
1015
+ <p>CLI output</p>
1016
+ </div>
1017
+
1018
+ </li>
1019
+
1020
+ </ul>
1021
+ <p class="tag_title">Raises:</p>
1022
+ <ul class="raise">
1023
+
1024
+ <li>
1025
+
1026
+
1027
+ <span class='type'>(<tt>RuntimeError</tt>)</span>
1028
+
1029
+
1030
+
1031
+ </li>
1032
+
1033
+ <li>
1034
+
1035
+
1036
+ <span class='type'>(<tt><span class='object_link'><a href="NotFoundError.html" title="NotFoundError (class)">NotFoundError</a></span></tt>)</span>
1037
+
1038
+
1039
+
1040
+ </li>
1041
+
1042
+ <li>
1043
+
1044
+
1045
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
1046
+
1047
+
1048
+
1049
+ </li>
1050
+
1051
+ </ul>
1052
+
1053
+ </div><table class="source_code">
1054
+ <tr>
1055
+ <td>
1056
+ <pre class="lines">
1057
+
1058
+
1059
+ 267
1060
+ 268
1061
+ 269
1062
+ 270
1063
+ 271
1064
+ 272
1065
+ 273
1066
+ 274
1067
+ 275
1068
+ 276
1069
+ 277
1070
+ 278
1071
+ 279
1072
+ 280
1073
+ 281
1074
+ 282
1075
+ 283
1076
+ 284
1077
+ 285</pre>
1078
+ </td>
1079
+ <td>
1080
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 267</span>
1081
+
1082
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_container'>create_container</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_ip_address'>ip_address</span><span class='comma'>,</span> <span class='id identifier rubyid_disk_size_gb'>disk_size_gb</span><span class='comma'>,</span> <span class='id identifier rubyid_memory_limit_mb'>memory_limit_mb</span><span class='comma'>,</span> <span class='id identifier rubyid_cpu_core_count'>cpu_core_count</span><span class='rparen'>)</span>
1083
+ <span class='id identifier rubyid_disk_size_gb'>disk_size_gb</span> <span class='op'>=</span> <span class='id identifier rubyid_disk_size_gb'>disk_size_gb</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1084
+ <span class='id identifier rubyid_memory_limit_mb'>memory_limit_mb</span> <span class='op'>=</span> <span class='id identifier rubyid_memory_limit_mb'>memory_limit_mb</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1085
+ <span class='id identifier rubyid_cpu_core_count'>cpu_core_count</span> <span class='op'>=</span> <span class='id identifier rubyid_cpu_core_count'>cpu_core_count</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1086
+
1087
+ <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^([A-Za-z0-9_]+)$</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1088
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>container name is invalid</span><span class='tstring_end'>&#39;</span></span>
1089
+ <span class='kw'>end</span>
1090
+
1091
+ <span class='kw'>if</span> <span class='id identifier rubyid_ip_address'>ip_address</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_ip_address'>ip_address</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='embexpr_beg'>#{</span><span class='const'>Resolv</span><span class='op'>::</span><span class='const'>IPv4</span><span class='op'>::</span><span class='const'>Regex</span><span class='embexpr_end'>}</span><span class='tstring_content'>$</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_ip_address'>ip_address</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1092
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>the submitted ip address is not a valid ipv4 address</span><span class='tstring_end'>&#39;</span></span>
1093
+ <span class='kw'>end</span>
1094
+
1095
+ <span class='kw'>if</span> <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1096
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>NotFoundError</span>
1097
+ <span class='kw'>end</span>
1098
+
1099
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_create_container'>create_container</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_ip_address'>ip_address</span><span class='comma'>,</span> <span class='id identifier rubyid_disk_size_gb'>disk_size_gb</span><span class='comma'>,</span> <span class='id identifier rubyid_memory_limit_mb'>memory_limit_mb</span><span class='comma'>,</span> <span class='id identifier rubyid_cpu_core_count'>cpu_core_count</span><span class='rparen'>)</span>
1100
+ <span class='kw'>end</span></pre>
1101
+ </td>
1102
+ </tr>
1103
+ </table>
1104
+ </div>
1105
+
1106
+ <div class="method_details ">
1107
+ <h3 class="signature " id="delete-instance_method">
1108
+
1109
+ - (<tt>String</tt>) <strong>delete</strong>(name)
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+ </h3><div class="docstring">
1116
+ <div class="discussion">
1117
+
1118
+ <p>Deletes a container with the given name</p>
1119
+
1120
+
1121
+ </div>
1122
+ </div>
1123
+ <div class="tags">
1124
+ <p class="tag_title">Parameters:</p>
1125
+ <ul class="param">
1126
+
1127
+ <li>
1128
+
1129
+ <span class='name'>name</span>
1130
+
1131
+
1132
+ <span class='type'>(<tt>String</tt>)</span>
1133
+
1134
+
1135
+
1136
+ &mdash;
1137
+ <div class='inline'>
1138
+ <p>The container name</p>
1139
+ </div>
1140
+
1141
+ </li>
1142
+
1143
+ </ul>
1144
+
1145
+ <p class="tag_title">Returns:</p>
1146
+ <ul class="return">
1147
+
1148
+ <li>
1149
+
1150
+
1151
+ <span class='type'>(<tt>String</tt>)</span>
1152
+
1153
+
1154
+
1155
+ &mdash;
1156
+ <div class='inline'>
1157
+ <p>CLI output</p>
1158
+ </div>
1159
+
1160
+ </li>
1161
+
1162
+ </ul>
1163
+ <p class="tag_title">Raises:</p>
1164
+ <ul class="raise">
1165
+
1166
+ <li>
1167
+
1168
+
1169
+ <span class='type'>(<tt>RuntimeError</tt>)</span>
1170
+
1171
+
1172
+
1173
+ </li>
1174
+
1175
+ <li>
1176
+
1177
+
1178
+ <span class='type'>(<tt><span class='object_link'><a href="NotFoundError.html" title="NotFoundError (class)">NotFoundError</a></span></tt>)</span>
1179
+
1180
+
1181
+
1182
+ </li>
1183
+
1184
+ </ul>
1185
+
1186
+ </div><table class="source_code">
1187
+ <tr>
1188
+ <td>
1189
+ <pre class="lines">
1190
+
1191
+
1192
+ 246
1193
+ 247
1194
+ 248
1195
+ 249
1196
+ 250
1197
+ 251
1198
+ 252</pre>
1199
+ </td>
1200
+ <td>
1201
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 246</span>
1202
+
1203
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1204
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1205
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>NotFoundError</span>
1206
+ <span class='kw'>end</span>
1207
+
1208
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1209
+ <span class='kw'>end</span></pre>
1210
+ </td>
1211
+ </tr>
1212
+ </table>
1213
+ </div>
1214
+
1215
+ <div class="method_details ">
1216
+ <h3 class="signature " id="free_cpu_core_count-instance_method">
1217
+
1218
+ - (<tt>Integer</tt>) <strong>free_cpu_core_count</strong>(resman)
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+ </h3><div class="docstring">
1225
+ <div class="discussion">
1226
+
1227
+ <p>Returns the amount of free cpu cores</p>
1228
+
1229
+
1230
+ </div>
1231
+ </div>
1232
+ <div class="tags">
1233
+ <p class="tag_title">Parameters:</p>
1234
+ <ul class="param">
1235
+
1236
+ <li>
1237
+
1238
+ <span class='name'>resman</span>
1239
+
1240
+
1241
+ <span class='type'>(<tt><span class='object_link'><a href="ResourceManager.html" title="ResourceManager (class)">ResourceManager</a></span></tt>)</span>
1242
+
1243
+
1244
+
1245
+ &mdash;
1246
+ <div class='inline'>
1247
+ <p>A ResourceManager instance</p>
1248
+ </div>
1249
+
1250
+ </li>
1251
+
1252
+ </ul>
1253
+
1254
+ <p class="tag_title">Returns:</p>
1255
+ <ul class="return">
1256
+
1257
+ <li>
1258
+
1259
+
1260
+ <span class='type'>(<tt>Integer</tt>)</span>
1261
+
1262
+
1263
+
1264
+ &mdash;
1265
+ <div class='inline'>
1266
+ <p>The amount of free cpu cores</p>
1267
+ </div>
1268
+
1269
+ </li>
1270
+
1271
+ </ul>
1272
+
1273
+ </div><table class="source_code">
1274
+ <tr>
1275
+ <td>
1276
+ <pre class="lines">
1277
+
1278
+
1279
+ 186
1280
+ 187
1281
+ 188</pre>
1282
+ </td>
1283
+ <td>
1284
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 186</span>
1285
+
1286
+ <span class='kw'>def</span> <span class='id identifier rubyid_free_cpu_core_count'>free_cpu_core_count</span><span class='lparen'>(</span><span class='id identifier rubyid_resman'>resman</span><span class='rparen'>)</span>
1287
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_free_cpu_core_count'>free_cpu_core_count</span><span class='lparen'>(</span><span class='id identifier rubyid_resman'>resman</span><span class='rparen'>)</span>
1288
+ <span class='kw'>end</span></pre>
1289
+ </td>
1290
+ </tr>
1291
+ </table>
1292
+ </div>
1293
+
1294
+ <div class="method_details ">
1295
+ <h3 class="signature " id="kill-instance_method">
1296
+
1297
+ - (<tt>String</tt>) <strong>kill</strong>(name)
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+ </h3><div class="docstring">
1304
+ <div class="discussion">
1305
+
1306
+ <p>Kills a container with the given name</p>
1307
+
1308
+
1309
+ </div>
1310
+ </div>
1311
+ <div class="tags">
1312
+ <p class="tag_title">Parameters:</p>
1313
+ <ul class="param">
1314
+
1315
+ <li>
1316
+
1317
+ <span class='name'>name</span>
1318
+
1319
+
1320
+ <span class='type'>(<tt>String</tt>)</span>
1321
+
1322
+
1323
+
1324
+ &mdash;
1325
+ <div class='inline'>
1326
+ <p>The container name</p>
1327
+ </div>
1328
+
1329
+ </li>
1330
+
1331
+ </ul>
1332
+
1333
+ <p class="tag_title">Returns:</p>
1334
+ <ul class="return">
1335
+
1336
+ <li>
1337
+
1338
+
1339
+ <span class='type'>(<tt>String</tt>)</span>
1340
+
1341
+
1342
+
1343
+ &mdash;
1344
+ <div class='inline'>
1345
+ <p>CLI output</p>
1346
+ </div>
1347
+
1348
+ </li>
1349
+
1350
+ </ul>
1351
+ <p class="tag_title">Raises:</p>
1352
+ <ul class="raise">
1353
+
1354
+ <li>
1355
+
1356
+
1357
+ <span class='type'>(<tt>RuntimeError</tt>)</span>
1358
+
1359
+
1360
+
1361
+ </li>
1362
+
1363
+ <li>
1364
+
1365
+
1366
+ <span class='type'>(<tt><span class='object_link'><a href="NotFoundError.html" title="NotFoundError (class)">NotFoundError</a></span></tt>)</span>
1367
+
1368
+
1369
+
1370
+ </li>
1371
+
1372
+ </ul>
1373
+
1374
+ </div><table class="source_code">
1375
+ <tr>
1376
+ <td>
1377
+ <pre class="lines">
1378
+
1379
+
1380
+ 230
1381
+ 231
1382
+ 232
1383
+ 233
1384
+ 234
1385
+ 235
1386
+ 236</pre>
1387
+ </td>
1388
+ <td>
1389
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 230</span>
1390
+
1391
+ <span class='kw'>def</span> <span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1392
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1393
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>NotFoundError</span>
1394
+ <span class='kw'>end</span>
1395
+
1396
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1397
+ <span class='kw'>end</span></pre>
1398
+ </td>
1399
+ </tr>
1400
+ </table>
1401
+ </div>
1402
+
1403
+ <div class="method_details ">
1404
+ <h3 class="signature " id="start-instance_method">
1405
+
1406
+ - (<tt>String</tt>) <strong>start</strong>(name)
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+ </h3><div class="docstring">
1413
+ <div class="discussion">
1414
+
1415
+ <p>Starts a container with the given name</p>
1416
+
1417
+
1418
+ </div>
1419
+ </div>
1420
+ <div class="tags">
1421
+ <p class="tag_title">Parameters:</p>
1422
+ <ul class="param">
1423
+
1424
+ <li>
1425
+
1426
+ <span class='name'>name</span>
1427
+
1428
+
1429
+ <span class='type'>(<tt>String</tt>)</span>
1430
+
1431
+
1432
+
1433
+ &mdash;
1434
+ <div class='inline'>
1435
+ <p>The container name</p>
1436
+ </div>
1437
+
1438
+ </li>
1439
+
1440
+ </ul>
1441
+
1442
+ <p class="tag_title">Returns:</p>
1443
+ <ul class="return">
1444
+
1445
+ <li>
1446
+
1447
+
1448
+ <span class='type'>(<tt>String</tt>)</span>
1449
+
1450
+
1451
+
1452
+ &mdash;
1453
+ <div class='inline'>
1454
+ <p>CLI output</p>
1455
+ </div>
1456
+
1457
+ </li>
1458
+
1459
+ </ul>
1460
+ <p class="tag_title">Raises:</p>
1461
+ <ul class="raise">
1462
+
1463
+ <li>
1464
+
1465
+
1466
+ <span class='type'>(<tt>RuntimeError</tt>)</span>
1467
+
1468
+
1469
+
1470
+ </li>
1471
+
1472
+ <li>
1473
+
1474
+
1475
+ <span class='type'>(<tt><span class='object_link'><a href="NotFoundError.html" title="NotFoundError (class)">NotFoundError</a></span></tt>)</span>
1476
+
1477
+
1478
+
1479
+ </li>
1480
+
1481
+ </ul>
1482
+
1483
+ </div><table class="source_code">
1484
+ <tr>
1485
+ <td>
1486
+ <pre class="lines">
1487
+
1488
+
1489
+ 198
1490
+ 199
1491
+ 200
1492
+ 201
1493
+ 202
1494
+ 203
1495
+ 204</pre>
1496
+ </td>
1497
+ <td>
1498
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 198</span>
1499
+
1500
+ <span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1501
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1502
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>NotFoundError</span>
1503
+ <span class='kw'>end</span>
1504
+
1505
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1506
+ <span class='kw'>end</span></pre>
1507
+ </td>
1508
+ </tr>
1509
+ </table>
1510
+ </div>
1511
+
1512
+ <div class="method_details ">
1513
+ <h3 class="signature " id="stop-instance_method">
1514
+
1515
+ - (<tt>String</tt>) <strong>stop</strong>(name)
1516
+
1517
+
1518
+
1519
+
1520
+
1521
+ </h3><div class="docstring">
1522
+ <div class="discussion">
1523
+
1524
+ <p>Stops a container with the given name</p>
1525
+
1526
+
1527
+ </div>
1528
+ </div>
1529
+ <div class="tags">
1530
+ <p class="tag_title">Parameters:</p>
1531
+ <ul class="param">
1532
+
1533
+ <li>
1534
+
1535
+ <span class='name'>name</span>
1536
+
1537
+
1538
+ <span class='type'>(<tt>String</tt>)</span>
1539
+
1540
+
1541
+
1542
+ &mdash;
1543
+ <div class='inline'>
1544
+ <p>The container name</p>
1545
+ </div>
1546
+
1547
+ </li>
1548
+
1549
+ </ul>
1550
+
1551
+ <p class="tag_title">Returns:</p>
1552
+ <ul class="return">
1553
+
1554
+ <li>
1555
+
1556
+
1557
+ <span class='type'>(<tt>String</tt>)</span>
1558
+
1559
+
1560
+
1561
+ &mdash;
1562
+ <div class='inline'>
1563
+ <p>CLI output</p>
1564
+ </div>
1565
+
1566
+ </li>
1567
+
1568
+ </ul>
1569
+ <p class="tag_title">Raises:</p>
1570
+ <ul class="raise">
1571
+
1572
+ <li>
1573
+
1574
+
1575
+ <span class='type'>(<tt>RuntimeError</tt>)</span>
1576
+
1577
+
1578
+
1579
+ </li>
1580
+
1581
+ <li>
1582
+
1583
+
1584
+ <span class='type'>(<tt><span class='object_link'><a href="NotFoundError.html" title="NotFoundError (class)">NotFoundError</a></span></tt>)</span>
1585
+
1586
+
1587
+
1588
+ </li>
1589
+
1590
+ </ul>
1591
+
1592
+ </div><table class="source_code">
1593
+ <tr>
1594
+ <td>
1595
+ <pre class="lines">
1596
+
1597
+
1598
+ 214
1599
+ 215
1600
+ 216
1601
+ 217
1602
+ 218
1603
+ 219
1604
+ 220</pre>
1605
+ </td>
1606
+ <td>
1607
+ <pre class="code"><span class="info file"># File 'lib/wf_node_api/container_manager.rb', line 214</span>
1608
+
1609
+ <span class='kw'>def</span> <span class='id identifier rubyid_stop'>stop</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1610
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1611
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>NotFoundError</span>
1612
+ <span class='kw'>end</span>
1613
+
1614
+ <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
1615
+ <span class='kw'>end</span></pre>
1616
+ </td>
1617
+ </tr>
1618
+ </table>
1619
+ </div>
1620
+
1621
+ </div>
1622
+
1623
+ </div>
1624
+
1625
+ <div id="footer">
1626
+ Generated on Mon Jul 20 18:09:05 2015 by
1627
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1628
+ 0.8.7.6 (ruby-2.0.0).
1629
+ </div>
1630
+
1631
+ </body>
1632
+ </html>