fog-proxmox 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -9
- data/docs/compute.md +17 -17
- data/docs/identity.md +6 -6
- data/examples/compute.rb +1 -1
- data/examples/identity.rb +1 -1
- data/fog-proxmox.gemspec +4 -4
- data/lib/fog/compute/proxmox.rb +2 -2
- data/lib/fog/compute/proxmox/models/disk.rb +2 -2
- data/lib/fog/compute/proxmox/models/disks.rb +3 -3
- data/lib/fog/compute/proxmox/models/interface.rb +2 -2
- data/lib/fog/compute/proxmox/models/interfaces.rb +4 -4
- data/lib/fog/compute/proxmox/models/node.rb +6 -6
- data/lib/fog/compute/proxmox/models/nodes.rb +3 -3
- data/lib/fog/compute/proxmox/models/server.rb +6 -6
- data/lib/fog/compute/proxmox/models/server_config.rb +8 -8
- data/lib/fog/compute/proxmox/models/servers.rb +3 -3
- data/lib/fog/compute/proxmox/models/snapshot.rb +3 -3
- data/lib/fog/compute/proxmox/models/snapshots.rb +3 -3
- data/lib/fog/compute/proxmox/models/storage.rb +3 -3
- data/lib/fog/compute/proxmox/models/storages.rb +3 -3
- data/lib/fog/compute/proxmox/models/task.rb +2 -2
- data/lib/fog/compute/proxmox/models/tasks.rb +3 -3
- data/lib/fog/compute/proxmox/models/volume.rb +2 -2
- data/lib/fog/compute/proxmox/models/volumes.rb +3 -3
- data/lib/fog/compute/proxmox/requests/action_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/clone_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/create_backup.rb +2 -2
- data/lib/fog/compute/proxmox/requests/create_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/create_snapshot.rb +2 -2
- data/lib/fog/compute/proxmox/requests/create_spice.rb +2 -2
- data/lib/fog/compute/proxmox/requests/create_term.rb +2 -2
- data/lib/fog/compute/proxmox/requests/create_vnc.rb +2 -2
- data/lib/fog/compute/proxmox/requests/delete_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/delete_snapshot.rb +2 -2
- data/lib/fog/compute/proxmox/requests/delete_volume.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_node_statistics.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_server_config.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_server_status.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_snapshot_config.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_task.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_vnc.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_volume.rb +2 -2
- data/lib/fog/compute/proxmox/requests/list_nodes.rb +2 -2
- data/lib/fog/compute/proxmox/requests/list_servers.rb +2 -2
- data/lib/fog/compute/proxmox/requests/list_snapshots.rb +2 -2
- data/lib/fog/compute/proxmox/requests/list_storages.rb +2 -2
- data/lib/fog/compute/proxmox/requests/list_tasks.rb +2 -2
- data/lib/fog/compute/proxmox/requests/list_volumes.rb +2 -2
- data/lib/fog/compute/proxmox/requests/log_task.rb +2 -2
- data/lib/fog/compute/proxmox/requests/migrate_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/move_disk.rb +2 -2
- data/lib/fog/compute/proxmox/requests/move_volume.rb +2 -2
- data/lib/fog/compute/proxmox/requests/next_vmid.rb +2 -2
- data/lib/fog/compute/proxmox/requests/resize_container.rb +2 -2
- data/lib/fog/compute/proxmox/requests/resize_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/rollback_snapshot.rb +2 -2
- data/lib/fog/compute/proxmox/requests/status_task.rb +2 -2
- data/lib/fog/compute/proxmox/requests/stop_task.rb +2 -2
- data/lib/fog/compute/proxmox/requests/template_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/update_server.rb +2 -2
- data/lib/fog/compute/proxmox/requests/update_snapshot.rb +2 -2
- data/lib/fog/identity/proxmox.rb +2 -2
- data/lib/fog/identity/proxmox/models/domain.rb +3 -3
- data/lib/fog/identity/proxmox/models/domain_type.rb +2 -2
- data/lib/fog/identity/proxmox/models/domains.rb +3 -3
- data/lib/fog/identity/proxmox/models/group.rb +2 -2
- data/lib/fog/identity/proxmox/models/groups.rb +3 -3
- data/lib/fog/identity/proxmox/models/permission.rb +2 -2
- data/lib/fog/identity/proxmox/models/permissions.rb +3 -3
- data/lib/fog/identity/proxmox/models/pool.rb +2 -2
- data/lib/fog/identity/proxmox/models/pools.rb +3 -3
- data/lib/fog/identity/proxmox/models/principal.rb +2 -2
- data/lib/fog/identity/proxmox/models/role.rb +2 -2
- data/lib/fog/identity/proxmox/models/roles.rb +3 -3
- data/lib/fog/identity/proxmox/models/user.rb +2 -2
- data/lib/fog/identity/proxmox/models/users.rb +3 -3
- data/lib/fog/identity/proxmox/requests/change_password.rb +2 -2
- data/lib/fog/identity/proxmox/requests/check_permissions.rb +2 -2
- data/lib/fog/identity/proxmox/requests/create_domain.rb +2 -2
- data/lib/fog/identity/proxmox/requests/create_group.rb +2 -2
- data/lib/fog/identity/proxmox/requests/create_pool.rb +2 -2
- data/lib/fog/identity/proxmox/requests/create_role.rb +2 -2
- data/lib/fog/identity/proxmox/requests/create_user.rb +2 -2
- data/lib/fog/identity/proxmox/requests/delete_domain.rb +2 -2
- data/lib/fog/identity/proxmox/requests/delete_group.rb +2 -2
- data/lib/fog/identity/proxmox/requests/delete_pool.rb +2 -2
- data/lib/fog/identity/proxmox/requests/delete_role.rb +2 -2
- data/lib/fog/identity/proxmox/requests/delete_user.rb +2 -2
- data/lib/fog/identity/proxmox/requests/get_domain.rb +2 -2
- data/lib/fog/identity/proxmox/requests/get_group.rb +2 -2
- data/lib/fog/identity/proxmox/requests/get_pool.rb +2 -2
- data/lib/fog/identity/proxmox/requests/get_role.rb +2 -2
- data/lib/fog/identity/proxmox/requests/get_user.rb +2 -2
- data/lib/fog/identity/proxmox/requests/list_domains.rb +2 -2
- data/lib/fog/identity/proxmox/requests/list_groups.rb +2 -2
- data/lib/fog/identity/proxmox/requests/list_permissions.rb +2 -2
- data/lib/fog/identity/proxmox/requests/list_pools.rb +2 -2
- data/lib/fog/identity/proxmox/requests/list_roles.rb +2 -2
- data/lib/fog/identity/proxmox/requests/list_users.rb +2 -2
- data/lib/fog/identity/proxmox/requests/read_version.rb +2 -2
- data/lib/fog/identity/proxmox/requests/update_domain.rb +2 -2
- data/lib/fog/identity/proxmox/requests/update_group.rb +2 -2
- data/lib/fog/identity/proxmox/requests/update_permissions.rb +2 -2
- data/lib/fog/identity/proxmox/requests/update_pool.rb +2 -2
- data/lib/fog/identity/proxmox/requests/update_role.rb +2 -2
- data/lib/fog/identity/proxmox/requests/update_user.rb +2 -2
- data/lib/fog/network/proxmox.rb +2 -2
- data/lib/fog/network/proxmox/models/network.rb +2 -2
- data/lib/fog/network/proxmox/models/networks.rb +3 -3
- data/lib/fog/network/proxmox/models/node.rb +3 -3
- data/lib/fog/network/proxmox/models/nodes.rb +3 -3
- data/lib/fog/network/proxmox/requests/create_network.rb +2 -2
- data/lib/fog/network/proxmox/requests/delete_network.rb +2 -2
- data/lib/fog/network/proxmox/requests/get_network.rb +2 -2
- data/lib/fog/network/proxmox/requests/get_node.rb +2 -2
- data/lib/fog/network/proxmox/requests/list_networks.rb +2 -2
- data/lib/fog/network/proxmox/requests/list_nodes.rb +2 -2
- data/lib/fog/network/proxmox/requests/power_node.rb +2 -2
- data/lib/fog/network/proxmox/requests/update_network.rb +2 -2
- data/lib/fog/proxmox.rb +4 -17
- data/lib/fog/proxmox/core.rb +1 -1
- data/lib/fog/proxmox/helpers/controller_helper.rb +5 -6
- data/lib/fog/proxmox/version.rb +1 -1
- data/lib/fog/storage/proxmox.rb +2 -2
- data/spec/compute_spec.rb +2 -2
- data/spec/helpers/controller_helper_spec.rb +17 -2
- data/spec/identity_spec.rb +3 -3
- data/spec/network_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60f322bc1b1cd38bb76d5c25e932f68adcc8ec7a18d0060a7e4c6977a7d8db0d
|
4
|
+
data.tar.gz: bae297b90d4e4aeb2da54d76534a7cb725c7b721b6ee4b4ae1835d04c56c1778
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78294eed3cebd7a5e3a840edd918b3cb239498701b963463aa3616832e697f34cf204ff0efedf064657ca4ad1c3fc7ba4c46f75a3d2e148e313ae03b14dcde9
|
7
|
+
data.tar.gz: b049b84b24d4bd399ee043f3e7c4896f4b5a055add4607bebcf9f5f546dd9da6898b024f9194e8c433bbe15cf2eb24a9576c78085b37c30335abc70941403328
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fog-proxmox (0.
|
5
|
-
fog-core (~> 1
|
6
|
-
fog-json (~> 1.
|
4
|
+
fog-proxmox (0.7.0)
|
5
|
+
fog-core (~> 2.1)
|
6
|
+
fog-json (~> 1.2)
|
7
7
|
ipaddress (~> 0.8)
|
8
8
|
|
9
9
|
GEM
|
@@ -37,15 +37,16 @@ GEM
|
|
37
37
|
diff-lcs (1.3)
|
38
38
|
docile (1.3.1)
|
39
39
|
equalizer (0.0.11)
|
40
|
-
excon (0.
|
40
|
+
excon (0.64.0)
|
41
41
|
fasterer (0.5.1)
|
42
42
|
colorize (~> 0.7)
|
43
43
|
ruby_parser (>= 3.13.0)
|
44
44
|
fastri (0.3.1.1)
|
45
|
-
fog-core (1.
|
45
|
+
fog-core (2.1.2)
|
46
46
|
builder
|
47
47
|
excon (~> 0.58)
|
48
48
|
formatador (~> 0.2)
|
49
|
+
mime-types
|
49
50
|
fog-json (1.2.0)
|
50
51
|
fog-core
|
51
52
|
multi_json (~> 1.10)
|
@@ -56,6 +57,9 @@ GEM
|
|
56
57
|
jaro_winkler (1.5.2)
|
57
58
|
json (2.2.0)
|
58
59
|
method_source (0.9.2)
|
60
|
+
mime-types (3.2.2)
|
61
|
+
mime-types-data (~> 3.2015)
|
62
|
+
mime-types-data (3.2019.0331)
|
59
63
|
minitest (5.11.3)
|
60
64
|
multi_json (1.13.1)
|
61
65
|
parallel (1.17.0)
|
@@ -87,7 +91,7 @@ GEM
|
|
87
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
92
|
rspec-support (~> 3.8.0)
|
89
93
|
rspec-support (3.8.0)
|
90
|
-
rubocop (0.
|
94
|
+
rubocop (0.67.2)
|
91
95
|
jaro_winkler (~> 1.5.1)
|
92
96
|
parallel (~> 1.10)
|
93
97
|
parser (>= 2.5, != 2.5.1.1)
|
@@ -109,7 +113,7 @@ GEM
|
|
109
113
|
simplecov-html (0.10.2)
|
110
114
|
thread_safe (0.3.6)
|
111
115
|
unicode-display_width (1.5.0)
|
112
|
-
vcr (
|
116
|
+
vcr (4.0.0)
|
113
117
|
virtus (1.0.5)
|
114
118
|
axiom-types (~> 0.1)
|
115
119
|
coercible (~> 1.0)
|
@@ -139,8 +143,8 @@ DEPENDENCIES
|
|
139
143
|
rubocop (~> 0.55)
|
140
144
|
ruby-debug-ide (~> 0.6)
|
141
145
|
simplecov
|
142
|
-
vcr (~>
|
143
|
-
webmock (~> 3.
|
146
|
+
vcr (~> 4.0)
|
147
|
+
webmock (~> 3.5)
|
144
148
|
|
145
149
|
BUNDLED WITH
|
146
150
|
2.0.1
|
data/docs/compute.md
CHANGED
@@ -19,7 +19,7 @@ require 'fog/proxmox'
|
|
19
19
|
## Create compute service
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
compute = Fog::Compute
|
22
|
+
compute = Fog::Proxmox::Compute.new(
|
23
23
|
pve_username: PVE_USERNAME, # your user name
|
24
24
|
pve_password: PVE_PASSWORD, # your password
|
25
25
|
pve_url: PVE_URL, # your server url
|
@@ -116,7 +116,7 @@ List all nodes:
|
|
116
116
|
service.nodes.all
|
117
117
|
```
|
118
118
|
|
119
|
-
This returns a collection of `Fog::Compute::
|
119
|
+
This returns a collection of `Fog::Proxmox::Compute::Node` models:
|
120
120
|
|
121
121
|
Get a node:
|
122
122
|
|
@@ -152,7 +152,7 @@ List all servers:
|
|
152
152
|
node.servers.all
|
153
153
|
```
|
154
154
|
|
155
|
-
This returns a collection of `Fog::Identity::
|
155
|
+
This returns a collection of `Fog::Proxmox::Identity::Server` models.
|
156
156
|
|
157
157
|
Before creating a server you can get the next available server id (integer >= 100) in the cluster:
|
158
158
|
|
@@ -210,10 +210,10 @@ Get all server configuration:
|
|
210
210
|
server.config
|
211
211
|
```
|
212
212
|
|
213
|
-
This returns a `Fog::Compute::
|
213
|
+
This returns a `Fog::Proxmox::Compute::ServerConfig` model:
|
214
214
|
|
215
215
|
```ruby
|
216
|
-
<Fog::Compute::
|
216
|
+
<Fog::Proxmox::Compute::ServerConfig
|
217
217
|
smbios1: "uuid=ba2da6bd-0c92-4cfe-8f70-d22cc5b5bba2",
|
218
218
|
numa: 0,
|
219
219
|
digest: "348fdc21536f23a29dfb9b3120faa124aaeec742",
|
@@ -227,7 +227,7 @@ This returns a `Fog::Compute::Proxmox::ServerConfig` model:
|
|
227
227
|
memory: 512,
|
228
228
|
name: "test",
|
229
229
|
ide2: "cdrom,media=cdrom",
|
230
|
-
server: <Fog::Compute::
|
230
|
+
server: <Fog::Proxmox::Compute::Server vmid: 100, ...>
|
231
231
|
>
|
232
232
|
```
|
233
233
|
|
@@ -362,7 +362,7 @@ Fetch server disk_images:
|
|
362
362
|
disk_images = server.disk_images
|
363
363
|
```
|
364
364
|
|
365
|
-
This returns an array of `Fog::Compute::
|
365
|
+
This returns an array of `Fog::Proxmox::Compute::Volume` instances.
|
366
366
|
|
367
367
|
Delete server:
|
368
368
|
|
@@ -403,7 +403,7 @@ You first fetch the backup volumes of this server:
|
|
403
403
|
volumes = server.backups
|
404
404
|
```
|
405
405
|
|
406
|
-
This returns an array of `Fog::Compute::
|
406
|
+
This returns an array of `Fog::Proxmox::Compute::Volume` instances.
|
407
407
|
|
408
408
|
Then you choose one:
|
409
409
|
|
@@ -411,10 +411,10 @@ Then you choose one:
|
|
411
411
|
backup = volumes[0] # local:backup/vzdump-qemu-100-2018_05_15-15_18_31.vma.lzo
|
412
412
|
```
|
413
413
|
|
414
|
-
This returns a `Fog::Compute::
|
414
|
+
This returns a `Fog::Proxmox::Compute::Volume` instance:
|
415
415
|
|
416
416
|
```ruby
|
417
|
-
<Fog::Compute::
|
417
|
+
<Fog::Proxmox::Compute::Volume
|
418
418
|
volid="local:backup/vzdump-qemu-100-2018_05_15-15_18_31.vma.lzo",
|
419
419
|
content="backup",
|
420
420
|
size=376,
|
@@ -522,7 +522,7 @@ List all containers:
|
|
522
522
|
node.containers.all
|
523
523
|
```
|
524
524
|
|
525
|
-
This returns a collection of `Fog::Identity::
|
525
|
+
This returns a collection of `Fog::Proxmox::Identity::Container` models which are inherited from `Fog::Proxmox::Identity::Server` because they have many common features.
|
526
526
|
|
527
527
|
Before creating a container you can get the next available container id (integer >= 100) in the cluster:
|
528
528
|
|
@@ -592,10 +592,10 @@ Get container configuration:
|
|
592
592
|
container.config
|
593
593
|
```
|
594
594
|
|
595
|
-
This returns a `Fog::Compute::
|
595
|
+
This returns a `Fog::Proxmox::Compute::ContainerConfig` model:
|
596
596
|
|
597
597
|
```ruby
|
598
|
-
<Fog::Compute::
|
598
|
+
<Fog::Proxmox::Compute::ContainerConfig
|
599
599
|
memory: 512,
|
600
600
|
net0: "name=eth0,bridge=vmbr0,hwaddr=BE:3C:A9:3F:4E:39,ip=dhcp,ip6=dhcp,type=veth",
|
601
601
|
swap: 512,
|
@@ -605,7 +605,7 @@ This returns a `Fog::Compute::Proxmox::ContainerConfig` model:
|
|
605
605
|
digest: "e5131befed2f6ff8e11d598c4d8bb6016d5c0901",
|
606
606
|
ostype: "alpine",
|
607
607
|
arch: "amd64"
|
608
|
-
container: <Fog::Compute::
|
608
|
+
container: <Fog::Proxmox::Compute::Container vmid: 100, ...>
|
609
609
|
>
|
610
610
|
```
|
611
611
|
|
@@ -720,7 +720,7 @@ You first fetch the backup volumes of this container:
|
|
720
720
|
volumes = container.backups
|
721
721
|
```
|
722
722
|
|
723
|
-
This returns an array of `Fog::Compute::
|
723
|
+
This returns an array of `Fog::Proxmox::Compute::Volume` instances.
|
724
724
|
|
725
725
|
Then you choose one:
|
726
726
|
|
@@ -728,10 +728,10 @@ Then you choose one:
|
|
728
728
|
backup = volumes[0] # local:backup/vzdump-qemu-100-2018_05_15-15_18_31.vma.lzo
|
729
729
|
```
|
730
730
|
|
731
|
-
This returns a `Fog::Compute::
|
731
|
+
This returns a `Fog::Proxmox::Compute::Volume` instance:
|
732
732
|
|
733
733
|
```ruby
|
734
|
-
<Fog::Compute::
|
734
|
+
<Fog::Proxmox::Compute::Volume
|
735
735
|
volid="local:backup/vzdump-qemu-100-2018_05_15-15_18_31.vma.lzo",
|
736
736
|
content="backup",
|
737
737
|
size=376,
|
data/docs/identity.md
CHANGED
@@ -19,7 +19,7 @@ require 'fog/proxmox'
|
|
19
19
|
## Create identity service
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
identity = Fog::Identity
|
22
|
+
identity = Fog::Proxmox::Identity.new(
|
23
23
|
pve_username: PVE_USERNAME, # your user name
|
24
24
|
pve_password: PVE_PASSWORD, # your password
|
25
25
|
pve_url: PVE_URL, # your server url
|
@@ -98,7 +98,7 @@ List all users:
|
|
98
98
|
identity.users.all
|
99
99
|
```
|
100
100
|
|
101
|
-
This returns a collection of `Fog::Identity::
|
101
|
+
This returns a collection of `Fog::Proxmox::Identity::User` models:
|
102
102
|
|
103
103
|
Create a user:
|
104
104
|
|
@@ -150,7 +150,7 @@ List all groups:
|
|
150
150
|
identity.groups.all
|
151
151
|
```
|
152
152
|
|
153
|
-
This returns a collection of `Fog::Identity::
|
153
|
+
This returns a collection of `Fog::Proxmox::Identity::Group` models:
|
154
154
|
|
155
155
|
Create a group:
|
156
156
|
|
@@ -191,7 +191,7 @@ List all domains:
|
|
191
191
|
identity.domains.all
|
192
192
|
```
|
193
193
|
|
194
|
-
This returns a collection of `Fog::Identity::
|
194
|
+
This returns a collection of `Fog::Proxmox::Identity::Domain` models:
|
195
195
|
|
196
196
|
Create a LDAP domain:
|
197
197
|
|
@@ -240,7 +240,7 @@ List all roles:
|
|
240
240
|
identity.roles.all
|
241
241
|
```
|
242
242
|
|
243
|
-
This returns a collection of `Fog::Identity::
|
243
|
+
This returns a collection of `Fog::Proxmox::Identity::Role` models:
|
244
244
|
|
245
245
|
Create a new role:
|
246
246
|
|
@@ -281,7 +281,7 @@ List all permissions:
|
|
281
281
|
identity.permissions.all
|
282
282
|
```
|
283
283
|
|
284
|
-
This returns a collection of `Fog::Identity::
|
284
|
+
This returns a collection of `Fog::Proxmox::Identity::Permission` models:
|
285
285
|
|
286
286
|
Add a new permission (manage users) to a user:
|
287
287
|
|
data/examples/compute.rb
CHANGED
data/examples/identity.rb
CHANGED
data/fog-proxmox.gemspec
CHANGED
@@ -53,10 +53,10 @@ Gem::Specification.new do |spec|
|
|
53
53
|
spec.add_development_dependency 'rubocop', '~> 0.55'
|
54
54
|
spec.add_development_dependency 'ruby-debug-ide', '~> 0.6'
|
55
55
|
spec.add_development_dependency 'simplecov'
|
56
|
-
spec.add_development_dependency 'vcr', '~>
|
57
|
-
spec.add_development_dependency 'webmock', '~> 3.
|
56
|
+
spec.add_development_dependency 'vcr', '~> 4.0'
|
57
|
+
spec.add_development_dependency 'webmock', '~> 3.5'
|
58
58
|
|
59
|
-
spec.add_dependency 'fog-core', '~> 1
|
60
|
-
spec.add_dependency 'fog-json', '~> 1.
|
59
|
+
spec.add_dependency 'fog-core', '~> 2.1'
|
60
|
+
spec.add_dependency 'fog-json', '~> 1.2'
|
61
61
|
spec.add_dependency 'ipaddress', '~> 0.8'
|
62
62
|
end
|
data/lib/fog/compute/proxmox.rb
CHANGED
@@ -20,9 +20,9 @@
|
|
20
20
|
require 'fog/proxmox/core'
|
21
21
|
|
22
22
|
module Fog
|
23
|
-
module
|
23
|
+
module Proxmox
|
24
24
|
# Proxmox compute service
|
25
|
-
class
|
25
|
+
class Compute < Fog::Service
|
26
26
|
requires :pve_url
|
27
27
|
recognizes :pve_ticket, :pve_path, :pve_ticket_expires,
|
28
28
|
:pve_csrftoken, :persistent, :current_user, :pve_username,
|
@@ -20,11 +20,11 @@
|
|
20
20
|
require 'fog/compute/proxmox/models/disk'
|
21
21
|
|
22
22
|
module Fog
|
23
|
-
module
|
24
|
-
class
|
23
|
+
module Proxmox
|
24
|
+
class Compute
|
25
25
|
# class Disks Collection of disk
|
26
26
|
class Disks < Fog::Collection
|
27
|
-
model Fog::Compute::
|
27
|
+
model Fog::Proxmox::Compute::Disk
|
28
28
|
|
29
29
|
def all
|
30
30
|
self
|
@@ -21,11 +21,11 @@ require 'fog/compute/proxmox/models/interface'
|
|
21
21
|
require 'fog/proxmox/helpers/controller_helper'
|
22
22
|
|
23
23
|
module Fog
|
24
|
-
module
|
25
|
-
class
|
24
|
+
module Proxmox
|
25
|
+
class Compute
|
26
26
|
# class Interfaces Collection of nodes of cluster
|
27
27
|
class Interfaces < Fog::Collection
|
28
|
-
model Fog::Compute::
|
28
|
+
model Fog::Proxmox::Compute::Interface
|
29
29
|
|
30
30
|
def all
|
31
31
|
self
|
@@ -36,7 +36,7 @@ module Fog
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def next_nicid
|
39
|
-
Fog::Proxmox::ControllerHelper.last_index(Fog::Compute::
|
39
|
+
Fog::Proxmox::ControllerHelper.last_index(Fog::Proxmox::Compute::Interface::NAME, self) + 1
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -29,8 +29,8 @@
|
|
29
29
|
require 'fog/proxmox/attributes'
|
30
30
|
|
31
31
|
module Fog
|
32
|
-
module
|
33
|
-
class
|
32
|
+
module Proxmox
|
33
|
+
class Compute
|
34
34
|
# class Node model of VMs
|
35
35
|
class Node < Fog::Model
|
36
36
|
identity :node
|
@@ -74,19 +74,19 @@ module Fog
|
|
74
74
|
private
|
75
75
|
|
76
76
|
def initialize_tasks
|
77
|
-
attributes[:tasks] = Fog::Compute::
|
77
|
+
attributes[:tasks] = Fog::Proxmox::Compute::Tasks.new(service: service, node_id: node)
|
78
78
|
end
|
79
79
|
|
80
80
|
def initialize_servers
|
81
|
-
attributes[:servers] = Fog::Compute::
|
81
|
+
attributes[:servers] = Fog::Proxmox::Compute::Servers.new(service: service, node_id: node, type: 'qemu')
|
82
82
|
end
|
83
83
|
|
84
84
|
def initialize_containers
|
85
|
-
attributes[:containers] = Fog::Compute::
|
85
|
+
attributes[:containers] = Fog::Proxmox::Compute::Servers.new(service: service, node_id: node, type: 'lxc')
|
86
86
|
end
|
87
87
|
|
88
88
|
def initialize_storages
|
89
|
-
attributes[:storages] = Fog::Compute::
|
89
|
+
attributes[:storages] = Fog::Proxmox::Compute::Storages.new(service: service, node_id: node)
|
90
90
|
end
|
91
91
|
|
92
92
|
end
|
@@ -20,11 +20,11 @@
|
|
20
20
|
require 'fog/compute/proxmox/models/node'
|
21
21
|
|
22
22
|
module Fog
|
23
|
-
module
|
24
|
-
class
|
23
|
+
module Proxmox
|
24
|
+
class Compute
|
25
25
|
# class Nodes Collection of nodes of cluster
|
26
26
|
class Nodes < Fog::Collection
|
27
|
-
model Fog::Compute::
|
27
|
+
model Fog::Proxmox::Compute::Node
|
28
28
|
|
29
29
|
def all
|
30
30
|
load service.list_nodes
|
@@ -23,8 +23,8 @@ require 'fog/proxmox/hash'
|
|
23
23
|
require 'fog/proxmox/errors'
|
24
24
|
|
25
25
|
module Fog
|
26
|
-
module
|
27
|
-
class
|
26
|
+
module Proxmox
|
27
|
+
class Compute
|
28
28
|
# Server model
|
29
29
|
class Server < Fog::Compute::Server
|
30
30
|
identity :vmid
|
@@ -233,21 +233,21 @@ module Fog
|
|
233
233
|
|
234
234
|
def initialize_config(new_attributes = {})
|
235
235
|
options = { service: service, vmid: vmid }
|
236
|
-
attributes[:config] = Fog::Compute::
|
236
|
+
attributes[:config] = Fog::Proxmox::Compute::ServerConfig.new(options.merge(new_attributes))
|
237
237
|
end
|
238
238
|
|
239
239
|
private
|
240
240
|
|
241
241
|
def initialize_snapshots
|
242
|
-
attributes[:snapshots] = Fog::Compute::
|
242
|
+
attributes[:snapshots] = Fog::Proxmox::Compute::Snapshots.new(service: service, server_id: vmid, server_type: type, node_id: node_id)
|
243
243
|
end
|
244
244
|
|
245
245
|
def initialize_tasks
|
246
|
-
attributes[:tasks] = Fog::Compute::
|
246
|
+
attributes[:tasks] = Fog::Proxmox::Compute::Tasks.new(service: service, node_id: node_id).select { |task| task.id == vmid }
|
247
247
|
end
|
248
248
|
|
249
249
|
def node
|
250
|
-
Fog::Compute::
|
250
|
+
Fog::Proxmox::Compute::Node.new(service: service, node: node_id)
|
251
251
|
end
|
252
252
|
end
|
253
253
|
end
|