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.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +7 -0
- data/.travis.yml +1 -0
- data/.vscode/launch.json +3 -21
- data/.vscode/settings.json +7 -7
- data/Gemfile.lock +39 -39
- data/README.md +9 -2
- data/examples/compute.rb +20 -23
- data/examples/identity.rb +16 -21
- data/fog-proxmox.gemspec +1 -2
- data/lib/fog/compute/proxmox.rb +2 -8
- data/lib/fog/compute/proxmox/models/disk.rb +13 -11
- data/lib/fog/compute/proxmox/models/disks.rb +3 -5
- data/lib/fog/compute/proxmox/models/interface.rb +6 -11
- data/lib/fog/compute/proxmox/models/interfaces.rb +3 -5
- data/lib/fog/compute/proxmox/models/node.rb +38 -43
- data/lib/fog/compute/proxmox/models/nodes.rb +5 -11
- data/lib/fog/compute/proxmox/models/server.rb +123 -80
- data/lib/fog/compute/proxmox/models/server_config.rb +56 -24
- data/lib/fog/compute/proxmox/models/servers.rb +34 -26
- data/lib/fog/compute/proxmox/models/snapshot.rb +28 -14
- data/lib/fog/compute/proxmox/models/snapshots.rb +9 -17
- data/lib/fog/compute/proxmox/models/storage.rb +15 -11
- data/lib/fog/compute/proxmox/models/storages.rb +13 -22
- data/lib/fog/compute/proxmox/models/task.rb +10 -14
- data/lib/fog/compute/proxmox/models/tasks.rb +9 -18
- data/lib/fog/compute/proxmox/models/volume.rb +12 -12
- data/lib/fog/compute/proxmox/models/volumes.rb +10 -19
- data/lib/fog/compute/proxmox/requests/action_server.rb +1 -4
- data/lib/fog/compute/proxmox/requests/clone_server.rb +1 -4
- data/lib/fog/compute/proxmox/requests/create_backup.rb +1 -4
- data/lib/fog/compute/proxmox/requests/create_server.rb +1 -4
- data/lib/fog/compute/proxmox/requests/create_snapshot.rb +1 -4
- data/lib/fog/compute/proxmox/requests/create_spice.rb +1 -4
- data/lib/fog/compute/proxmox/requests/create_term.rb +1 -4
- data/lib/fog/compute/proxmox/requests/create_vnc.rb +1 -4
- data/lib/fog/compute/proxmox/requests/delete_server.rb +1 -4
- data/lib/fog/compute/proxmox/requests/delete_snapshot.rb +1 -4
- data/lib/fog/compute/proxmox/requests/get_node_statistics.rb +1 -4
- data/lib/fog/compute/proxmox/requests/get_server_config.rb +1 -4
- data/lib/fog/compute/proxmox/requests/get_server_status.rb +1 -4
- data/lib/fog/compute/proxmox/requests/{get_snapshot.rb → get_snapshot_config.rb} +5 -8
- data/lib/fog/compute/proxmox/requests/get_task.rb +1 -4
- data/lib/fog/compute/proxmox/requests/get_vnc.rb +1 -4
- data/lib/fog/compute/proxmox/requests/list_nodes.rb +1 -2
- data/lib/fog/compute/proxmox/requests/list_storages.rb +3 -1
- data/lib/fog/compute/proxmox/requests/log_task.rb +1 -4
- data/lib/fog/compute/proxmox/requests/move_disk.rb +1 -4
- data/lib/fog/compute/proxmox/requests/move_volume.rb +1 -4
- data/lib/fog/compute/proxmox/requests/next_vmid.rb +5 -3
- data/lib/fog/compute/proxmox/requests/resize_container.rb +1 -4
- data/lib/fog/compute/proxmox/requests/status_task.rb +1 -4
- data/lib/fog/compute/proxmox/requests/update_server.rb +1 -4
- data/lib/fog/identity/proxmox.rb +2 -8
- data/lib/fog/identity/proxmox/models/domain.rb +25 -21
- data/lib/fog/identity/proxmox/models/{ldap.rb → domain_type.rb} +9 -18
- data/lib/fog/identity/proxmox/models/domains.rb +6 -76
- data/lib/fog/identity/proxmox/models/group.rb +6 -19
- data/lib/fog/identity/proxmox/models/groups.rb +6 -12
- data/lib/fog/identity/proxmox/models/permission.rb +27 -31
- data/lib/fog/identity/proxmox/models/permissions.rb +8 -25
- data/lib/fog/identity/proxmox/models/pool.rb +9 -22
- data/lib/fog/identity/proxmox/models/pools.rb +7 -13
- data/lib/fog/identity/proxmox/models/principal.rb +1 -6
- data/lib/fog/identity/proxmox/models/role.rb +7 -20
- data/lib/fog/identity/proxmox/models/roles.rb +6 -13
- data/lib/fog/identity/proxmox/models/user.rb +7 -21
- data/lib/fog/identity/proxmox/models/users.rb +6 -12
- data/lib/fog/identity/proxmox/requests/check_permissions.rb +1 -4
- data/lib/fog/identity/proxmox/requests/list_roles.rb +0 -1
- data/lib/fog/identity/proxmox/requests/read_version.rb +1 -5
- data/lib/fog/identity/proxmox/requests/update_group.rb +2 -3
- data/lib/fog/identity/proxmox/requests/{add_permission.rb → update_permissions.rb} +4 -4
- data/lib/fog/network/proxmox/models/network.rb +12 -18
- data/lib/fog/network/proxmox/models/networks.rb +11 -17
- data/lib/fog/network/proxmox/models/node.rb +14 -10
- data/lib/fog/network/proxmox/models/nodes.rb +5 -11
- data/lib/fog/network/proxmox/requests/create_network.rb +1 -4
- data/lib/fog/network/proxmox/requests/delete_network.rb +1 -4
- data/lib/fog/network/proxmox/requests/get_network.rb +1 -4
- data/lib/fog/network/proxmox/requests/get_node.rb +1 -4
- data/lib/fog/network/proxmox/requests/power_node.rb +1 -4
- data/lib/fog/network/proxmox/requests/update_network.rb +1 -4
- data/lib/fog/{compute/proxmox/requests/check_vmid.rb → proxmox/attributes.rb} +9 -17
- data/lib/fog/proxmox/core.rb +2 -1
- data/lib/fog/proxmox/helpers/cpu_helper.rb +6 -3
- data/lib/fog/proxmox/helpers/disk_helper.rb +1 -1
- data/lib/fog/proxmox/helpers/nic_helper.rb +37 -22
- data/lib/fog/proxmox/version.rb +1 -1
- data/lib/fog/storage/proxmox.rb +1 -1
- data/spec/compute_spec.rb +64 -45
- data/spec/fixtures/proxmox/compute/containers.yml +1684 -4137
- data/spec/fixtures/proxmox/compute/identity_ticket.yml +4 -4
- data/spec/fixtures/proxmox/compute/nodes.yml +21 -21
- data/spec/fixtures/proxmox/compute/servers.yml +3065 -7741
- data/spec/fixtures/proxmox/compute/snapshots.yml +279 -827
- data/spec/fixtures/proxmox/compute/storages.yml +60 -21
- data/spec/fixtures/proxmox/compute/tasks.yml +56 -98
- data/spec/fixtures/proxmox/identity/auth.yml +6 -6
- data/spec/fixtures/proxmox/identity/domains.yml +252 -84
- data/spec/fixtures/proxmox/identity/groups.yml +93 -54
- data/spec/fixtures/proxmox/identity/identity_ticket.yml +4 -4
- data/spec/fixtures/proxmox/identity/permissions.yml +317 -79
- data/spec/fixtures/proxmox/identity/pools.yml +266 -71
- data/spec/fixtures/proxmox/identity/read_version.yml +6 -6
- data/spec/fixtures/proxmox/identity/roles.yml +96 -57
- data/spec/fixtures/proxmox/identity/users.yml +224 -107
- data/spec/fixtures/proxmox/network/identity_ticket.yml +4 -4
- data/spec/fixtures/proxmox/network/networks.yml +54 -95
- data/spec/helpers/nic_helper_spec.rb +4 -4
- data/spec/identity_spec.rb +38 -46
- data/spec/network_spec.rb +1 -1
- metadata +9 -23
- data/lib/fog/compute/proxmox/models/container.rb +0 -86
- data/lib/fog/compute/proxmox/models/container_config.rb +0 -114
- data/lib/fog/compute/proxmox/models/containers.rb +0 -43
- data/lib/fog/compute/proxmox/requests/get_node.rb +0 -44
- data/lib/fog/compute/proxmox/requests/get_storage.rb +0 -44
- data/lib/fog/identity/proxmox/models/activedirectory.rb +0 -57
- data/lib/fog/identity/proxmox/models/oath.rb +0 -50
- data/lib/fog/identity/proxmox/models/pam.rb +0 -46
- data/lib/fog/identity/proxmox/models/pve.rb +0 -46
- data/lib/fog/identity/proxmox/models/yubico.rb +0 -51
- data/lib/fog/identity/proxmox/requests/remove_permission.rb +0 -42
- data/lib/fog/proxmox/models/collection.rb +0 -85
- data/lib/fog/proxmox/models/model.rb +0 -58
@@ -17,8 +17,6 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
@@ -28,12 +26,11 @@ module Fog
|
|
28
26
|
node = path_params[:node]
|
29
27
|
type = path_params[:type]
|
30
28
|
vmid = path_params[:vmid]
|
31
|
-
|
29
|
+
request(
|
32
30
|
expects: [200],
|
33
31
|
method: 'GET',
|
34
32
|
path: "nodes/#{node}/#{type}/#{vmid}/status/current"
|
35
33
|
)
|
36
|
-
Fog::Proxmox::Json.get_data(response)
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
@@ -17,30 +17,27 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
25
|
-
# class Real
|
23
|
+
# class Real get_snapshot_config request
|
26
24
|
class Real
|
27
|
-
def
|
25
|
+
def get_snapshot_config(path_params)
|
28
26
|
node = path_params[:node]
|
29
27
|
type = path_params[:type]
|
30
28
|
vmid = path_params[:vmid]
|
31
29
|
snapname = path_params[:snapname]
|
32
|
-
|
30
|
+
request(
|
33
31
|
expects: [200],
|
34
32
|
method: 'GET',
|
35
33
|
path: "nodes/#{node}/#{type}/#{vmid}/snapshot/#{snapname}/config"
|
36
34
|
)
|
37
|
-
Fog::Proxmox::Json.get_data(response)
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
41
|
-
# class Mock
|
38
|
+
# class Mock get_snapshot_config request
|
42
39
|
class Mock
|
43
|
-
def
|
40
|
+
def get_snapshot_config; end
|
44
41
|
end
|
45
42
|
end
|
46
43
|
end
|
@@ -18,20 +18,17 @@
|
|
18
18
|
|
19
19
|
# frozen_string_literal: true
|
20
20
|
|
21
|
-
require 'fog/proxmox/json'
|
22
|
-
|
23
21
|
module Fog
|
24
22
|
module Compute
|
25
23
|
class Proxmox
|
26
24
|
# class Real get_task collection
|
27
25
|
class Real
|
28
26
|
def get_task(node, upid)
|
29
|
-
|
27
|
+
request(
|
30
28
|
expects: [200],
|
31
29
|
method: 'GET',
|
32
30
|
path: "nodes/#{node}/tasks/#{upid}"
|
33
31
|
)
|
34
|
-
Fog::Proxmox::Json.get_data(response)
|
35
32
|
end
|
36
33
|
end
|
37
34
|
|
@@ -17,8 +17,6 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
@@ -28,13 +26,12 @@ module Fog
|
|
28
26
|
node = path_params[:node]
|
29
27
|
type = path_params[:type]
|
30
28
|
vmid = path_params[:vmid]
|
31
|
-
|
29
|
+
request(
|
32
30
|
expects: [101, 200],
|
33
31
|
method: 'GET',
|
34
32
|
path: "nodes/#{node}/#{type}/#{vmid}/vncwebsocket",
|
35
33
|
query: URI.encode_www_form(query_params)
|
36
34
|
)
|
37
|
-
Fog::Proxmox::Json.get_data(response)
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
@@ -18,12 +18,14 @@
|
|
18
18
|
|
19
19
|
# frozen_string_literal: true
|
20
20
|
|
21
|
+
require 'fog/proxmox/json'
|
22
|
+
|
21
23
|
module Fog
|
22
24
|
module Compute
|
23
25
|
class Proxmox
|
24
26
|
# class Real list_storages request
|
25
27
|
class Real
|
26
|
-
def list_storages(node, options)
|
28
|
+
def list_storages(node, options = {})
|
27
29
|
request(
|
28
30
|
expects: [200],
|
29
31
|
method: 'GET',
|
@@ -18,21 +18,18 @@
|
|
18
18
|
|
19
19
|
# frozen_string_literal: true
|
20
20
|
|
21
|
-
require 'fog/proxmox/json'
|
22
|
-
|
23
21
|
module Fog
|
24
22
|
module Compute
|
25
23
|
class Proxmox
|
26
24
|
# class Real log_task
|
27
25
|
class Real
|
28
26
|
def log_task(node, upid, options)
|
29
|
-
|
27
|
+
request(
|
30
28
|
expects: [200],
|
31
29
|
method: 'GET',
|
32
30
|
path: "nodes/#{node}/tasks/#{upid}/log",
|
33
31
|
query: URI.encode_www_form(options)
|
34
32
|
)
|
35
|
-
Fog::Proxmox::Json.get_data(response)
|
36
33
|
end
|
37
34
|
end
|
38
35
|
|
@@ -17,8 +17,6 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
@@ -27,13 +25,12 @@ module Fog
|
|
27
25
|
def move_disk(path_params, body_params)
|
28
26
|
node = path_params[:node]
|
29
27
|
vmid = path_params[:vmid]
|
30
|
-
|
28
|
+
request(
|
31
29
|
expects: [200],
|
32
30
|
method: 'POST',
|
33
31
|
path: "nodes/#{node}/qemu/#{vmid}/move_disk",
|
34
32
|
body: URI.encode_www_form(body_params)
|
35
33
|
)
|
36
|
-
Fog::Proxmox::Json.get_data(response)
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
@@ -17,8 +17,6 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
@@ -27,13 +25,12 @@ module Fog
|
|
27
25
|
def move_volume(path_params, body_params)
|
28
26
|
node = path_params[:node]
|
29
27
|
vmid = path_params[:vmid]
|
30
|
-
|
28
|
+
request(
|
31
29
|
expects: [200],
|
32
30
|
method: 'POST',
|
33
31
|
path: "nodes/#{node}/lxc/#{vmid}/move_volume",
|
34
32
|
body: URI.encode_www_form(body_params)
|
35
33
|
)
|
36
|
-
Fog::Proxmox::Json.get_data(response)
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
# Copyright 2018 Tristan Robert
|
4
3
|
|
5
4
|
# This file is part of Fog::Proxmox.
|
@@ -17,16 +16,19 @@
|
|
17
16
|
# You should have received a copy of the GNU General Public License
|
18
17
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
|
19
|
+
# frozen_string_literal: true
|
20
|
+
|
20
21
|
module Fog
|
21
22
|
module Compute
|
22
23
|
class Proxmox
|
23
24
|
# class Real next_vmid collection
|
24
25
|
class Real
|
25
|
-
def next_vmid
|
26
|
+
def next_vmid(options = {})
|
26
27
|
request(
|
27
28
|
expects: [200],
|
28
29
|
method: 'GET',
|
29
|
-
path: 'cluster/nextid'
|
30
|
+
path: 'cluster/nextid',
|
31
|
+
query: URI.encode_www_form(options)
|
30
32
|
)
|
31
33
|
end
|
32
34
|
end
|
@@ -17,8 +17,6 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
@@ -27,13 +25,12 @@ module Fog
|
|
27
25
|
def resize_container(path_params, body_params)
|
28
26
|
node = path_params[:node]
|
29
27
|
vmid = path_params[:vmid]
|
30
|
-
|
28
|
+
request(
|
31
29
|
expects: [200],
|
32
30
|
method: 'PUT',
|
33
31
|
path: "nodes/#{node}/lxc/#{vmid}/resize",
|
34
32
|
body: URI.encode_www_form(body_params)
|
35
33
|
)
|
36
|
-
Fog::Proxmox::Json.get_data(response)
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
@@ -18,20 +18,17 @@
|
|
18
18
|
|
19
19
|
# frozen_string_literal: true
|
20
20
|
|
21
|
-
require 'fog/proxmox/json'
|
22
|
-
|
23
21
|
module Fog
|
24
22
|
module Compute
|
25
23
|
class Proxmox
|
26
24
|
# class Real status_task
|
27
25
|
class Real
|
28
26
|
def status_task(node, upid)
|
29
|
-
|
27
|
+
request(
|
30
28
|
expects: [200],
|
31
29
|
method: 'GET',
|
32
30
|
path: "nodes/#{node}/tasks/#{upid}/status"
|
33
31
|
)
|
34
|
-
Fog::Proxmox::Json.get_data(response)
|
35
32
|
end
|
36
33
|
end
|
37
34
|
|
@@ -17,8 +17,6 @@
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
18
18
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
-
require 'fog/proxmox/json'
|
21
|
-
|
22
20
|
module Fog
|
23
21
|
module Compute
|
24
22
|
class Proxmox
|
@@ -28,13 +26,12 @@ module Fog
|
|
28
26
|
node = path_params[:node]
|
29
27
|
type = path_params[:type]
|
30
28
|
vmid = path_params[:vmid]
|
31
|
-
|
29
|
+
request(
|
32
30
|
expects: [200],
|
33
31
|
method: type == 'qemu' ? 'POST' : 'PUT',
|
34
32
|
path: "nodes/#{node}/#{type}/#{vmid}/config",
|
35
33
|
body: URI.encode_www_form(body_params)
|
36
34
|
)
|
37
|
-
Fog::Proxmox::Json.get_data(response)
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
data/lib/fog/identity/proxmox.rb
CHANGED
@@ -38,12 +38,7 @@ module Fog
|
|
38
38
|
model :role
|
39
39
|
collection :roles
|
40
40
|
model :domain
|
41
|
-
model :
|
42
|
-
model :pve
|
43
|
-
model :ldap
|
44
|
-
model :activedirectory
|
45
|
-
model :oath
|
46
|
-
model :yubico
|
41
|
+
model :domain_type
|
47
42
|
collection :domains
|
48
43
|
model :permission
|
49
44
|
collection :permissions
|
@@ -53,8 +48,7 @@ module Fog
|
|
53
48
|
# Manage permissions
|
54
49
|
request :check_permissions
|
55
50
|
request :list_permissions
|
56
|
-
request :
|
57
|
-
request :remove_permission
|
51
|
+
request :update_permissions
|
58
52
|
request :read_version
|
59
53
|
|
60
54
|
# Manage users
|
@@ -1,13 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2018 Tristan Robert
|
4
|
-
|
5
|
-
# This file is part of Fog::Proxmox.
|
6
|
-
|
7
|
-
# Fog::Proxmox is free software: you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation, either version 3 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
1
|
# Copyright 2018 Tristan Robert
|
12
2
|
|
13
3
|
# This file is part of Fog::Proxmox.
|
@@ -25,22 +15,24 @@
|
|
25
15
|
# You should have received a copy of the GNU General Public License
|
26
16
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
27
17
|
|
28
|
-
require 'fog/proxmox/models/model'
|
29
|
-
|
30
18
|
module Fog
|
31
19
|
module Identity
|
32
20
|
class Proxmox
|
33
21
|
# class Domain model authentication
|
34
|
-
class Domain < Fog::
|
22
|
+
class Domain < Fog::Model
|
35
23
|
identity :realm
|
24
|
+
attribute :comment
|
25
|
+
attribute :tfa
|
36
26
|
attribute :type
|
37
|
-
|
38
|
-
|
27
|
+
|
28
|
+
def initialize(new_attributes = {})
|
29
|
+
initialize_type(new_attributes)
|
30
|
+
super(new_attributes)
|
39
31
|
end
|
40
32
|
|
41
|
-
def
|
42
|
-
|
43
|
-
|
33
|
+
def save(new_attributes = {})
|
34
|
+
service.create_domain(type.attributes.merge(new_attributes).merge(attributes.reject { |attribute| [:type].include? attribute }))
|
35
|
+
reload
|
44
36
|
end
|
45
37
|
|
46
38
|
def destroy
|
@@ -51,9 +43,21 @@ module Fog
|
|
51
43
|
|
52
44
|
def update
|
53
45
|
requires :realm
|
54
|
-
|
55
|
-
|
56
|
-
|
46
|
+
service.update_domain(realm, type.attributes.merge(attributes).reject { |attribute| [:type, :realm].include? attribute })
|
47
|
+
reload
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def initialize_type(new_attributes = {})
|
53
|
+
if new_attributes.has_key? :realm
|
54
|
+
realm = new_attributes.delete(:realm)
|
55
|
+
elsif new_attributes.has_key? 'realm'
|
56
|
+
realm = new_attributes.delete('realm')
|
57
|
+
end
|
58
|
+
attributes[:type] = Fog::Identity::Proxmox::DomainType.new(new_attributes)
|
59
|
+
new_attributes.delete_if { |new_attribute| attributes[:type].attributes.has_key? new_attribute.to_sym }
|
60
|
+
new_attributes.store(:realm, realm)
|
57
61
|
end
|
58
62
|
end
|
59
63
|
end
|
@@ -1,13 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2018 Tristan Robert
|
4
|
-
|
5
|
-
# This file is part of Fog::Proxmox.
|
6
|
-
|
7
|
-
# Fog::Proxmox is free software: you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation, either version 3 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
1
|
# Copyright 2018 Tristan Robert
|
12
2
|
|
13
3
|
# This file is part of Fog::Proxmox.
|
@@ -25,14 +15,15 @@
|
|
25
15
|
# You should have received a copy of the GNU General Public License
|
26
16
|
# along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
|
27
17
|
|
28
|
-
require 'fog/proxmox/models/model'
|
29
|
-
|
30
18
|
module Fog
|
31
19
|
module Identity
|
32
20
|
class Proxmox
|
33
|
-
# class
|
34
|
-
class
|
21
|
+
# class Domain type model authentication
|
22
|
+
class DomainType < Fog::Model
|
35
23
|
identity :type
|
24
|
+
attribute :id
|
25
|
+
attribute :key
|
26
|
+
attribute :url
|
36
27
|
attribute :base_dn
|
37
28
|
attribute :bind_dn
|
38
29
|
attribute :capath
|
@@ -40,6 +31,7 @@ module Fog
|
|
40
31
|
attribute :certkey
|
41
32
|
attribute :comment
|
42
33
|
attribute :default
|
34
|
+
attribute :domain
|
43
35
|
attribute :port
|
44
36
|
attribute :secure
|
45
37
|
attribute :server1
|
@@ -47,10 +39,9 @@ module Fog
|
|
47
39
|
attribute :tfa
|
48
40
|
attribute :user_attr
|
49
41
|
attribute :verify
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
42
|
+
attribute :step
|
43
|
+
attribute :digits
|
44
|
+
|
54
45
|
end
|
55
46
|
end
|
56
47
|
end
|