fog-proxmox 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +7 -0
  3. data/.travis.yml +1 -0
  4. data/.vscode/launch.json +3 -21
  5. data/.vscode/settings.json +7 -7
  6. data/Gemfile.lock +39 -39
  7. data/README.md +9 -2
  8. data/examples/compute.rb +20 -23
  9. data/examples/identity.rb +16 -21
  10. data/fog-proxmox.gemspec +1 -2
  11. data/lib/fog/compute/proxmox.rb +2 -8
  12. data/lib/fog/compute/proxmox/models/disk.rb +13 -11
  13. data/lib/fog/compute/proxmox/models/disks.rb +3 -5
  14. data/lib/fog/compute/proxmox/models/interface.rb +6 -11
  15. data/lib/fog/compute/proxmox/models/interfaces.rb +3 -5
  16. data/lib/fog/compute/proxmox/models/node.rb +38 -43
  17. data/lib/fog/compute/proxmox/models/nodes.rb +5 -11
  18. data/lib/fog/compute/proxmox/models/server.rb +123 -80
  19. data/lib/fog/compute/proxmox/models/server_config.rb +56 -24
  20. data/lib/fog/compute/proxmox/models/servers.rb +34 -26
  21. data/lib/fog/compute/proxmox/models/snapshot.rb +28 -14
  22. data/lib/fog/compute/proxmox/models/snapshots.rb +9 -17
  23. data/lib/fog/compute/proxmox/models/storage.rb +15 -11
  24. data/lib/fog/compute/proxmox/models/storages.rb +13 -22
  25. data/lib/fog/compute/proxmox/models/task.rb +10 -14
  26. data/lib/fog/compute/proxmox/models/tasks.rb +9 -18
  27. data/lib/fog/compute/proxmox/models/volume.rb +12 -12
  28. data/lib/fog/compute/proxmox/models/volumes.rb +10 -19
  29. data/lib/fog/compute/proxmox/requests/action_server.rb +1 -4
  30. data/lib/fog/compute/proxmox/requests/clone_server.rb +1 -4
  31. data/lib/fog/compute/proxmox/requests/create_backup.rb +1 -4
  32. data/lib/fog/compute/proxmox/requests/create_server.rb +1 -4
  33. data/lib/fog/compute/proxmox/requests/create_snapshot.rb +1 -4
  34. data/lib/fog/compute/proxmox/requests/create_spice.rb +1 -4
  35. data/lib/fog/compute/proxmox/requests/create_term.rb +1 -4
  36. data/lib/fog/compute/proxmox/requests/create_vnc.rb +1 -4
  37. data/lib/fog/compute/proxmox/requests/delete_server.rb +1 -4
  38. data/lib/fog/compute/proxmox/requests/delete_snapshot.rb +1 -4
  39. data/lib/fog/compute/proxmox/requests/get_node_statistics.rb +1 -4
  40. data/lib/fog/compute/proxmox/requests/get_server_config.rb +1 -4
  41. data/lib/fog/compute/proxmox/requests/get_server_status.rb +1 -4
  42. data/lib/fog/compute/proxmox/requests/{get_snapshot.rb → get_snapshot_config.rb} +5 -8
  43. data/lib/fog/compute/proxmox/requests/get_task.rb +1 -4
  44. data/lib/fog/compute/proxmox/requests/get_vnc.rb +1 -4
  45. data/lib/fog/compute/proxmox/requests/list_nodes.rb +1 -2
  46. data/lib/fog/compute/proxmox/requests/list_storages.rb +3 -1
  47. data/lib/fog/compute/proxmox/requests/log_task.rb +1 -4
  48. data/lib/fog/compute/proxmox/requests/move_disk.rb +1 -4
  49. data/lib/fog/compute/proxmox/requests/move_volume.rb +1 -4
  50. data/lib/fog/compute/proxmox/requests/next_vmid.rb +5 -3
  51. data/lib/fog/compute/proxmox/requests/resize_container.rb +1 -4
  52. data/lib/fog/compute/proxmox/requests/status_task.rb +1 -4
  53. data/lib/fog/compute/proxmox/requests/update_server.rb +1 -4
  54. data/lib/fog/identity/proxmox.rb +2 -8
  55. data/lib/fog/identity/proxmox/models/domain.rb +25 -21
  56. data/lib/fog/identity/proxmox/models/{ldap.rb → domain_type.rb} +9 -18
  57. data/lib/fog/identity/proxmox/models/domains.rb +6 -76
  58. data/lib/fog/identity/proxmox/models/group.rb +6 -19
  59. data/lib/fog/identity/proxmox/models/groups.rb +6 -12
  60. data/lib/fog/identity/proxmox/models/permission.rb +27 -31
  61. data/lib/fog/identity/proxmox/models/permissions.rb +8 -25
  62. data/lib/fog/identity/proxmox/models/pool.rb +9 -22
  63. data/lib/fog/identity/proxmox/models/pools.rb +7 -13
  64. data/lib/fog/identity/proxmox/models/principal.rb +1 -6
  65. data/lib/fog/identity/proxmox/models/role.rb +7 -20
  66. data/lib/fog/identity/proxmox/models/roles.rb +6 -13
  67. data/lib/fog/identity/proxmox/models/user.rb +7 -21
  68. data/lib/fog/identity/proxmox/models/users.rb +6 -12
  69. data/lib/fog/identity/proxmox/requests/check_permissions.rb +1 -4
  70. data/lib/fog/identity/proxmox/requests/list_roles.rb +0 -1
  71. data/lib/fog/identity/proxmox/requests/read_version.rb +1 -5
  72. data/lib/fog/identity/proxmox/requests/update_group.rb +2 -3
  73. data/lib/fog/identity/proxmox/requests/{add_permission.rb → update_permissions.rb} +4 -4
  74. data/lib/fog/network/proxmox/models/network.rb +12 -18
  75. data/lib/fog/network/proxmox/models/networks.rb +11 -17
  76. data/lib/fog/network/proxmox/models/node.rb +14 -10
  77. data/lib/fog/network/proxmox/models/nodes.rb +5 -11
  78. data/lib/fog/network/proxmox/requests/create_network.rb +1 -4
  79. data/lib/fog/network/proxmox/requests/delete_network.rb +1 -4
  80. data/lib/fog/network/proxmox/requests/get_network.rb +1 -4
  81. data/lib/fog/network/proxmox/requests/get_node.rb +1 -4
  82. data/lib/fog/network/proxmox/requests/power_node.rb +1 -4
  83. data/lib/fog/network/proxmox/requests/update_network.rb +1 -4
  84. data/lib/fog/{compute/proxmox/requests/check_vmid.rb → proxmox/attributes.rb} +9 -17
  85. data/lib/fog/proxmox/core.rb +2 -1
  86. data/lib/fog/proxmox/helpers/cpu_helper.rb +6 -3
  87. data/lib/fog/proxmox/helpers/disk_helper.rb +1 -1
  88. data/lib/fog/proxmox/helpers/nic_helper.rb +37 -22
  89. data/lib/fog/proxmox/version.rb +1 -1
  90. data/lib/fog/storage/proxmox.rb +1 -1
  91. data/spec/compute_spec.rb +64 -45
  92. data/spec/fixtures/proxmox/compute/containers.yml +1684 -4137
  93. data/spec/fixtures/proxmox/compute/identity_ticket.yml +4 -4
  94. data/spec/fixtures/proxmox/compute/nodes.yml +21 -21
  95. data/spec/fixtures/proxmox/compute/servers.yml +3065 -7741
  96. data/spec/fixtures/proxmox/compute/snapshots.yml +279 -827
  97. data/spec/fixtures/proxmox/compute/storages.yml +60 -21
  98. data/spec/fixtures/proxmox/compute/tasks.yml +56 -98
  99. data/spec/fixtures/proxmox/identity/auth.yml +6 -6
  100. data/spec/fixtures/proxmox/identity/domains.yml +252 -84
  101. data/spec/fixtures/proxmox/identity/groups.yml +93 -54
  102. data/spec/fixtures/proxmox/identity/identity_ticket.yml +4 -4
  103. data/spec/fixtures/proxmox/identity/permissions.yml +317 -79
  104. data/spec/fixtures/proxmox/identity/pools.yml +266 -71
  105. data/spec/fixtures/proxmox/identity/read_version.yml +6 -6
  106. data/spec/fixtures/proxmox/identity/roles.yml +96 -57
  107. data/spec/fixtures/proxmox/identity/users.yml +224 -107
  108. data/spec/fixtures/proxmox/network/identity_ticket.yml +4 -4
  109. data/spec/fixtures/proxmox/network/networks.yml +54 -95
  110. data/spec/helpers/nic_helper_spec.rb +4 -4
  111. data/spec/identity_spec.rb +38 -46
  112. data/spec/network_spec.rb +1 -1
  113. metadata +9 -23
  114. data/lib/fog/compute/proxmox/models/container.rb +0 -86
  115. data/lib/fog/compute/proxmox/models/container_config.rb +0 -114
  116. data/lib/fog/compute/proxmox/models/containers.rb +0 -43
  117. data/lib/fog/compute/proxmox/requests/get_node.rb +0 -44
  118. data/lib/fog/compute/proxmox/requests/get_storage.rb +0 -44
  119. data/lib/fog/identity/proxmox/models/activedirectory.rb +0 -57
  120. data/lib/fog/identity/proxmox/models/oath.rb +0 -50
  121. data/lib/fog/identity/proxmox/models/pam.rb +0 -46
  122. data/lib/fog/identity/proxmox/models/pve.rb +0 -46
  123. data/lib/fog/identity/proxmox/models/yubico.rb +0 -51
  124. data/lib/fog/identity/proxmox/requests/remove_permission.rb +0 -42
  125. data/lib/fog/proxmox/models/collection.rb +0 -85
  126. data/lib/fog/proxmox/models/model.rb +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62bda3253f9a17347772bf6895a2658b8d47d3822d6addeadb674d779c396c1b
4
- data.tar.gz: 3cb6401715a785b87a2f06dd1a75eaab0c47051d1a8f09c763a417dbe7769269
3
+ metadata.gz: 89601175c17a32bfedcfbb2d2c95da5c04f5113b2059284beed81722fea4c02a
4
+ data.tar.gz: 73b0527220941f9532dfb28bcac1b81bc1e0690e00dabecbf1709f3c9b5701cf
5
5
  SHA512:
6
- metadata.gz: 01b38e8e7c7b9c576c36ea337ad51f2ee3502290bf71393dcf7cfa80c2187414217e434fa741a22f6993a1bd05d0180a31a2879f17f06b756377d377a27c082d
7
- data.tar.gz: 733048733bad0ea948e271a70317e7731dfd6929b35e980b8831bfe862e555c67554135e89332b7b513c5eaffdec673d19b7cb30736a645b858e23b32dec9417
6
+ metadata.gz: 87c0195ad8bc29a851250e4149360bb9b2f7078fcabda4c0bb5158306a792fbde335ba78ce531f77762a31fdc7e25b8a7f8723cd8732bd774e5e663a51d7525e
7
+ data.tar.gz: 12ffb8db4943453a446fad5c58d61670e85fb6e10f3be74e361bad118c4a1d6b0e95b3a48ce8e31721da636c1a280e1f1b812e2bc5fc2dd773c72ecb4c7b4e42
data/.gitlab-ci.yml CHANGED
@@ -41,3 +41,10 @@ test-ruby-2.5.1:
41
41
  - bundle install --binstubs
42
42
  - bundle exec rake test
43
43
  - bundle exec rake spec
44
+
45
+ test-ruby-2.6.2:
46
+ image: ruby:2.6.2
47
+ script:
48
+ - bundle install --binstubs
49
+ - bundle exec rake test
50
+ - bundle exec rake spec
data/.travis.yml CHANGED
@@ -10,6 +10,7 @@ rvm:
10
10
  - 2.3.7
11
11
  - 2.4.4
12
12
  - 2.5.0
13
+ - 2.6.2
13
14
  notifications:
14
15
  email: false
15
16
  slack:
data/.vscode/launch.json CHANGED
@@ -9,8 +9,6 @@
9
9
  "cwd": "${workspaceRoot}",
10
10
  "program": "${workspaceRoot}/main.rb",
11
11
  "useBundler": true,
12
- "pathToBundler": "/home/tristan/.rbenv/shims/bundler", // linux rbenv
13
- "pathToRDebugIDE": "/home/tristan/.rbenv/shims/rdebug-ide",
14
12
  },
15
13
  {
16
14
  "name": "Listen for rdebug-ide",
@@ -21,16 +19,6 @@
21
19
  "remotePort": "1234",
22
20
  "remoteWorkspaceRoot": "${workspaceRoot}"
23
21
  },
24
- {
25
- "name": "Rails server",
26
- "type": "Ruby",
27
- "request": "launch",
28
- "cwd": "${workspaceRoot}",
29
- "program": "${workspaceRoot}/bin/rails",
30
- "args": [
31
- "server"
32
- ]
33
- },
34
22
  {
35
23
  "name": "RSpec - all",
36
24
  "type": "Ruby",
@@ -38,8 +26,6 @@
38
26
  "cwd": "${workspaceRoot}",
39
27
  "program": "${workspaceRoot}/bin/rspec",
40
28
  "useBundler": true,
41
- "pathToBundler": "/home/tristan/.rbenv/shims/bundler", // linux rbenv
42
- "pathToRDebugIDE": "/home/tristan/.rbenv/shims/rdebug-ide",
43
29
  "showDebuggerOutput": true,
44
30
  "env": {
45
31
  "DISABLE_PROXY": true,
@@ -47,7 +33,7 @@
47
33
  "USE_VCR": false,
48
34
  "PVE_URL": "https://192.168.56.101:8006/api2/json",
49
35
  "PVE_USERNAME": "root@pam",
50
- "PVE_PASSWORD": "proxmox01"
36
+ "PVE_PASSWORD": ""
51
37
  },
52
38
  "args": [
53
39
  "-I",
@@ -61,8 +47,6 @@
61
47
  "cwd": "${workspaceRoot}",
62
48
  "program": "${workspaceRoot}/bin/rspec",
63
49
  "useBundler": true,
64
- "pathToBundler": "/home/tristan/.rbenv/shims/bundler", // linux rbenv
65
- "pathToRDebugIDE": "/home/tristan/.rbenv/shims/rdebug-ide",
66
50
  "showDebuggerOutput": true,
67
51
  "env": {
68
52
  "DISABLE_PROXY": true,
@@ -70,7 +54,7 @@
70
54
  "USE_VCR": false,
71
55
  "PVE_URL": "https://192.168.56.101:8006/api2/json",
72
56
  "PVE_USERNAME": "root@pam",
73
- "PVE_PASSWORD": "proxmox01"
57
+ "PVE_PASSWORD": ""
74
58
  },
75
59
  "args": [
76
60
  "-I",
@@ -85,8 +69,6 @@
85
69
  "cwd": "${workspaceRoot}",
86
70
  "program": "${workspaceRoot}/bin/rake",
87
71
  "useBundler": true,
88
- "pathToBundler": "/home/tristan/.rbenv/shims/bundler", // linux rbenv
89
- "pathToRDebugIDE": "/home/tristan/.rbenv/shims/rdebug-ide",
90
72
  "showDebuggerOutput": true,
91
73
  "env": {
92
74
  "DISABLE_PROXY": true,
@@ -94,7 +76,7 @@
94
76
  "USE_VCR": false,
95
77
  "PVE_URL": "https://192.168.56.101:8006/api2/json",
96
78
  "PVE_USERNAME": "root@pam",
97
- "PVE_PASSWORD": "proxmox01"
79
+ "PVE_PASSWORD": ""
98
80
  },
99
81
  "args": [
100
82
  "spec",
@@ -1,9 +1,9 @@
1
1
  // Placez vos paramètres dans ce fichier pour remplacer les paramètres par défaut et les paramètres utilisateur.
2
2
  {
3
- "ruby.pathToBundler": "/home/tristan/.rbenv/shims/bundle",
3
+ "ruby.pathToBundler": "~/.asdf/shims/bundle",
4
4
  "ruby.useBundler": true,
5
- "solargraph.commandPath": "/home/tristan/.rbenv/shims/solargraph",
6
- "solargraph.bundlerPath": "/home/tristan/.rbenv/shims/bundle",
5
+ "solargraph.commandPath": "~/.asdf/shims/solargraph",
6
+ "solargraph.bundlerPath": "~/.asdf/shims/bundle",
7
7
  "workbench.startupEditor": "newUntitledFile",
8
8
  "workbench.iconTheme": "vscode-icons",
9
9
  "git.autofetch": true,
@@ -25,11 +25,11 @@
25
25
  "include": "**/*.erb,**/*.rb,**/vendor/*.*",
26
26
  "exclude": "{**/@(test|spec|tmp|.*),**/@(test|spec|tmp|.*)/**,**/*_spec.rb}"
27
27
  },
28
- "ruby.interpreter.commandPath": "/home/tristan/.rbenv/shims/ruby",
29
- "ruby.pathToBundler": "/home/tristan/.rbenv/shims/bundle",
28
+ "ruby.interpreter.commandPath": "~/.asdf/shims/ruby",
29
+ "ruby.pathToBundler": "~/.asdf/shims/bundle",
30
30
  "ruby.useBundler": true,
31
- "solargraph.commandPath": "/home/tristan/.rbenv/shims/solargraph",
32
- "solargraph.bundlerPath": "/home/tristan/.rbenv/shims/bundle",
31
+ "solargraph.commandPath": "~/.asdf/shims/solargraph",
32
+ "solargraph.bundlerPath": "~/.asdf/shims/bundle",
33
33
  "gitlens.advanced.messages": {
34
34
  "suppressCommitHasNoPreviousCommitWarning": false,
35
35
  "suppressCommitNotFoundWarning": false,
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fog-proxmox (0.5.5)
4
+ fog-proxmox (0.6.0)
5
5
  fog-core (~> 1.45)
6
6
  fog-json (~> 1.0)
7
7
  ipaddress (~> 0.8)
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.5.2)
12
+ addressable (2.6.0)
13
13
  public_suffix (>= 2.0.2, < 4.0)
14
14
  ast (2.4.0)
15
15
  axiom-types (0.1.1)
@@ -27,7 +27,7 @@ GEM
27
27
  safe_yaml (~> 1.0.0)
28
28
  debase (0.2.2)
29
29
  debase-ruby_core_source (>= 0.10.2)
30
- debase-ruby_core_source (0.10.3)
30
+ debase-ruby_core_source (0.10.4)
31
31
  debride (1.8.1)
32
32
  path_expander (~> 1.0)
33
33
  ruby_parser (~> 3.6)
@@ -38,9 +38,9 @@ GEM
38
38
  docile (1.3.1)
39
39
  equalizer (0.0.11)
40
40
  excon (0.62.0)
41
- fasterer (0.4.1)
41
+ fasterer (0.5.1)
42
42
  colorize (~> 0.7)
43
- ruby_parser (~> 3.11.0)
43
+ ruby_parser (>= 3.13.0)
44
44
  fastri (0.3.1.1)
45
45
  fog-core (1.45.0)
46
46
  builder
@@ -50,72 +50,72 @@ GEM
50
50
  fog-core
51
51
  multi_json (~> 1.10)
52
52
  formatador (0.2.5)
53
- hashdiff (0.3.7)
53
+ hashdiff (0.3.8)
54
54
  ice_nine (0.11.2)
55
55
  ipaddress (0.8.3)
56
- jaro_winkler (1.5.1)
57
- json (2.1.0)
58
- method_source (0.9.0)
56
+ jaro_winkler (1.5.2)
57
+ json (2.2.0)
58
+ method_source (0.9.2)
59
59
  minitest (5.11.3)
60
60
  multi_json (1.13.1)
61
- parallel (1.12.1)
62
- parser (2.5.1.0)
61
+ parallel (1.17.0)
62
+ parser (2.5.3.0)
63
63
  ast (~> 2.4.0)
64
64
  path_expander (1.0.3)
65
- powerpack (0.1.2)
66
- pry (0.11.3)
65
+ pry (0.12.2)
67
66
  coderay (~> 1.1.0)
68
67
  method_source (~> 0.9.0)
69
- public_suffix (3.0.2)
68
+ psych (3.1.0)
69
+ public_suffix (3.0.3)
70
70
  rainbow (3.0.0)
71
- rake (12.3.1)
71
+ rake (12.3.2)
72
72
  rcodetools (0.8.5.0)
73
- reek (4.8.1)
73
+ reek (4.8.2)
74
74
  codeclimate-engine-rb (~> 0.4.0)
75
75
  parser (>= 2.5.0.0, < 2.6)
76
76
  rainbow (>= 2.0, < 4.0)
77
- rspec (3.7.0)
78
- rspec-core (~> 3.7.0)
79
- rspec-expectations (~> 3.7.0)
80
- rspec-mocks (~> 3.7.0)
81
- rspec-core (3.7.1)
82
- rspec-support (~> 3.7.0)
83
- rspec-expectations (3.7.0)
77
+ rspec (3.8.0)
78
+ rspec-core (~> 3.8.0)
79
+ rspec-expectations (~> 3.8.0)
80
+ rspec-mocks (~> 3.8.0)
81
+ rspec-core (3.8.0)
82
+ rspec-support (~> 3.8.0)
83
+ rspec-expectations (3.8.2)
84
84
  diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.7.0)
86
- rspec-mocks (3.7.0)
85
+ rspec-support (~> 3.8.0)
86
+ rspec-mocks (3.8.0)
87
87
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.7.0)
89
- rspec-support (3.7.1)
90
- rubocop (0.57.2)
88
+ rspec-support (~> 3.8.0)
89
+ rspec-support (3.8.0)
90
+ rubocop (0.66.0)
91
91
  jaro_winkler (~> 1.5.1)
92
92
  parallel (~> 1.10)
93
- parser (>= 2.5)
94
- powerpack (~> 0.1)
93
+ parser (>= 2.5, != 2.5.1.1)
94
+ psych (>= 3.1.0)
95
95
  rainbow (>= 2.2.2, < 4.0)
96
96
  ruby-progressbar (~> 1.7)
97
- unicode-display_width (~> 1.0, >= 1.0.1)
97
+ unicode-display_width (>= 1.4.0, < 1.6)
98
98
  ruby-debug-ide (0.6.1)
99
99
  rake (>= 0.8.1)
100
- ruby-progressbar (1.9.0)
101
- ruby_parser (3.11.0)
100
+ ruby-progressbar (1.10.0)
101
+ ruby_parser (3.13.1)
102
102
  sexp_processor (~> 4.9)
103
- safe_yaml (1.0.4)
104
- sexp_processor (4.11.0)
103
+ safe_yaml (1.0.5)
104
+ sexp_processor (4.12.0)
105
105
  simplecov (0.16.1)
106
106
  docile (~> 1.1)
107
107
  json (>= 1.8, < 3)
108
108
  simplecov-html (~> 0.10.0)
109
109
  simplecov-html (0.10.2)
110
110
  thread_safe (0.3.6)
111
- unicode-display_width (1.4.0)
111
+ unicode-display_width (1.5.0)
112
112
  vcr (3.0.3)
113
113
  virtus (1.0.5)
114
114
  axiom-types (~> 0.1)
115
115
  coercible (~> 1.0)
116
116
  descendants_tracker (~> 0.0, >= 0.0.3)
117
117
  equalizer (~> 0.0, >= 0.0.9)
118
- webmock (3.4.2)
118
+ webmock (3.5.1)
119
119
  addressable (>= 2.3.6)
120
120
  crack (>= 0.3.2)
121
121
  hashdiff
@@ -124,7 +124,7 @@ PLATFORMS
124
124
  ruby
125
125
 
126
126
  DEPENDENCIES
127
- bundler (~> 1.16)
127
+ bundler (~> 2.0)
128
128
  debase (~> 0.2.2)
129
129
  debride (~> 1.8)
130
130
  fasterer (~> 0.3)
@@ -143,4 +143,4 @@ DEPENDENCIES
143
143
  webmock (~> 3.4)
144
144
 
145
145
  BUNDLED WITH
146
- 1.17.3
146
+ 2.0.1
data/README.md CHANGED
@@ -6,12 +6,19 @@
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/33e619f2167cc9864b61/maintainability)](https://codeclimate.com/github/fog/fog-proxmox/maintainability)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/33e619f2167cc9864b61/test_coverage)](https://codeclimate.com/github/fog/fog-proxmox/test_coverage)
8
8
 
9
- This is a [FOG](http://fog.io/) (>= 1.45.0) module gem to support [Proxmox VE](https://www.proxmox.com/en/proxmox-ve) (tested with 5.1 and 5.2)
9
+ This is a [FOG](http://fog.io/) (>= 1.45.0) module gem to support [Proxmox VE](https://www.proxmox.com/en/proxmox-ve)
10
10
 
11
11
  It is intended to satisfy this [feature](https://github.com/fog/fog/issues/3644), but Proxmox provider only, and above all this [Foreman](http://www.theforeman.org) [feature](https://projects.theforeman.org/issues/2186).
12
12
 
13
13
  It is inspired by the great [fog-openstack](https://github.com/fog/fog-openstack) module.
14
14
 
15
+ ## Compatibility versions
16
+
17
+ |Fog-Proxmox|Proxmox VE|
18
+ |--|--|
19
+ |<0.6|<5.3|
20
+ |>=0.6|>=5.3|
21
+
15
22
  ## Installation
16
23
 
17
24
  Add this line to your application's Gemfile:
@@ -23,7 +30,7 @@ gem 'fog-proxmox'
23
30
  And then execute:
24
31
 
25
32
  ```ruby
26
- bundle install --binstubs
33
+ bundle install
27
34
  ```
28
35
 
29
36
  Or install it yourself as:
data/examples/compute.rb CHANGED
@@ -39,10 +39,10 @@ compute = Fog::Compute::Proxmox.new(
39
39
 
40
40
  # Create pools
41
41
  pool_hash = { poolid: 'pool1' }
42
- compute.domains.create(pool_hash)
42
+ pool1 = compute.pools.create(pool_hash)
43
43
 
44
44
  # Get one pool by id
45
- pool1 = compute.pools.find_by_id 'pool1'
45
+ pool1 = compute.pools.get 'pool1'
46
46
 
47
47
  # Update pool
48
48
  pool1.comment 'pool 1'
@@ -63,7 +63,7 @@ pool1.destroy
63
63
 
64
64
  # Get node owner
65
65
  node_name = 'pve'
66
- node = compute.nodes.find_by_id node_name
66
+ node = compute.nodes.get node_name
67
67
 
68
68
  # Get next free vmid
69
69
  vmid = node.servers.next_id
@@ -105,22 +105,19 @@ server.update(config_hash)
105
105
  config_hash = { onboot: 1, keyboard: 'fr', ostype: 'l26', kvm: 0 }
106
106
  server.update(config_hash)
107
107
  # Get configuration model
108
- config = server.get_config
108
+ config = server.config
109
109
  # Get nics config
110
- nics = server.get_config.nics
110
+ nics = server.config.nics
111
111
  nics[:net0]
112
112
  # Get hdd controllers (ide, sata, scsi or virtio) config
113
113
  # All return hashes with key equals to controller id
114
- ides = server.get_config.ides
115
- ides[:ide2]
116
- satas = server.get_config.satas
117
- scsis = server.get_config.scsis
118
- virtios = server.get_config.virtios
119
- virtios[:virtio0]
114
+ disks = server.config.disks
115
+ ide0 = disks.get('ide0')
116
+ virtio0 = disks.get('virtio0')
120
117
  # Get mac_addresses
121
- server.get_config.mac_adresses
118
+ server.config.mac_adresses
122
119
  # List all servers
123
- servers_all = compute.servers.all
120
+ servers_all = node.servers.all
124
121
 
125
122
  # Start server
126
123
  server.action('start')
@@ -167,14 +164,14 @@ snapshot.update
167
164
  snapshot.destroy
168
165
 
169
166
  # Fetch disk images
170
- server.disk_images.all
167
+ server.config.disks
171
168
 
172
169
  # Delete server
173
170
  server.destroy
174
171
 
175
172
  # Create containers
176
173
  node_name = 'pve'
177
- node = compute.nodes.find_by_id node_name
174
+ node = compute.nodes.get node_name
178
175
  ostemplate = 'local:vztmpl/alpine-3.7-default_20171211_amd64.tar.xz'
179
176
  container_hash = {
180
177
  vmid: vmid,
@@ -217,8 +214,8 @@ config_hash = { onboot: 1, ostype: 'alpine' }
217
214
  container.update(config_hash)
218
215
  # Get mac_addresses
219
216
  container.mac_adresses
220
- # Get nics
221
- container.config.nics
217
+ # Get interfaces
218
+ container.config.interfaces
222
219
  # Get additional mount points
223
220
  container.config.mount_points
224
221
  # List all servers
@@ -261,19 +258,19 @@ snapshot.update
261
258
  snapshot.destroy
262
259
 
263
260
  # Fetch additional mount points
264
- container.mount_points
261
+ container.config.mount_points
265
262
  # Fetch network interfaces
266
- container.nics
263
+ container.config.interfaces
267
264
 
268
265
  # Delete container
269
266
  container.destroy
270
267
 
271
268
  # List 1 task
272
- options = { limit: 1 }
273
- node = 'pve'
274
- tasks = compute.tasks.search(node, options)
269
+ filters = { limit: 1 }
270
+ node = compute.nodes.get 'pve'
271
+ tasks = node.tasks.all(filters)
275
272
  # Get task
276
273
  upid = tasks[0].upid
277
- task = compute.tasks.find_by_id(node, upid)
274
+ task = node.tasks.get(upid)
278
275
  # Stop task
279
276
  task.stop
data/examples/identity.rb CHANGED
@@ -49,19 +49,11 @@ bob_hash = {
49
49
  lastname: 'Sinclar',
50
50
  email: 'bobsinclar@proxmox.com'
51
51
  }
52
- # is equivalent to
53
- # bob_hash = {
54
- # userid: 'bobsinclar',
55
- # realm: 'pve',
56
- # password: 'bobsinclar1',
57
- # firstname: 'Bob',
58
- # lastname: 'Sinclar',
59
- # email: 'bobsinclar@proxmox.com'
60
- # }
52
+
61
53
  identity.users.create(bob_hash)
62
54
 
63
55
  # Get a user by id
64
- bob = identity.users.find_by_id 'bobsinclar@pve'
56
+ bob = identity.users.get 'bobsinclar@pve'
65
57
 
66
58
  # List all users
67
59
  identity.users.all
@@ -85,7 +77,7 @@ group_hash = { groupid: 'group1' }
85
77
  identity.domains.create(group_hash)
86
78
 
87
79
  # Get one group by id
88
- group1 = identity.groups.find_by_id 'group1'
80
+ group1 = identity.groups.get 'group1'
89
81
 
90
82
  # Update group
91
83
  group1.comment 'Group 1'
@@ -107,7 +99,7 @@ role_hash = { roleid: 'role1' }
107
99
  identity.roles.create(role_hash)
108
100
 
109
101
  # Get one role by id
110
- role1 = identity.roles.find_by_id 'role1'
102
+ role1 = identity.roles.get 'role1'
111
103
 
112
104
  # Update role
113
105
  role1.comment 'Role 1'
@@ -157,7 +149,7 @@ identity.domains.each do |domain|
157
149
  end
158
150
 
159
151
  # Find domain by id
160
- ldap = identity.domains.find_by_id ldap_hash[:realm]
152
+ ldap = identity.domains.get ldap_hash[:realm]
161
153
 
162
154
  # Update domain
163
155
  ldap.type.comment = 'Test domain LDAP'
@@ -171,17 +163,19 @@ ldap.destroy
171
163
 
172
164
  # Add a user permission
173
165
  permission_hash = {
174
- path: '/access/users',
175
- roles: 'PVEUserAdmin',
176
- users: bob_hash[:userid]
166
+ type: 'user'
167
+ path: '/access',
168
+ roleid: 'PVEUserAdmin',
169
+ ugid: bob_hash[:userid]
177
170
  }
178
171
  # Add a group permission
179
172
  # permission_hash = {
180
- # path: '/access/users',
181
- # roles: 'PVEUserAdmin',
182
- # groups: 'group1'
173
+ # type: 'group'
174
+ # path: '/access',
175
+ # roleid: 'PVEUserAdmin',
176
+ # ugid: 'group1'
183
177
  # }
184
- identity.add_permission(permission_hash)
178
+ permission = identity.permissions.create(permission_hash)
185
179
 
186
180
  # List all permissions
187
181
  identity.permissions.all
@@ -192,4 +186,5 @@ identity.permissions.each do |permission|
192
186
  end
193
187
 
194
188
  # Remove permission
195
- identity.remove_permission(permission_hash)
189
+ permission = identity.get(permission_hash)
190
+ permission.destroy