fog-proxmox 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/lib/fog/compute/proxmox/requests/action_server.rb +1 -0
  4. data/lib/fog/compute/proxmox/requests/clone_server.rb +1 -0
  5. data/lib/fog/compute/proxmox/requests/create_backup.rb +1 -0
  6. data/lib/fog/compute/proxmox/requests/create_server.rb +1 -0
  7. data/lib/fog/compute/proxmox/requests/create_snapshot.rb +3 -1
  8. data/lib/fog/compute/proxmox/requests/create_spice.rb +1 -0
  9. data/lib/fog/compute/proxmox/requests/create_term.rb +1 -0
  10. data/lib/fog/compute/proxmox/requests/create_vnc.rb +1 -0
  11. data/lib/fog/compute/proxmox/requests/delete_server.rb +1 -0
  12. data/lib/fog/compute/proxmox/requests/delete_snapshot.rb +3 -1
  13. data/lib/fog/compute/proxmox/requests/delete_volume.rb +1 -1
  14. data/lib/fog/compute/proxmox/requests/get_node_statistics.rb +2 -2
  15. data/lib/fog/compute/proxmox/requests/get_server_config.rb +18 -0
  16. data/lib/fog/compute/proxmox/requests/get_server_status.rb +21 -0
  17. data/lib/fog/compute/proxmox/requests/get_snapshot_config.rb +1 -1
  18. data/lib/fog/compute/proxmox/requests/get_task.rb +1 -1
  19. data/lib/fog/compute/proxmox/requests/get_vnc.rb +1 -0
  20. data/lib/fog/compute/proxmox/requests/get_volume.rb +1 -1
  21. data/lib/fog/compute/proxmox/requests/list_nodes.rb +8 -1
  22. data/lib/fog/compute/proxmox/requests/list_servers.rb +72 -1
  23. data/lib/fog/compute/proxmox/requests/list_snapshots.rb +24 -1
  24. data/lib/fog/compute/proxmox/requests/list_storages.rb +3 -1
  25. data/lib/fog/compute/proxmox/requests/list_tasks.rb +3 -1
  26. data/lib/fog/compute/proxmox/requests/list_volumes.rb +3 -1
  27. data/lib/fog/compute/proxmox/requests/log_task.rb +3 -1
  28. data/lib/fog/compute/proxmox/requests/migrate_server.rb +1 -1
  29. data/lib/fog/compute/proxmox/requests/move_disk.rb +1 -1
  30. data/lib/fog/compute/proxmox/requests/move_volume.rb +1 -1
  31. data/lib/fog/compute/proxmox/requests/next_vmid.rb +1 -0
  32. data/lib/fog/compute/proxmox/requests/resize_container.rb +1 -1
  33. data/lib/fog/compute/proxmox/requests/resize_server.rb +1 -1
  34. data/lib/fog/compute/proxmox/requests/rollback_snapshot.rb +3 -1
  35. data/lib/fog/compute/proxmox/requests/status_task.rb +1 -1
  36. data/lib/fog/compute/proxmox/requests/stop_task.rb +1 -1
  37. data/lib/fog/compute/proxmox/requests/template_server.rb +1 -0
  38. data/lib/fog/compute/proxmox/requests/update_server.rb +1 -0
  39. data/lib/fog/compute/proxmox/requests/update_snapshot.rb +1 -1
  40. data/lib/fog/proxmox/version.rb +1 -1
  41. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d03cdedefefcb299e2a86e1d53560f027fe9178ff076f47b5f349e89e9f801e6
4
- data.tar.gz: 3200e0a475d337e279d3a6d8a916f6f4aab8259debe6c7a3ef7a7e59487f9c55
3
+ metadata.gz: ff3b6b71744bd3bdf8b1d94ca042ab16d00918ec61fb061150a547fae82d0877
4
+ data.tar.gz: c91827f7fc32227d84e927f93c093d8c5722f1e351e333776bbf270b1ece66d1
5
5
  SHA512:
6
- metadata.gz: 63ce8917cda9c49a79fc935015cb11bbf423453ba9a40da51ae04678bfa1907e961214b2d2f47125954dedbee6b2a7dd50298391412d06dbdd6a0dacaee90100
7
- data.tar.gz: 6e1c8db4bd2c38731bfe0113b26b0d7d5d1ca241da6e03afa1f73675abcf266ba7edc0e7edf84f08c800053cd3ef45195e0c34f364c4bf57acda3ed7b917f297
6
+ metadata.gz: 4988ae1572d65c6ebc3530235c9400e8bb5f3badd1350f442ed013273a576cc13b6e1f74a644b623b1918388b3f54d5ba6e907d2fb933a287e1f24facc5b39c6
7
+ data.tar.gz: 6177e9300809132e8cc3c0f4c4739a3eabde32d32cd3049eb702044439030298837f823883d24b393be5aa1fe101ed141dcab2417a32f1b7c0bdd72500ec3450
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ spec/debug/
5
5
  coverage/
6
6
  TAGS
7
7
  Gemfile.lock
8
+ *.gem
@@ -38,6 +38,7 @@ module Fog
38
38
 
39
39
  # class Mock action_server request
40
40
  class Mock
41
+ def action_server(_path_params, _body_params); end
41
42
  end
42
43
  end
43
44
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock clone_server request
39
39
  class Mock
40
+ def clone_server(_path_params, _body_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -35,6 +35,7 @@ module Fog
35
35
 
36
36
  # class Mock create_backup request
37
37
  class Mock
38
+ def create_backup(_path_params, _body_params); end
38
39
  end
39
40
  end
40
41
  end
@@ -36,6 +36,7 @@ module Fog
36
36
 
37
37
  # class Mock create_server request
38
38
  class Mock
39
+ def create_server(_path_params, _body_params); end
39
40
  end
40
41
  end
41
42
  end
@@ -37,7 +37,9 @@ module Fog
37
37
 
38
38
  # class Mock create_snapshot request
39
39
  class Mock
40
- def create_snapshot; end
40
+ def create_snapshot(_path_params, _body_params)
41
+ 'UPID:proxmox:00003E13:6F21770F:5E37E2D0:qmsnapshot:100:root@pam:'
42
+ end
41
43
  end
42
44
  end
43
45
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock create_spice request
39
39
  class Mock
40
+ def create_spice(_path_params, _body_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock create_term request
39
39
  class Mock
40
+ def create_term(_path_params, _body_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock create_vnc request
39
39
  class Mock
40
+ def create_vnc(_path_params, _body_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -38,6 +38,7 @@ module Fog
38
38
 
39
39
  # class Mock delete_server request
40
40
  class Mock
41
+ def delete_server(_path_params, _body_params); end
41
42
  end
42
43
  end
43
44
  end
@@ -38,7 +38,9 @@ module Fog
38
38
 
39
39
  # class Mock delete_snapshot request
40
40
  class Mock
41
- def delete_snapshot; end
41
+ def delete_snapshot(_path_params, _query_params)
42
+ 'UPID:proxmox:00002CC5:646E24B1:5E1C7E26:qmdelsnapshot:100:root@pam:'
43
+ end
42
44
  end
43
45
  end
44
46
  end
@@ -33,7 +33,7 @@ module Fog
33
33
 
34
34
  # class Mock delete_volume request
35
35
  class Mock
36
- def delete_volume; end
36
+ def delete_volume(_node, _storage, _volume); end
37
37
  end
38
38
  end
39
39
  end
@@ -23,7 +23,7 @@ module Fog
23
23
  class Compute
24
24
  # class Real get_node_statistics request
25
25
  class Real
26
- def get_node_statistics(path_params,query_params)
26
+ def get_node_statistics(path_params, query_params)
27
27
  node = path_params[:node]
28
28
  output = path_params[:output]
29
29
  request(
@@ -37,7 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock get_statistics request
39
39
  class Mock
40
- def get_node_statistics; end
40
+ def get_node_statistics(_path_params, _query_params); end
41
41
  end
42
42
  end
43
43
  end
@@ -36,6 +36,24 @@ module Fog
36
36
 
37
37
  # class Mock get_server_config request
38
38
  class Mock
39
+ def get_server_config(_path_params)
40
+ {
41
+ :onboot => 0,
42
+ :memory => 512,
43
+ :ostype => 'l26',
44
+ :cores => 1,
45
+ :keyboard => 'en-us',
46
+ :digest => nil,
47
+ :smbios1 => nil,
48
+ :vmgenid => nil,
49
+ :balloon => 0,
50
+ :kvm => 0,
51
+ :cpu => 'cputype=kvm64',
52
+ :sockets => 1,
53
+ :bootdisk => 'scsi0',
54
+ :vga => 'std'
55
+ }
56
+ end
39
57
  end
40
58
  end
41
59
  end
@@ -36,6 +36,27 @@ module Fog
36
36
 
37
37
  # class Mock get_server_status request
38
38
  class Mock
39
+ def get_server_status(_path_params)
40
+ {
41
+ :netout => 0,
42
+ :ha => { 'managed' => 0 },
43
+ :mem => 0,
44
+ :vmid => '100',
45
+ :maxdisk => 8_589_934_592,
46
+ :diskread => 0,
47
+ :template => '',
48
+ :qmpstatus => 'stopped',
49
+ :diskwrite => 0,
50
+ :maxmem => 536_870_912,
51
+ :pid => nil,
52
+ :uptime => 0,
53
+ :status => 'stopped',
54
+ :cpu => 'cputype=kvm64',
55
+ :cpus => 1,
56
+ :disk => 0,
57
+ :netin => 0
58
+ }
59
+ end
39
60
  end
40
61
  end
41
62
  end
@@ -37,7 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock get_snapshot_config request
39
39
  class Mock
40
- def get_snapshot_config; end
40
+ def get_snapshot_config(_path_params); end
41
41
  end
42
42
  end
43
43
  end
@@ -34,7 +34,7 @@ module Fog
34
34
 
35
35
  # class Mock get_task collection
36
36
  class Mock
37
- def get_task(node, upid); end
37
+ def get_task(_node, _upid); end
38
38
  end
39
39
  end
40
40
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock get_vnc request
39
39
  class Mock
40
+ def get_vnc(_path_params, _query_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -35,7 +35,7 @@ module Fog
35
35
 
36
36
  # class Mock get_volume request
37
37
  class Mock
38
- def get_volume; end
38
+ def get_volume(_node, _storage, _volume); end
39
39
  end
40
40
  end
41
41
  end
@@ -34,7 +34,14 @@ module Fog
34
34
 
35
35
  # class Mock list_nodes request
36
36
  class Mock
37
- def list_nodes; end
37
+ def list_nodes
38
+ [
39
+ {
40
+ 'node' => 'proxmox',
41
+ 'type' => 'node'
42
+ }
43
+ ]
44
+ end
38
45
  end
39
46
  end
40
47
  end
@@ -35,7 +35,78 @@ module Fog
35
35
 
36
36
  # class Mock list_servers request
37
37
  class Mock
38
- def list_servers; end
38
+ def list_servers(_options = {})
39
+ if options[:type] == 'qemu'
40
+ [
41
+ {
42
+ 'vmid' => '100',
43
+ 'type' => 'qemu',
44
+ 'node_id' => 'proxmox',
45
+ 'config' => {
46
+ 'vmid' => '100',
47
+ 'description' => nil,
48
+ 'smbios1' => nil,
49
+ 'numa' => 0,
50
+ 'kvm' => 0,
51
+ 'vcpus' => nil,
52
+ 'cores' => 1,
53
+ 'bootdisk' => 'scsi0',
54
+ 'onboot' => 0,
55
+ 'boot' => nil,
56
+ 'agent' => '0',
57
+ 'scsihw' => nil,
58
+ 'sockets' => 1,
59
+ 'memory' => 512,
60
+ 'min_memory' => nil,
61
+ 'shares' => nil,
62
+ 'balloon' => 0,
63
+ 'cpu' => 'cputype=kvm64',
64
+ 'cpulimit' => nil,
65
+ 'cpuunits' => nil,
66
+ 'keyboard' => 'en-us',
67
+ 'vga' => 'std',
68
+ 'storage' => nil,
69
+ 'template' => '',
70
+ 'arch' => nil,
71
+ 'swap' => nil,
72
+ 'hostname' => nil,
73
+ 'nameserver' => nil,
74
+ 'searchdomain' => nil,
75
+ 'password' => nil,
76
+ 'startup' => nil,
77
+ 'console' => nil
78
+ },
79
+ 'digest' => nil,
80
+ 'maxdisk' => 8_589_934_592,
81
+ 'disk' => 0,
82
+ 'diskwrite' => 0,
83
+ 'diskread' => 0,
84
+ 'uptime' => 0,
85
+ 'netout' => 0,
86
+ 'netin' => 0,
87
+ 'cpu' => 'cputype=kvm64',
88
+ 'cpus' => 1,
89
+ 'template' => '',
90
+ 'status' => 'stopped',
91
+ 'maxcpu' => nil,
92
+ 'mem' => 0,
93
+ 'maxmem' => 536_870_912,
94
+ 'qmpstatus' => 'stopped',
95
+ 'ha' => { 'managed' => 0 },
96
+ 'pid' => nil,
97
+ 'blockstat' => nil,
98
+ 'balloon' => 0,
99
+ 'ballooninfo' => nil,
100
+ 'vmgenid' => nil,
101
+ 'lock' => nil,
102
+ 'maxswap' => nil,
103
+ 'swap' => nil
104
+ }
105
+ ]
106
+ else
107
+ []
108
+ end
109
+ end
39
110
  end
40
111
  end
41
112
  end
@@ -36,7 +36,30 @@ module Fog
36
36
 
37
37
  # class Mock list_snapshots request
38
38
  class Mock
39
- def list_snapshots; end
39
+ def list_snapshots(_path_params)
40
+ [
41
+ {
42
+ 'name' => 'snapshot1',
43
+ 'description' => 'latest snapshot',
44
+ 'snaptime' => 1_578_057_452,
45
+ 'vmstate' => 0,
46
+ 'node_id' => 'proxmox',
47
+ 'server_id' => '100',
48
+ 'server_type' => 'qemu',
49
+ 'vmgenid' => nil
50
+ },
51
+ {
52
+ 'name' => 'snapshot2',
53
+ 'description' => 'latest snapshot2',
54
+ 'snaptime' => 1_578_058_452,
55
+ 'vmstate' => 0,
56
+ 'node_id' => 'proxmox',
57
+ 'server_id' => '100',
58
+ 'server_type' => 'qemu',
59
+ 'vmgenid' => nil
60
+ }
61
+ ]
62
+ end
40
63
  end
41
64
  end
42
65
  end
@@ -37,7 +37,9 @@ module Fog
37
37
 
38
38
  # class Mock list_storages request
39
39
  class Mock
40
- def list_storages; end
40
+ def list_storages(_node, _options = {})
41
+ []
42
+ end
41
43
  end
42
44
  end
43
45
  end
@@ -35,7 +35,9 @@ module Fog
35
35
 
36
36
  # class Mock list_tasks request
37
37
  class Mock
38
- def list_tasks; end
38
+ def list_tasks(_node, _options = {})
39
+ []
40
+ end
39
41
  end
40
42
  end
41
43
  end
@@ -35,7 +35,9 @@ module Fog
35
35
 
36
36
  # class Mock list_volumes request
37
37
  class Mock
38
- def list_volumes; end
38
+ def list_volumes(_node, _storage, _options = {})
39
+ []
40
+ end
39
41
  end
40
42
  end
41
43
  end
@@ -35,7 +35,9 @@ module Fog
35
35
 
36
36
  # class Mock status_task
37
37
  class Mock
38
- def log_task(node, upid); end
38
+ def log_task(_node, _upid, options = {})
39
+ [{ 't' => 'TASK OK', 'n' => 1 }]
40
+ end
39
41
  end
40
42
  end
41
43
  end
@@ -37,7 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock migrate_server request
39
39
  class Mock
40
- def migrate_server; end
40
+ def migrate_server(_path_params, _body_params); end
41
41
  end
42
42
  end
43
43
  end
@@ -36,7 +36,7 @@ module Fog
36
36
 
37
37
  # class Mock move_disk request
38
38
  class Mock
39
- def move_disk; end
39
+ def move_disk(_path_params, _body_params); end
40
40
  end
41
41
  end
42
42
  end
@@ -36,7 +36,7 @@ module Fog
36
36
 
37
37
  # class Mock move_volume request
38
38
  class Mock
39
- def move_volume; end
39
+ def move_volume(_path_params, _body_params); end
40
40
  end
41
41
  end
42
42
  end
@@ -35,6 +35,7 @@ module Fog
35
35
 
36
36
  # class Mock next_vmid collection
37
37
  class Mock
38
+ def next_vmid; end
38
39
  end
39
40
  end
40
41
  end
@@ -36,7 +36,7 @@ module Fog
36
36
 
37
37
  # class Mock resize_container request
38
38
  class Mock
39
- def resize_container; end
39
+ def resize_container(_path_params, _body_params); end
40
40
  end
41
41
  end
42
42
  end
@@ -36,7 +36,7 @@ module Fog
36
36
 
37
37
  # class Mock resize_server request
38
38
  class Mock
39
- def resize_server; end
39
+ def resize_server(_path_params, _body_params); end
40
40
  end
41
41
  end
42
42
  end
@@ -39,7 +39,9 @@ module Fog
39
39
 
40
40
  # class Mock rollback_snapshot request
41
41
  class Mock
42
- def rollback_snapshot; end
42
+ def rollback_snapshot(_path_params)
43
+ 'UPID:proxmox:00002EBF:646E2BF3:5E1C7E39:qmrollback:100:root@pam:'
44
+ end
43
45
  end
44
46
  end
45
47
  end
@@ -34,7 +34,7 @@ module Fog
34
34
 
35
35
  # class Mock status_task
36
36
  class Mock
37
- def status_task(node, upid); end
37
+ def status_task(_node, _upid); end
38
38
  end
39
39
  end
40
40
  end
@@ -34,7 +34,7 @@ module Fog
34
34
 
35
35
  # class Mock get_task collection
36
36
  class Mock
37
- def stop_task(taskid); end
37
+ def stop_task(_node, _taskid); end
38
38
  end
39
39
  end
40
40
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock template_server request
39
39
  class Mock
40
+ def template_server(_path_params, _body_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -37,6 +37,7 @@ module Fog
37
37
 
38
38
  # class Mock update_server request
39
39
  class Mock
40
+ def update_server(_path_params, _body_params); end
40
41
  end
41
42
  end
42
43
  end
@@ -38,7 +38,7 @@ module Fog
38
38
 
39
39
  # class Mock update_snapshot request
40
40
  class Mock
41
- def update_snapshot; end
41
+ def update_snapshot(_path_params, _body_params); end
42
42
  end
43
43
  end
44
44
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Fog
21
21
  module Proxmox
22
- VERSION = '0.11.0'
22
+ VERSION = '0.11.1'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-proxmox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tristan Robert