fog-proxmox 0.9.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +12 -0
- data/.github/workflows/ci.yml +79 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +1 -1
- data/README.md +10 -8
- data/fog-proxmox.gemspec +3 -3
- data/lib/fog/compute/proxmox/models/interface.rb +2 -0
- data/lib/fog/compute/proxmox/models/server.rb +0 -1
- data/lib/fog/compute/proxmox/models/server_config.rb +1 -1
- data/lib/fog/compute/proxmox/models/snapshot.rb +4 -5
- data/lib/fog/compute/proxmox/models/storage.rb +2 -3
- data/lib/fog/compute/proxmox/models/task.rb +2 -3
- data/lib/fog/compute/proxmox/models/volume.rb +3 -3
- data/lib/fog/compute/proxmox/requests/action_server.rb +1 -0
- data/lib/fog/compute/proxmox/requests/clone_server.rb +1 -0
- data/lib/fog/compute/proxmox/requests/create_backup.rb +1 -0
- data/lib/fog/compute/proxmox/requests/create_server.rb +1 -0
- data/lib/fog/compute/proxmox/requests/create_snapshot.rb +3 -1
- data/lib/fog/compute/proxmox/requests/create_spice.rb +1 -0
- data/lib/fog/compute/proxmox/requests/create_term.rb +1 -0
- data/lib/fog/compute/proxmox/requests/create_vnc.rb +1 -0
- data/lib/fog/compute/proxmox/requests/delete_server.rb +1 -0
- data/lib/fog/compute/proxmox/requests/delete_snapshot.rb +3 -1
- data/lib/fog/compute/proxmox/requests/delete_volume.rb +1 -1
- data/lib/fog/compute/proxmox/requests/get_node_statistics.rb +2 -2
- data/lib/fog/compute/proxmox/requests/get_server_config.rb +18 -0
- data/lib/fog/compute/proxmox/requests/get_server_status.rb +21 -0
- data/lib/fog/compute/proxmox/requests/get_snapshot_config.rb +1 -1
- data/lib/fog/compute/proxmox/requests/get_task.rb +1 -1
- data/lib/fog/compute/proxmox/requests/get_vnc.rb +1 -0
- data/lib/fog/compute/proxmox/requests/get_volume.rb +1 -1
- data/lib/fog/compute/proxmox/requests/list_nodes.rb +8 -1
- data/lib/fog/compute/proxmox/requests/list_servers.rb +72 -1
- data/lib/fog/compute/proxmox/requests/list_snapshots.rb +24 -1
- data/lib/fog/compute/proxmox/requests/list_storages.rb +3 -1
- data/lib/fog/compute/proxmox/requests/list_tasks.rb +3 -1
- data/lib/fog/compute/proxmox/requests/list_volumes.rb +3 -1
- data/lib/fog/compute/proxmox/requests/log_task.rb +3 -1
- data/lib/fog/compute/proxmox/requests/migrate_server.rb +1 -1
- data/lib/fog/compute/proxmox/requests/move_disk.rb +1 -1
- data/lib/fog/compute/proxmox/requests/move_volume.rb +1 -1
- data/lib/fog/compute/proxmox/requests/next_vmid.rb +1 -0
- data/lib/fog/compute/proxmox/requests/resize_container.rb +1 -1
- data/lib/fog/compute/proxmox/requests/resize_server.rb +1 -1
- data/lib/fog/compute/proxmox/requests/rollback_snapshot.rb +3 -1
- data/lib/fog/compute/proxmox/requests/status_task.rb +1 -1
- data/lib/fog/compute/proxmox/requests/stop_task.rb +1 -1
- data/lib/fog/compute/proxmox/requests/template_server.rb +1 -0
- data/lib/fog/compute/proxmox/requests/update_server.rb +1 -0
- data/lib/fog/compute/proxmox/requests/update_snapshot.rb +1 -1
- data/lib/fog/identity/proxmox/models/pool.rb +18 -0
- data/lib/fog/identity/proxmox/models/pools.rb +3 -1
- data/lib/fog/proxmox/core.rb +1 -1
- data/lib/fog/proxmox/helpers/controller_helper.rb +1 -1
- data/lib/fog/proxmox/helpers/cpu_helper.rb +1 -1
- data/lib/fog/proxmox/helpers/disk_helper.rb +16 -0
- data/lib/fog/proxmox/helpers/ip_helper.rb +100 -0
- data/lib/fog/proxmox/helpers/nic_helper.rb +16 -2
- data/lib/fog/proxmox/version.rb +1 -1
- data/spec/fixtures/proxmox/identity/auth.yml +8 -8
- data/spec/fixtures/proxmox/identity/domains.yml +119 -115
- data/spec/fixtures/proxmox/identity/groups.yml +51 -51
- data/spec/fixtures/proxmox/identity/identity_ticket.yml +6 -6
- data/spec/fixtures/proxmox/identity/permissions.yml +122 -122
- data/spec/fixtures/proxmox/identity/pools.yml +603 -95
- data/spec/fixtures/proxmox/identity/read_version.yml +6 -6
- data/spec/fixtures/proxmox/identity/renew.yml +6 -6
- data/spec/fixtures/proxmox/identity/roles.yml +59 -59
- data/spec/fixtures/proxmox/identity/users.yml +111 -111
- data/spec/helpers/controller_helper_spec.rb +13 -2
- data/spec/helpers/cpu_helper_spec.rb +2 -2
- data/spec/helpers/disk_helper_spec.rb +12 -0
- data/spec/helpers/ip_helper_spec.rb +160 -0
- data/spec/helpers/nic_helper_spec.rb +18 -4
- data/spec/identity_spec.rb +6 -0
- metadata +14 -12
- data/.gitlab-ci.yml +0 -50
- data/.travis.yml +0 -25
- data/Gemfile.lock +0 -153
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c14d0c2b9706b9ccf13d70fb4b3f06496d74ab2469c93eed134e9ec1beffb37
|
4
|
+
data.tar.gz: d7919eb9e2d9dff9a92f4377ef9bb0b101b5994b8e459b36443bb1881b6a3387
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4fe53a4bd62f5a3664287d9b3a7683379537bddf315a907e8ee80ead4f2c00e76168e9da34c9fb4cdd2a1ad3b31aba4adc465622ca691d7f4db870a5c80755b
|
7
|
+
data.tar.gz: 77cc6f9f1da87e845ddc442372fe827c58684aab525acf5f4c97fc2793e6f1ae4050cbbbfb3465f7e1e5b615b89c9ad521c1fdc56d143b37fa1a02086d347ef9
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# These are supported funding model platforms
|
2
|
+
|
3
|
+
github: [tristanrobert] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
+
patreon: # Replace with a single Patreon username
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
11
|
+
otechie: # Replace with a single Otechie username
|
12
|
+
custom: ["https://paypal.me/TristanRobert"]# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
@@ -0,0 +1,79 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
release:
|
9
|
+
types: [created]
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: 2.6
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle install
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake test spec audit
|
24
|
+
- name: Upload results for coverage
|
25
|
+
uses: actions/upload-artifact@v1
|
26
|
+
with:
|
27
|
+
name: coverage
|
28
|
+
path: coverage/
|
29
|
+
|
30
|
+
coverage:
|
31
|
+
needs: [ test ]
|
32
|
+
name: coverage
|
33
|
+
runs-on: ubuntu-latest
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
- name: Download tests result from test
|
37
|
+
uses: actions/download-artifact@v1
|
38
|
+
with:
|
39
|
+
name: coverage
|
40
|
+
- name: Install Code Climate test-reporter
|
41
|
+
run: |
|
42
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
43
|
+
chmod +x ./cc-test-reporter
|
44
|
+
- name: Format code coverage
|
45
|
+
env:
|
46
|
+
GIT_BRANCH: ${{ github.ref }}
|
47
|
+
GIT_COMMIT_SHA: ${{ github.sha }}
|
48
|
+
run: |
|
49
|
+
export GIT_COMMITTED_AT="$(date +%s)"
|
50
|
+
./cc-test-reporter format-coverage -d -t simplecov -o coverage/codeclimate.json coverage/.resultset.json
|
51
|
+
- name: Publish code coverage
|
52
|
+
env:
|
53
|
+
GIT_BRANCH: ${{ github.ref }}
|
54
|
+
GIT_COMMIT_SHA: ${{ github.sha }}
|
55
|
+
run: |
|
56
|
+
export GIT_COMMITTED_AT="$(date +%s)"
|
57
|
+
./cc-test-reporter upload-coverage -d -r ${{secrets.CC_TEST_REPORTER_ID}}
|
58
|
+
|
59
|
+
publish:
|
60
|
+
needs: [ test ]
|
61
|
+
name: publish
|
62
|
+
runs-on: ubuntu-latest
|
63
|
+
if: contains(github.ref, '/tags/v')
|
64
|
+
steps:
|
65
|
+
- uses: actions/checkout@v2
|
66
|
+
- name: Set up Ruby 2.6
|
67
|
+
uses: actions/setup-ruby@v1
|
68
|
+
with:
|
69
|
+
version: 2.6.x
|
70
|
+
- name: Publish to RubyGems
|
71
|
+
env:
|
72
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
73
|
+
run: |
|
74
|
+
mkdir -p $HOME/.gem
|
75
|
+
touch $HOME/.gem/credentials
|
76
|
+
chmod 0600 $HOME/.gem/credentials
|
77
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
78
|
+
gem build *.gemspec
|
79
|
+
gem push *.gem
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
# Fog::Proxmox
|
4
4
|
|
5
|
-
|
5
|
+
![CI](https://github.com/fog/fog-proxmox/workflows/CI/badge.svg)
|
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
|
+
[![Gem Version](https://badge.fury.io/rb/fog-proxmox.svg)](https://badge.fury.io/rb/fog-proxmox)
|
8
9
|
|
9
|
-
This is a [FOG](http://fog.io/) (>= 1
|
10
|
+
This is a [FOG](http://fog.io/) (>= 2.1) module gem to support [Proxmox VE](https://www.proxmox.com/en/proxmox-ve)
|
10
11
|
|
11
12
|
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
13
|
|
@@ -14,12 +15,13 @@ It is inspired by the great [fog-openstack](https://github.com/fog/fog-openstack
|
|
14
15
|
|
15
16
|
## Compatibility versions
|
16
17
|
|
17
|
-
|Fog-Proxmox|Proxmox VE|
|
18
|
-
|
19
|
-
|<0.6|<5.3|
|
20
|
-
|>=0.6|>=5.3|
|
21
|
-
|>=0.8|>=5.4|
|
22
|
-
|>=0.9|>=6.0|
|
18
|
+
|Fog-Proxmox|Proxmox VE|Fog-core|ruby|
|
19
|
+
|--|--|--|--|
|
20
|
+
|<0.6|<5.3|>=1.45|>=2.3|
|
21
|
+
|>=0.6|>=5.3|>=1.45|>=2.3|
|
22
|
+
|>=0.8|>=5.4|>=1.45|>=2.3|
|
23
|
+
|>=0.9|>=6.0|>=2.1|>=2.3|
|
24
|
+
|>=0.10|>=6.0|>=2.1|>=2.5|
|
23
25
|
|
24
26
|
## Installation
|
25
27
|
|
data/fog-proxmox.gemspec
CHANGED
@@ -36,10 +36,10 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
37
37
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
38
38
|
spec.require_paths = ['lib']
|
39
|
-
spec.required_ruby_version = '>= 2.
|
39
|
+
spec.required_ruby_version = '>= 2.5'
|
40
40
|
spec.rubygems_version = '~> 2.6'
|
41
41
|
|
42
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
42
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
43
43
|
spec.add_development_dependency 'debase', '~> 0.2.2'
|
44
44
|
spec.add_development_dependency 'debride', '~> 1.8'
|
45
45
|
spec.add_development_dependency 'fasterer', '~> 0.3'
|
@@ -52,7 +52,7 @@ Gem::Specification.new do |spec|
|
|
52
52
|
spec.add_development_dependency 'rspec', '~> 3.7'
|
53
53
|
spec.add_development_dependency 'rubocop', '~> 0.55'
|
54
54
|
spec.add_development_dependency 'ruby-debug-ide', '~> 0.6'
|
55
|
-
spec.add_development_dependency 'simplecov'
|
55
|
+
spec.add_development_dependency 'simplecov', '0.17'
|
56
56
|
spec.add_development_dependency 'vcr', '~> 4.0'
|
57
57
|
spec.add_development_dependency 'webmock', '~> 3.5'
|
58
58
|
spec.add_development_dependency 'bundler-audit', '~> 0.6'
|
@@ -30,6 +30,7 @@ module Fog
|
|
30
30
|
attribute :description
|
31
31
|
attribute :ostype
|
32
32
|
attribute :smbios1
|
33
|
+
attribute :bios
|
33
34
|
attribute :numa
|
34
35
|
attribute :kvm
|
35
36
|
attribute :vcpus
|
@@ -41,7 +42,6 @@ module Fog
|
|
41
42
|
attribute :scsihw
|
42
43
|
attribute :sockets
|
43
44
|
attribute :memory
|
44
|
-
attribute :min_memory
|
45
45
|
attribute :shares
|
46
46
|
attribute :balloon
|
47
47
|
attribute :name
|
@@ -41,11 +41,10 @@ module Fog
|
|
41
41
|
|
42
42
|
def initialize(new_attributes = {})
|
43
43
|
prepare_service_value(new_attributes)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
attributes[:name] = new_attributes['name'] unless new_attributes['name'].nil?
|
44
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes)
|
45
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('server_id', attributes, new_attributes)
|
46
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('server_type', attributes, new_attributes)
|
47
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('name', attributes, new_attributes)
|
49
48
|
requires :node_id, :server_id, :server_type, :name
|
50
49
|
super(new_attributes)
|
51
50
|
end
|
@@ -46,9 +46,8 @@ module Fog
|
|
46
46
|
|
47
47
|
def initialize(new_attributes = {})
|
48
48
|
prepare_service_value(new_attributes)
|
49
|
-
|
50
|
-
|
51
|
-
attributes[:storage] = new_attributes['storage'] unless new_attributes['storage'].nil?
|
49
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes)
|
50
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('storage', attributes, new_attributes)
|
52
51
|
requires :node_id, :storage
|
53
52
|
initialize_volumes
|
54
53
|
super(new_attributes)
|
@@ -47,9 +47,8 @@ module Fog
|
|
47
47
|
|
48
48
|
def initialize(new_attributes = {})
|
49
49
|
prepare_service_value(new_attributes)
|
50
|
-
|
51
|
-
|
52
|
-
attributes[:upid] = new_attributes['upid'] unless new_attributes['upid'].nil?
|
50
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes)
|
51
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('upid', attributes, new_attributes)
|
53
52
|
requires :node_id, :upid
|
54
53
|
super(new_attributes)
|
55
54
|
end
|
@@ -41,9 +41,9 @@ module Fog
|
|
41
41
|
|
42
42
|
def initialize(new_attributes = {})
|
43
43
|
prepare_service_value(new_attributes)
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes)
|
45
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('storage_id', attributes, new_attributes)
|
46
|
+
Fog::Proxmox::Attributes.set_attr_and_sym('volid', attributes, new_attributes)
|
47
47
|
requires :node_id, :storage_id, :volid
|
48
48
|
super(new_attributes)
|
49
49
|
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
|