wf_node_api 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +22 -18
  3. data/Gemfile.lock +3 -3
  4. data/LICENSE +19 -340
  5. data/Vagrantfile +28 -23
  6. data/_docs/api/Api.html +22 -18
  7. data/_docs/api/Api/NodeApi.html +1 -1
  8. data/_docs/api/ConfigCheck.html +34 -30
  9. data/_docs/api/ContainerManager.html +176 -77
  10. data/_docs/api/ContainerManagerAdapter.html +22 -18
  11. data/_docs/api/ContainerManagerAdapter/Lxc.html +169 -58
  12. data/_docs/api/ContainerManagerAdapter/Vserver.html +169 -58
  13. data/_docs/api/NotFoundError.html +22 -18
  14. data/_docs/api/OS.html +26 -22
  15. data/_docs/api/ResourceManager.html +11 -11
  16. data/_docs/api/ResourceManagerAdapter.html +22 -18
  17. data/_docs/api/ResourceManagerAdapter/Linux.html +13 -13
  18. data/_docs/api/WfNodeApi.html +23 -19
  19. data/_docs/api/_index.html +1 -1
  20. data/_docs/api/file.README.html +96 -66
  21. data/_docs/api/index.html +96 -66
  22. data/_docs/api/method_list.html +60 -42
  23. data/_docs/api/top-level-namespace.html +7 -7
  24. data/_docs/rest/api_data.js +934 -1
  25. data/_docs/rest/api_data.json +934 -1
  26. data/_docs/rest/api_project.js +31 -1
  27. data/_docs/rest/api_project.json +31 -1
  28. data/bin/wf_node_api +25 -21
  29. data/lib/wf_node_api.rb +25 -21
  30. data/lib/wf_node_api/api/node_api.rb +36 -27
  31. data/lib/wf_node_api/config/config_template.erb +36 -4
  32. data/lib/wf_node_api/config_check.rb +25 -21
  33. data/lib/wf_node_api/container_manager.rb +34 -22
  34. data/lib/wf_node_api/container_manager_adapter/lxc.rb +43 -25
  35. data/lib/wf_node_api/container_manager_adapter/vserver.rb +45 -27
  36. data/lib/wf_node_api/error/not_found.rb +22 -18
  37. data/lib/wf_node_api/os.rb +22 -18
  38. data/lib/wf_node_api/resource_manager.rb +24 -20
  39. data/lib/wf_node_api/resource_manager_adapter/linux.rb +25 -21
  40. data/lib/wf_node_api/translations.rb +22 -18
  41. data/lib/wf_node_api/version.rb +22 -18
  42. data/wf-node-api.gemspec +26 -22
  43. metadata +4 -3
@@ -1 +1,31 @@
1
- define({
2
1
  "name": "WhiteFuse Node API",
3
2
  "version": "0.8.0",
4
3
  "description": "Virtualization node RESTful API documentation",
5
4
  "url": "https://mynode.local:1357/v1",
6
5
  "header": {
7
6
  "content": "<p>All requests are processed synchronously. This means that the connection does not return a result as long\nas the cli process is running. Requests are limited to a runtime of 600 seconds, otherwise the web server\nwill kill the request. It should never be the case that a operation even comes close to this runtime.</p>\n"
8
7
  },
9
8
  "order": [
10
9
  "GetContainers",
11
10
  "GetContainer",
12
11
  "CreateContainer",
13
12
  "DeleteContainer",
14
13
  "StartContainer",
15
14
  "StopContainer",
16
15
  "KillContainer",
17
16
  "NodeInfo"
18
17
  ],
19
18
  "template": {
20
19
  "withCompare": true,
21
20
  "withGenerator": true
22
21
  },
23
22
  "sampleUrl": false,
24
23
  "apidoc": "0.2.0",
25
24
  "generator": {
26
25
  "name": "apidoc",
27
26
  "time": "2015-07-20T16:09:01.163Z",
28
27
  "url": "http://apidocjs.com",
29
28
  "version": "0.13.1"
30
29
  }
30
+ define({
31
+ "name": "WhiteFuse Node API",
32
+ "version": "0.8.0",
33
+ "description": "Virtualization node RESTful API documentation",
34
+ "url": "https://mynode.local:1357/v1",
35
+ "header": {
36
+ "content": "<p>All requests are processed synchronously. This means that the connection does not return a result as long\nas the cli process is running. Requests are limited to a runtime of 600 seconds, otherwise the web server\nwill kill the request. It should never be the case that a operation even comes close to this runtime.</p>\n"
37
+ },
38
+ "order": [
39
+ "GetContainers",
40
+ "GetContainer",
41
+ "CreateContainer",
42
+ "DeleteContainer",
43
+ "StartContainer",
44
+ "StopContainer",
45
+ "KillContainer",
46
+ "NodeInfo"
47
+ ],
48
+ "template": {
49
+ "withCompare": true,
50
+ "withGenerator": true
51
+ },
52
+ "sampleUrl": false,
53
+ "apidoc": "0.2.0",
54
+ "generator": {
55
+ "name": "apidoc",
56
+ "time": "2015-10-25T20:54:46.061Z",
57
+ "url": "http://apidocjs.com",
58
+ "version": "0.13.1"
59
+ }
60
+ });
@@ -1 +1,31 @@
1
- {
2
1
  "name": "WhiteFuse Node API",
3
2
  "version": "0.8.0",
4
3
  "description": "Virtualization node RESTful API documentation",
5
4
  "url": "https://mynode.local:1357/v1",
6
5
  "header": {
7
6
  "content": "<p>All requests are processed synchronously. This means that the connection does not return a result as long\nas the cli process is running. Requests are limited to a runtime of 600 seconds, otherwise the web server\nwill kill the request. It should never be the case that a operation even comes close to this runtime.</p>\n"
8
7
  },
9
8
  "order": [
10
9
  "GetContainers",
11
10
  "GetContainer",
12
11
  "CreateContainer",
13
12
  "DeleteContainer",
14
13
  "StartContainer",
15
14
  "StopContainer",
16
15
  "KillContainer",
17
16
  "NodeInfo"
18
17
  ],
19
18
  "template": {
20
19
  "withCompare": true,
21
20
  "withGenerator": true
22
21
  },
23
22
  "sampleUrl": false,
24
23
  "apidoc": "0.2.0",
25
24
  "generator": {
26
25
  "name": "apidoc",
27
26
  "time": "2015-07-20T16:09:01.163Z",
28
27
  "url": "http://apidocjs.com",
29
28
  "version": "0.13.1"
30
29
  }
30
+ {
31
+ "name": "WhiteFuse Node API",
32
+ "version": "0.8.0",
33
+ "description": "Virtualization node RESTful API documentation",
34
+ "url": "https://mynode.local:1357/v1",
35
+ "header": {
36
+ "content": "<p>All requests are processed synchronously. This means that the connection does not return a result as long\nas the cli process is running. Requests are limited to a runtime of 600 seconds, otherwise the web server\nwill kill the request. It should never be the case that a operation even comes close to this runtime.</p>\n"
37
+ },
38
+ "order": [
39
+ "GetContainers",
40
+ "GetContainer",
41
+ "CreateContainer",
42
+ "DeleteContainer",
43
+ "StartContainer",
44
+ "StopContainer",
45
+ "KillContainer",
46
+ "NodeInfo"
47
+ ],
48
+ "template": {
49
+ "withCompare": true,
50
+ "withGenerator": true
51
+ },
52
+ "sampleUrl": false,
53
+ "apidoc": "0.2.0",
54
+ "generator": {
55
+ "name": "apidoc",
56
+ "time": "2015-10-25T20:54:46.061Z",
57
+ "url": "http://apidocjs.com",
58
+ "version": "0.13.1"
59
+ }
60
+ }
data/bin/wf_node_api CHANGED
@@ -1,27 +1,31 @@
1
1
  #!/usr/bin/ruby
2
2
  =begin
3
- __ ___ _ _ _____ ____ __ __
4
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
5
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
6
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
7
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
3
+ __ ___ _ _ _____ ____ __ __
4
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
5
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
6
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
7
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
8
8
  Container Manager
9
9
 
10
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
11
-
12
- This program is free software; you can redistribute it and/or
13
- modify it under the terms of the GNU General Public License
14
- as published by the Free Software Foundation; either version 2
15
- of the License, or (at your option) any later version.
16
-
17
- This program is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
21
-
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
10
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
13
+ this software and associated documentation files (the "Software"), to deal in
14
+ the Software without restriction, including without limitation the rights to
15
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
16
+ of the Software, and to permit persons to whom the Software is furnished to do
17
+ so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
25
29
  =end
26
30
 
27
31
  THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
@@ -77,4 +81,4 @@ if ARGV.empty?
77
81
  exit 0
78
82
  else
79
83
  Daemons.run(__FILE__)
80
- end
84
+ end
data/lib/wf_node_api.rb CHANGED
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  require 'webrick'
@@ -54,4 +58,4 @@ require 'wf_node_api/api/node_api.rb'
54
58
  module WfNodeApi
55
59
  LIBNAME = 'wf_node_api'
56
60
  LIBDIR = File.expand_path("../#{LIBNAME}", __FILE__)
57
- end
61
+ end
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  module Api
@@ -87,7 +91,7 @@ module Api
87
91
 
88
92
  =begin
89
93
  @api {get} /info Request node information
90
- @apiVersion 1.0.0
94
+ @apiVersion 1.1.0
91
95
  @apiName NodeInfo
92
96
  @apiGroup Node
93
97
 
@@ -96,11 +100,12 @@ module Api
96
100
 
97
101
  @apiHeader {String} X-Api-Token API token (from /etc/wf_node_api.conf)
98
102
 
99
- @apiSuccess {String} container_type The configured container type (lxc or vserver)
100
- @apiSuccess {String} hostname The hostname of the system
101
- @apiSuccess {String} api_version The version number of the node api
102
- @apiSuccess {Integer} total_cpu_cores The number of cpu cores available totally
103
- @apiSuccess {Integer} free_cpu_cores The number of free cpu cores
103
+ @apiSuccess {String} container_type The configured container type (lxc or vserver)
104
+ @apiSuccess {String} hostname The hostname of the system
105
+ @apiSuccess {String} api_version The version number of the node api
106
+ @apiSuccess {Integer} total_cpu_cores The number of cpu cores available totally
107
+ @apiSuccess {Integer} free_cpu_cores The number of free cpu cores
108
+ @apiSuccess {Array} supported_templates A list of supported templates
104
109
 
105
110
  @apiUse UnauthorizedError
106
111
 
@@ -114,6 +119,7 @@ module Api
114
119
  info['api_version'] = WfNodeApi::VERSION
115
120
  info['total_cpu_cores'] = @resman.total_cpu_cores
116
121
  info['free_cpu_cores'] = @man.free_cpu_core_count(@resman)
122
+ info['supported_templates'] = @man.supported_templates
117
123
 
118
124
  info
119
125
  end
@@ -163,6 +169,7 @@ module Api
163
169
  @apiParam {Integer} disk_size_gb Container disk size in GB
164
170
  @apiParam {Integer} memory_limit_mb Memory limt in MB
165
171
  @apiParam {Integer} cpu_core_count Amount of Vcores assigned to the container
172
+ @apiParam {String} template Name of the template to use
166
173
 
167
174
  @apiSuccess {String} success Success message
168
175
  @apiSuccess {String} output STDOUT from container creation
@@ -177,6 +184,7 @@ module Api
177
184
  requires :disk_size_gb, type: Integer
178
185
  requires :memory_limit_mb, type: Integer
179
186
  requires :cpu_core_count, type: Integer
187
+ requires :template, type: String
180
188
  end
181
189
  post '/containers' do
182
190
  begin
@@ -184,7 +192,8 @@ module Api
184
192
  params[:ip_address],
185
193
  params[:disk_size_gb],
186
194
  params[:memory_limit_mb],
187
- params[:cpu_core_count]
195
+ params[:cpu_core_count],
196
+ params[:template]
188
197
  )
189
198
 
190
199
  return { success: 'container was created', output: res }
@@ -1,3 +1,32 @@
1
+ =begin
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
+ Container Manager
8
+
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ =end
29
+
1
30
  # bind address for the rest api
2
31
  $http_bind_addr = '0.0.0.0'
3
32
 
@@ -20,7 +49,6 @@ $cmd_hostname = 'hostname'
20
49
  $lxc_container_config_path = '/var/lib/lxc/[name]/config'
21
50
  $lxc_ip_netmask = 24
22
51
 
23
-
24
52
  $lxc_cgroup_mount_path = '/sys/fs/cgroup'
25
53
 
26
54
  # lxc specific commands
@@ -31,8 +59,10 @@ $lxc_cmd_stop = 'lxc-stop -n [name] --timeout=15'
31
59
  $lxc_cmd_kill = 'lxc-stop -n [name] -k'
32
60
  $lxc_cmd_info = 'lxc-info -n [name] -H'
33
61
  $lxc_cmd_destroy = 'lxc-destroy -n [name] -f'
34
- $lxc_cmd_create = 'lxc-create -t centos -n [name]'
35
62
 
63
+ $lxc_cmd_create = {
64
+ "centos7_minimal" => "lxc-create -t centos -n [name]",
65
+ }
36
66
 
37
67
  # linux-vserver specific commands
38
68
  $vserver_cmd_ls = 'ls -1 /etc/vservers'
@@ -40,8 +70,10 @@ $vserver_cmd_start = 'vserver [name] start'
40
70
  $vserver_cmd_stop = 'vserver [name] stop'
41
71
  $vserver_cmd_stat = 'vserver-stat | grep [name]$'
42
72
  $vserver_cmd_destroy = "echo 'y' | vserver [name] delete"
43
- #$vserver_cmd_create = "vserver [name] build -m clone --context [context] --hostname [name] --interface eth0:[ip_address]/24 -- --source /vservers/test"
44
- $vserver_cmd_create = "vserver [name] build -m debootstrap --context [context] --hostname [name] --interface eth0:[ip_address]/24 -- -d wheezy -m http://ftp.de.debian.org/debian"
73
+
74
+ $vserver_cmd_create = {
75
+ "debian-wheezy_minimal" => "vserver [name] build -m debootstrap --context [context] --hostname [name] --interface eth0:[ip_address]/24 -- -d wheezy -m http://ftp.de.debian.org/debian",
76
+ }
45
77
 
46
78
  $vserver_cmd_get_memory_limit = 'vlimit -c [context] -a -d | grep RSS'
47
79
 
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  module ConfigCheck
@@ -47,4 +51,4 @@ module ConfigCheck
47
51
 
48
52
  valid_types.include?(container_type)
49
53
  end
50
- end
54
+ end