wf_node_api 0.6.0

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.
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 @@
1
+ [
2
  {
1
3
  "type": "post",
2
4
  "url": "/containers",
3
5
  "title": "Create a container",
4
6
  "version": "0.8.0",
5
7
  "name": "CreateContainer",
6
8
  "group": "Container",
7
9
  "description": "<p>Creates a container. Returns 201 on success!</p> ",
8
10
  "header": {
9
11
  "fields": {
10
12
  "Header": [
11
13
  {
12
14
  "group": "Header",
13
15
  "type": "String",
14
16
  "optional": false,
15
17
  "field": "X-Api-Token",
16
18
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
17
19
  }
18
20
  ]
19
21
  }
20
22
  },
21
23
  "parameter": {
22
24
  "fields": {
23
25
  "Parameter": [
24
26
  {
25
27
  "group": "Parameter",
26
28
  "type": "<p>String</p> ",
27
29
  "optional": false,
28
30
  "field": "name",
29
31
  "description": "<p>Name of the container (must be unique per node)</p> "
30
32
  },
31
33
  {
32
34
  "group": "Parameter",
33
35
  "type": "<p>String</p> ",
34
36
  "optional": false,
35
37
  "field": "ip_address",
36
38
  "description": "<p>Valid IPv4 address</p> "
37
39
  },
38
40
  {
39
41
  "group": "Parameter",
40
42
  "type": "<p>Integer</p> ",
41
43
  "optional": false,
42
44
  "field": "disk_size_gb",
43
45
  "description": "<p>Container disk size in GB</p> "
44
46
  },
45
47
  {
46
48
  "group": "Parameter",
47
49
  "type": "<p>Integer</p> ",
48
50
  "optional": false,
49
51
  "field": "memory_limit_mb",
50
52
  "description": "<p>Memory limt in MB</p> "
51
53
  },
52
54
  {
53
55
  "group": "Parameter",
54
56
  "type": "<p>Integer</p> ",
55
57
  "optional": false,
56
58
  "field": "cpu_core_count",
57
59
  "description": "<p>Amount of Vcores assigned to the container</p> "
58
60
  }
59
61
  ]
60
62
  }
61
63
  },
62
64
  "success": {
63
65
  "fields": {
64
66
  "Success 200": [
65
67
  {
66
68
  "group": "Success 200",
67
69
  "type": "<p>String</p> ",
68
70
  "optional": false,
69
71
  "field": "success",
70
72
  "description": "<p>Success message</p> "
71
73
  },
72
74
  {
73
75
  "group": "Success 200",
74
76
  "type": "<p>String</p> ",
75
77
  "optional": false,
76
78
  "field": "output",
77
79
  "description": "<p>STDOUT from container creation</p> "
78
80
  }
79
81
  ]
80
82
  }
81
83
  },
82
84
  "filename": "lib/wf_node_api/api/node_api.rb",
83
85
  "groupTitle": "Container",
84
86
  "error": {
85
87
  "fields": {
86
88
  "Unauthorized 401": [
87
89
  {
88
90
  "group": "Unauthorized 401",
89
91
  "optional": false,
90
92
  "field": "error",
91
93
  "description": "<p>No valid API token was supplied</p> "
92
94
  }
93
95
  ],
94
96
  "Bad Request 400": [
95
97
  {
96
98
  "group": "Bad Request 400",
97
99
  "optional": false,
98
100
  "field": "error",
99
101
  "description": "<p>Invalid arguments supplied</p> "
100
102
  }
101
103
  ],
102
104
  "Internal Server Error 500": [
103
105
  {
104
106
  "group": "Internal Server Error 500",
105
107
  "optional": false,
106
108
  "field": "error",
107
109
  "description": "<p>The process could not be requested due to an internal error</p> "
108
110
  }
109
111
  ]
110
112
  },
111
113
  "examples": [
112
114
  {
113
115
  "title": "401 Unauthorized",
114
116
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
115
117
  "type": "json"
116
118
  },
117
119
  {
118
120
  "title": "400 Bad Request",
119
121
  "content": "HTTP/1.1 400 Bad Request\n{\n \"error\": \"The supplied container name is invalid\"\n}",
120
122
  "type": "json"
121
123
  },
122
124
  {
123
125
  "title": "500 Internal Server Error",
124
126
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
125
127
  "type": "json"
126
128
  }
127
129
  ]
128
130
  }
129
131
  },
130
132
  {
131
133
  "type": "delete",
132
134
  "url": "/containers/:name",
133
135
  "title": "Delete a container",
134
136
  "version": "0.8.0",
135
137
  "name": "DeleteContainer",
136
138
  "group": "Container",
137
139
  "description": "<p>Deletes a container if it exists.</p> ",
138
140
  "header": {
139
141
  "fields": {
140
142
  "Header": [
141
143
  {
142
144
  "group": "Header",
143
145
  "type": "String",
144
146
  "optional": false,
145
147
  "field": "X-Api-Token",
146
148
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
147
149
  }
148
150
  ]
149
151
  }
150
152
  },
151
153
  "parameter": {
152
154
  "fields": {
153
155
  "Parameter": [
154
156
  {
155
157
  "group": "Parameter",
156
158
  "type": "<p>String</p> ",
157
159
  "optional": false,
158
160
  "field": "name",
159
161
  "description": "<p>Unique name of the container</p> "
160
162
  }
161
163
  ]
162
164
  }
163
165
  },
164
166
  "success": {
165
167
  "fields": {
166
168
  "Success 200": [
167
169
  {
168
170
  "group": "Success 200",
169
171
  "type": "<p>String</p> ",
170
172
  "optional": false,
171
173
  "field": "success",
172
174
  "description": "<p>Success message</p> "
173
175
  },
174
176
  {
175
177
  "group": "Success 200",
176
178
  "type": "<p>String</p> ",
177
179
  "optional": false,
178
180
  "field": "output",
179
181
  "description": "<p>STDOUT from container deletion</p> "
180
182
  }
181
183
  ]
182
184
  }
183
185
  },
184
186
  "filename": "lib/wf_node_api/api/node_api.rb",
185
187
  "groupTitle": "Container",
186
188
  "error": {
187
189
  "fields": {
188
190
  "Unauthorized 401": [
189
191
  {
190
192
  "group": "Unauthorized 401",
191
193
  "optional": false,
192
194
  "field": "error",
193
195
  "description": "<p>No valid API token was supplied</p> "
194
196
  }
195
197
  ],
196
198
  "Not Found 404": [
197
199
  {
198
200
  "group": "Not Found 404",
199
201
  "optional": false,
200
202
  "field": "error",
201
203
  "description": "<p>Object was not found</p> "
202
204
  }
203
205
  ],
204
206
  "Internal Server Error 500": [
205
207
  {
206
208
  "group": "Internal Server Error 500",
207
209
  "optional": false,
208
210
  "field": "error",
209
211
  "description": "<p>The process could not be requested due to an internal error</p> "
210
212
  }
211
213
  ]
212
214
  },
213
215
  "examples": [
214
216
  {
215
217
  "title": "401 Unauthorized",
216
218
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
217
219
  "type": "json"
218
220
  },
219
221
  {
220
222
  "title": "404 Not Found",
221
223
  "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}",
222
224
  "type": "json"
223
225
  },
224
226
  {
225
227
  "title": "500 Internal Server Error",
226
228
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
227
229
  "type": "json"
228
230
  }
229
231
  ]
230
232
  }
231
233
  },
232
234
  {
233
235
  "type": "get",
234
236
  "url": "/containers/:name",
235
237
  "title": "Request container by its name",
236
238
  "version": "0.8.0",
237
239
  "name": "GetContainer",
238
240
  "group": "Container",
239
241
  "description": "<p>Returns information on a specific container</p> ",
240
242
  "header": {
241
243
  "fields": {
242
244
  "Header": [
243
245
  {
244
246
  "group": "Header",
245
247
  "type": "String",
246
248
  "optional": false,
247
249
  "field": "X-Api-Token",
248
250
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
249
251
  }
250
252
  ]
251
253
  }
252
254
  },
253
255
  "parameter": {
254
256
  "fields": {
255
257
  "Parameter": [
256
258
  {
257
259
  "group": "Parameter",
258
260
  "type": "<p>String</p> ",
259
261
  "optional": false,
260
262
  "field": "name",
261
263
  "description": "<p>Unique name of the container</p> "
262
264
  }
263
265
  ]
264
266
  }
265
267
  },
266
268
  "success": {
267
269
  "fields": {
268
270
  "Success 200": [
269
271
  {
270
272
  "group": "Success 200",
271
273
  "type": "<p>String</p> ",
272
274
  "optional": false,
273
275
  "field": "name",
274
276
  "description": "<p>Name of the container</p> "
275
277
  },
276
278
  {
277
279
  "group": "Success 200",
278
280
  "type": "<p>String</p> ",
279
281
  "optional": false,
280
282
  "field": "state",
281
283
  "description": "<p>State of the container (either 'RUNNING' or 'STOPPED')</p> "
282
284
  },
283
285
  {
284
286
  "group": "Success 200",
285
287
  "type": "<p>String</p> ",
286
288
  "optional": false,
287
289
  "field": "ip_address",
288
290
  "description": "<p>IP address assigned to the container</p> "
289
291
  },
290
292
  {
291
293
  "group": "Success 200",
292
294
  "type": "<p>Integer</p> ",
293
295
  "optional": false,
294
296
  "field": "cpu_cores",
295
297
  "description": "<p>Number of Vcores</p> "
296
298
  },
297
299
  {
298
300
  "group": "Success 200",
299
301
  "type": "<p>Integer</p> ",
300
302
  "optional": false,
301
303
  "field": "memory_limit_bytes",
302
304
  "description": "<p>Memory limit in bytes</p> "
303
305
  },
304
306
  {
305
307
  "group": "Success 200",
306
308
  "type": "<p>Integer</p> ",
307
309
  "optional": false,
308
310
  "field": "memory_usage_bytes",
309
311
  "description": "<p>Current amount of memory usage in bytes</p> "
310
312
  },
311
313
  {
312
314
  "group": "Success 200",
313
315
  "type": "<p>Integer</p> ",
314
316
  "optional": false,
315
317
  "field": "disk_space_gb",
316
318
  "description": "<p>Available disk space in GB</p> "
317
319
  },
318
320
  {
319
321
  "group": "Success 200",
320
322
  "type": "<p>Integer</p> ",
321
323
  "optional": false,
322
324
  "field": "disk_usage_gb",
323
325
  "description": "<p>Current amount of disk usage in GB</p> "
324
326
  },
325
327
  {
326
328
  "group": "Success 200",
327
329
  "type": "<p>String</p> ",
328
330
  "optional": false,
329
331
  "field": "container_type",
330
332
  "description": "<p>Container type, could be either 'lxc' or 'vserver'</p> "
331
333
  }
332
334
  ]
333
335
  }
334
336
  },
335
337
  "filename": "lib/wf_node_api/api/node_api.rb",
336
338
  "groupTitle": "Container",
337
339
  "error": {
338
340
  "fields": {
339
341
  "Unauthorized 401": [
340
342
  {
341
343
  "group": "Unauthorized 401",
342
344
  "optional": false,
343
345
  "field": "error",
344
346
  "description": "<p>No valid API token was supplied</p> "
345
347
  }
346
348
  ],
347
349
  "Internal Server Error 500": [
348
350
  {
349
351
  "group": "Internal Server Error 500",
350
352
  "optional": false,
351
353
  "field": "error",
352
354
  "description": "<p>The process could not be requested due to an internal error</p> "
353
355
  }
354
356
  ],
355
357
  "Not Found 404": [
356
358
  {
357
359
  "group": "Not Found 404",
358
360
  "optional": false,
359
361
  "field": "error",
360
362
  "description": "<p>Object was not found</p> "
361
363
  }
362
364
  ]
363
365
  },
364
366
  "examples": [
365
367
  {
366
368
  "title": "401 Unauthorized",
367
369
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
368
370
  "type": "json"
369
371
  },
370
372
  {
371
373
  "title": "500 Internal Server Error",
372
374
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
373
375
  "type": "json"
374
376
  },
375
377
  {
376
378
  "title": "404 Not Found",
377
379
  "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}",
378
380
  "type": "json"
379
381
  }
380
382
  ]
381
383
  }
382
384
  },
383
385
  {
384
386
  "type": "get",
385
387
  "url": "/containers",
386
388
  "title": "Request container list",
387
389
  "version": "0.8.0",
388
390
  "name": "GetContainers",
389
391
  "group": "Container",
390
392
  "description": "<p>Returns an array of containers which are available on the node.</p> ",
391
393
  "header": {
392
394
  "fields": {
393
395
  "Header": [
394
396
  {
395
397
  "group": "Header",
396
398
  "type": "String",
397
399
  "optional": false,
398
400
  "field": "X-Api-Token",
399
401
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
400
402
  }
401
403
  ]
402
404
  }
403
405
  },
404
406
  "success": {
405
407
  "fields": {
406
408
  "Success 200": [
407
409
  {
408
410
  "group": "Success 200",
409
411
  "type": "<p>Object[]</p> ",
410
412
  "optional": false,
411
413
  "field": "containers",
412
414
  "description": "<p>List of available containers</p> "
413
415
  },
414
416
  {
415
417
  "group": "Success 200",
416
418
  "type": "<p>String</p> ",
417
419
  "optional": false,
418
420
  "field": "containers.name",
419
421
  "description": "<p>Name of the container</p> "
420
422
  },
421
423
  {
422
424
  "group": "Success 200",
423
425
  "type": "<p>String</p> ",
424
426
  "optional": false,
425
427
  "field": "containers.state",
426
428
  "description": "<p>State of the container (either 'RUNNING' or 'STOPPED')</p> "
427
429
  },
428
430
  {
429
431
  "group": "Success 200",
430
432
  "type": "<p>String</p> ",
431
433
  "optional": false,
432
434
  "field": "containers.ip_address",
433
435
  "description": "<p>IP address assigned to the container</p> "
434
436
  },
435
437
  {
436
438
  "group": "Success 200",
437
439
  "type": "<p>Integer</p> ",
438
440
  "optional": false,
439
441
  "field": "containers.cpu_cores",
440
442
  "description": "<p>Number of Vcores</p> "
441
443
  },
442
444
  {
443
445
  "group": "Success 200",
444
446
  "type": "<p>Integer</p> ",
445
447
  "optional": false,
446
448
  "field": "containers.memory_limit_bytes",
447
449
  "description": "<p>Memory limit in bytes</p> "
448
450
  },
449
451
  {
450
452
  "group": "Success 200",
451
453
  "type": "<p>Integer</p> ",
452
454
  "optional": false,
453
455
  "field": "containers.memory_usage_bytes",
454
456
  "description": "<p>Current amount of memory usage in bytes</p> "
455
457
  },
456
458
  {
457
459
  "group": "Success 200",
458
460
  "type": "<p>Integer</p> ",
459
461
  "optional": false,
460
462
  "field": "containers.disk_space_gb",
461
463
  "description": "<p>Available disk space in GB</p> "
462
464
  },
463
465
  {
464
466
  "group": "Success 200",
465
467
  "type": "<p>Integer</p> ",
466
468
  "optional": false,
467
469
  "field": "containers.disk_usage_gb",
468
470
  "description": "<p>Current amount of disk usage in GB</p> "
469
471
  },
470
472
  {
471
473
  "group": "Success 200",
472
474
  "type": "<p>String</p> ",
473
475
  "optional": false,
474
476
  "field": "containers.container_type",
475
477
  "description": "<p>Container type, could be either 'lxc' or 'vserver'</p> "
476
478
  }
477
479
  ]
478
480
  }
479
481
  },
480
482
  "filename": "lib/wf_node_api/api/node_api.rb",
481
483
  "groupTitle": "Container",
482
484
  "error": {
483
485
  "fields": {
484
486
  "Unauthorized 401": [
485
487
  {
486
488
  "group": "Unauthorized 401",
487
489
  "optional": false,
488
490
  "field": "error",
489
491
  "description": "<p>No valid API token was supplied</p> "
490
492
  }
491
493
  ],
492
494
  "Internal Server Error 500": [
493
495
  {
494
496
  "group": "Internal Server Error 500",
495
497
  "optional": false,
496
498
  "field": "error",
497
499
  "description": "<p>The process could not be requested due to an internal error</p> "
498
500
  }
499
501
  ]
500
502
  },
501
503
  "examples": [
502
504
  {
503
505
  "title": "401 Unauthorized",
504
506
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
505
507
  "type": "json"
506
508
  },
507
509
  {
508
510
  "title": "500 Internal Server Error",
509
511
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
510
512
  "type": "json"
511
513
  }
512
514
  ]
513
515
  }
514
516
  },
515
517
  {
516
518
  "type": "put",
517
519
  "url": "/containers/:name/kill",
518
520
  "title": "Kill a container",
519
521
  "version": "0.8.0",
520
522
  "name": "KillContainer",
521
523
  "group": "Container",
522
524
  "description": "<p>Kills a container if it exists. Does essentially the same as StopContainer but forces the container to shut down and does not care about processes running on it.</p> ",
523
525
  "header": {
524
526
  "fields": {
525
527
  "Header": [
526
528
  {
527
529
  "group": "Header",
528
530
  "type": "String",
529
531
  "optional": false,
530
532
  "field": "X-Api-Token",
531
533
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
532
534
  }
533
535
  ]
534
536
  }
535
537
  },
536
538
  "parameter": {
537
539
  "fields": {
538
540
  "Parameter": [
539
541
  {
540
542
  "group": "Parameter",
541
543
  "type": "<p>String</p> ",
542
544
  "optional": false,
543
545
  "field": "name",
544
546
  "description": "<p>Unique name of the container</p> "
545
547
  }
546
548
  ]
547
549
  }
548
550
  },
549
551
  "success": {
550
552
  "fields": {
551
553
  "Success 200": [
552
554
  {
553
555
  "group": "Success 200",
554
556
  "type": "<p>String</p> ",
555
557
  "optional": false,
556
558
  "field": "success",
557
559
  "description": "<p>Success message</p> "
558
560
  },
559
561
  {
560
562
  "group": "Success 200",
561
563
  "type": "<p>String</p> ",
562
564
  "optional": false,
563
565
  "field": "output",
564
566
  "description": "<p>STDOUT from container kill</p> "
565
567
  }
566
568
  ]
567
569
  }
568
570
  },
569
571
  "filename": "lib/wf_node_api/api/node_api.rb",
570
572
  "groupTitle": "Container",
571
573
  "error": {
572
574
  "fields": {
573
575
  "Unauthorized 401": [
574
576
  {
575
577
  "group": "Unauthorized 401",
576
578
  "optional": false,
577
579
  "field": "error",
578
580
  "description": "<p>No valid API token was supplied</p> "
579
581
  }
580
582
  ],
581
583
  "Not Found 404": [
582
584
  {
583
585
  "group": "Not Found 404",
584
586
  "optional": false,
585
587
  "field": "error",
586
588
  "description": "<p>Object was not found</p> "
587
589
  }
588
590
  ],
589
591
  "Internal Server Error 500": [
590
592
  {
591
593
  "group": "Internal Server Error 500",
592
594
  "optional": false,
593
595
  "field": "error",
594
596
  "description": "<p>The process could not be requested due to an internal error</p> "
595
597
  }
596
598
  ]
597
599
  },
598
600
  "examples": [
599
601
  {
600
602
  "title": "401 Unauthorized",
601
603
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
602
604
  "type": "json"
603
605
  },
604
606
  {
605
607
  "title": "404 Not Found",
606
608
  "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}",
607
609
  "type": "json"
608
610
  },
609
611
  {
610
612
  "title": "500 Internal Server Error",
611
613
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
612
614
  "type": "json"
613
615
  }
614
616
  ]
615
617
  }
616
618
  },
617
619
  {
618
620
  "type": "put",
619
621
  "url": "/containers/:name/start",
620
622
  "title": "Start a container",
621
623
  "version": "0.8.0",
622
624
  "name": "StartContainer",
623
625
  "group": "Container",
624
626
  "description": "<p>Starts a container if it exists</p> ",
625
627
  "header": {
626
628
  "fields": {
627
629
  "Header": [
628
630
  {
629
631
  "group": "Header",
630
632
  "type": "String",
631
633
  "optional": false,
632
634
  "field": "X-Api-Token",
633
635
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
634
636
  }
635
637
  ]
636
638
  }
637
639
  },
638
640
  "parameter": {
639
641
  "fields": {
640
642
  "Parameter": [
641
643
  {
642
644
  "group": "Parameter",
643
645
  "type": "<p>String</p> ",
644
646
  "optional": false,
645
647
  "field": "name",
646
648
  "description": "<p>Unique name of the container</p> "
647
649
  }
648
650
  ]
649
651
  }
650
652
  },
651
653
  "success": {
652
654
  "fields": {
653
655
  "Success 200": [
654
656
  {
655
657
  "group": "Success 200",
656
658
  "type": "<p>String</p> ",
657
659
  "optional": false,
658
660
  "field": "success",
659
661
  "description": "<p>Success message</p> "
660
662
  },
661
663
  {
662
664
  "group": "Success 200",
663
665
  "type": "<p>String</p> ",
664
666
  "optional": false,
665
667
  "field": "output",
666
668
  "description": "<p>STDOUT from container start</p> "
667
669
  }
668
670
  ]
669
671
  }
670
672
  },
671
673
  "filename": "lib/wf_node_api/api/node_api.rb",
672
674
  "groupTitle": "Container",
673
675
  "error": {
674
676
  "fields": {
675
677
  "Unauthorized 401": [
676
678
  {
677
679
  "group": "Unauthorized 401",
678
680
  "optional": false,
679
681
  "field": "error",
680
682
  "description": "<p>No valid API token was supplied</p> "
681
683
  }
682
684
  ],
683
685
  "Not Found 404": [
684
686
  {
685
687
  "group": "Not Found 404",
686
688
  "optional": false,
687
689
  "field": "error",
688
690
  "description": "<p>Object was not found</p> "
689
691
  }
690
692
  ],
691
693
  "Internal Server Error 500": [
692
694
  {
693
695
  "group": "Internal Server Error 500",
694
696
  "optional": false,
695
697
  "field": "error",
696
698
  "description": "<p>The process could not be requested due to an internal error</p> "
697
699
  }
698
700
  ]
699
701
  },
700
702
  "examples": [
701
703
  {
702
704
  "title": "401 Unauthorized",
703
705
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
704
706
  "type": "json"
705
707
  },
706
708
  {
707
709
  "title": "404 Not Found",
708
710
  "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}",
709
711
  "type": "json"
710
712
  },
711
713
  {
712
714
  "title": "500 Internal Server Error",
713
715
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
714
716
  "type": "json"
715
717
  }
716
718
  ]
717
719
  }
718
720
  },
719
721
  {
720
722
  "type": "put",
721
723
  "url": "/containers/:name/stop",
722
724
  "title": "Stop a container",
723
725
  "version": "0.8.0",
724
726
  "name": "StopContainer",
725
727
  "group": "Container",
726
728
  "description": "<p>Stops a container if it exists</p> ",
727
729
  "header": {
728
730
  "fields": {
729
731
  "Header": [
730
732
  {
731
733
  "group": "Header",
732
734
  "type": "String",
733
735
  "optional": false,
734
736
  "field": "X-Api-Token",
735
737
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
736
738
  }
737
739
  ]
738
740
  }
739
741
  },
740
742
  "parameter": {
741
743
  "fields": {
742
744
  "Parameter": [
743
745
  {
744
746
  "group": "Parameter",
745
747
  "type": "<p>String</p> ",
746
748
  "optional": false,
747
749
  "field": "name",
748
750
  "description": "<p>Unique name of the container</p> "
749
751
  }
750
752
  ]
751
753
  }
752
754
  },
753
755
  "success": {
754
756
  "fields": {
755
757
  "Success 200": [
756
758
  {
757
759
  "group": "Success 200",
758
760
  "type": "<p>String</p> ",
759
761
  "optional": false,
760
762
  "field": "success",
761
763
  "description": "<p>Success message</p> "
762
764
  },
763
765
  {
764
766
  "group": "Success 200",
765
767
  "type": "<p>String</p> ",
766
768
  "optional": false,
767
769
  "field": "output",
768
770
  "description": "<p>STDOUT from container stop</p> "
769
771
  }
770
772
  ]
771
773
  }
772
774
  },
773
775
  "filename": "lib/wf_node_api/api/node_api.rb",
774
776
  "groupTitle": "Container",
775
777
  "error": {
776
778
  "fields": {
777
779
  "Unauthorized 401": [
778
780
  {
779
781
  "group": "Unauthorized 401",
780
782
  "optional": false,
781
783
  "field": "error",
782
784
  "description": "<p>No valid API token was supplied</p> "
783
785
  }
784
786
  ],
785
787
  "Not Found 404": [
786
788
  {
787
789
  "group": "Not Found 404",
788
790
  "optional": false,
789
791
  "field": "error",
790
792
  "description": "<p>Object was not found</p> "
791
793
  }
792
794
  ],
793
795
  "Internal Server Error 500": [
794
796
  {
795
797
  "group": "Internal Server Error 500",
796
798
  "optional": false,
797
799
  "field": "error",
798
800
  "description": "<p>The process could not be requested due to an internal error</p> "
799
801
  }
800
802
  ]
801
803
  },
802
804
  "examples": [
803
805
  {
804
806
  "title": "401 Unauthorized",
805
807
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
806
808
  "type": "json"
807
809
  },
808
810
  {
809
811
  "title": "404 Not Found",
810
812
  "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}",
811
813
  "type": "json"
812
814
  },
813
815
  {
814
816
  "title": "500 Internal Server Error",
815
817
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
816
818
  "type": "json"
817
819
  }
818
820
  ]
819
821
  }
820
822
  },
821
823
  {
822
824
  "type": "get",
823
825
  "url": "/info",
824
826
  "title": "Request node information",
825
827
  "version": "0.8.0",
826
828
  "name": "NodeInfo",
827
829
  "group": "Node",
828
830
  "description": "<p>Returns an array containing useful information about the node itself and the resources available on it.</p> ",
829
831
  "header": {
830
832
  "fields": {
831
833
  "Header": [
832
834
  {
833
835
  "group": "Header",
834
836
  "type": "String",
835
837
  "optional": false,
836
838
  "field": "X-Api-Token",
837
839
  "description": "<p>API token (from /etc/wf_node_api.conf)</p> "
838
840
  }
839
841
  ]
840
842
  }
841
843
  },
842
844
  "success": {
843
845
  "fields": {
844
846
  "Success 200": [
845
847
  {
846
848
  "group": "Success 200",
847
849
  "type": "<p>String</p> ",
848
850
  "optional": false,
849
851
  "field": "container_type",
850
852
  "description": "<p>The configured container type (lxc or vserver)</p> "
851
853
  },
852
854
  {
853
855
  "group": "Success 200",
854
856
  "type": "<p>String</p> ",
855
857
  "optional": false,
856
858
  "field": "hostname",
857
859
  "description": "<p>The hostname of the system</p> "
858
860
  },
859
861
  {
860
862
  "group": "Success 200",
861
863
  "type": "<p>String</p> ",
862
864
  "optional": false,
863
865
  "field": "api_version",
864
866
  "description": "<p>The version number of the node api</p> "
865
867
  },
866
868
  {
867
869
  "group": "Success 200",
868
870
  "type": "<p>Integer</p> ",
869
871
  "optional": false,
870
872
  "field": "total_cpu_cores",
871
873
  "description": "<p>The number of cpu cores available totally</p> "
872
874
  },
873
875
  {
874
876
  "group": "Success 200",
875
877
  "type": "<p>Integer</p> ",
876
878
  "optional": false,
877
879
  "field": "free_cpu_cores",
878
880
  "description": "<p>The number of free cpu cores</p> "
879
881
  }
880
882
  ]
881
883
  }
882
884
  },
883
885
  "filename": "lib/wf_node_api/api/node_api.rb",
884
886
  "groupTitle": "Node",
885
887
  "error": {
886
888
  "fields": {
887
889
  "Unauthorized 401": [
888
890
  {
889
891
  "group": "Unauthorized 401",
890
892
  "optional": false,
891
893
  "field": "error",
892
894
  "description": "<p>No valid API token was supplied</p> "
893
895
  }
894
896
  ],
895
897
  "Internal Server Error 500": [
896
898
  {
897
899
  "group": "Internal Server Error 500",
898
900
  "optional": false,
899
901
  "field": "error",
900
902
  "description": "<p>The process could not be requested due to an internal error</p> "
901
903
  }
902
904
  ]
903
905
  },
904
906
  "examples": [
905
907
  {
906
908
  "title": "401 Unauthorized",
907
909
  "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}",
908
910
  "type": "json"
909
911
  },
910
912
  {
911
913
  "title": "500 Internal Server Error",
912
914
  "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}",
913
915
  "type": "json"
914
916
  }
915
917
  ]
916
918
  }
917
919
  }