foreman_snapshot_management 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/controllers/api/v2/snapshots_controller.rb +4 -4
- data/app/models/foreman_snapshot_management/snapshot.rb +1 -0
- data/config/routes.rb +3 -1
- data/lib/foreman_snapshot_management/version.rb +1 -1
- data/test/controllers/api/v2/snapshots_test.rb +3 -1
- data/test/controllers/foreman_snapshot_management/snapshots_controller_test.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57bbba1e33d99aefa82a4af43d69810abd02fee0bd56a971083a6d83950bf5f
|
4
|
+
data.tar.gz: f79a6a83310c1b0ee3f05ea2204cded44d690df624773ad642e88a9a323f372a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40e538d6c79a89036baa265408dbeecd99ce7fcb2c4cb9693e1bc92111001f592e8ea13d003028160b366ce2332702e0c51fedb2c07ec2a6ecbaab99622d5d91
|
7
|
+
data.tar.gz: a1c2345211c2d5eb3a2a6d63c74ca952d74351e014ad0f3b1957afcf6a5ba8dc3d3b9ddac69bd52344eeee235676f732f654d7bebfb46d9b69a655b0c904297f
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ module Api
|
|
8
8
|
before_action :check_snapshot_capability
|
9
9
|
before_action :find_resource, :only => %w[show update destroy revert]
|
10
10
|
|
11
|
-
api :GET, 'hosts/:host_id/snapshots
|
11
|
+
api :GET, '/hosts/:host_id/snapshots', N_('List all snapshots')
|
12
12
|
param :host_id, :identifier_dottable, :required => true
|
13
13
|
def index
|
14
14
|
@snapshots = resource_scope_for_index
|
@@ -27,17 +27,17 @@ module Api
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
api :POST, '/hosts/:host_id/snapshots
|
30
|
+
api :POST, '/hosts/:host_id/snapshots', N_('Create a snapshot')
|
31
31
|
param :host_id, :identifier_dottable, :required => true
|
32
32
|
param :include_ram, :bool, :default_value => false, :desc => N_('Whether to include the RAM state in the snapshot')
|
33
33
|
param_group :snapshot, :as => :create
|
34
34
|
|
35
35
|
def create
|
36
36
|
@snapshot = resource_class.new(snapshot_params.to_h.merge(host: @nested_obj).merge(include_ram: params[:include_ram]))
|
37
|
-
process_response @snapshot.
|
37
|
+
process_response @snapshot.create
|
38
38
|
end
|
39
39
|
|
40
|
-
api :PUT, '/hosts/:host_id/snapshots/:id
|
40
|
+
api :PUT, '/hosts/:host_id/snapshots/:id', N_('Update a snapshot')
|
41
41
|
param :host_id, :identifier_dottable, :required => true
|
42
42
|
param :id, :identifier_dottable, :required => true
|
43
43
|
param_group :snapshot
|
data/config/routes.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class Api::V2::SnapshotsControllerTest < ActionController::TestCase
|
4
|
+
let(:tax_location) { Location.find_by_name('Location 1') }
|
5
|
+
let(:tax_organization) { Organization.find_by_name('Organization 1') }
|
4
6
|
let(:compute_resource) do
|
5
|
-
cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions')
|
7
|
+
cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions', :locations => [tax_location], organizations: [tax_organization])
|
6
8
|
ComputeResource.find_by_id(cr.id)
|
7
9
|
end
|
8
10
|
let(:uuid) { '5032c8a5-9c5e-ba7a-3804-832a03e16381' }
|
@@ -2,8 +2,10 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module ForemanSnapshotManagement
|
4
4
|
class SnapshotsControllerTest < ActionController::TestCase
|
5
|
+
let(:tax_location) { Location.find_by_name('Location 1') }
|
6
|
+
let(:tax_organization) { Organization.find_by_name('Organization 1') }
|
5
7
|
let(:compute_resource) do
|
6
|
-
cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions')
|
8
|
+
cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions', :locations => [tax_location], organizations: [tax_organization])
|
7
9
|
ComputeResource.find_by_id(cr.id)
|
8
10
|
end
|
9
11
|
let(:uuid) { '5032c8a5-9c5e-ba7a-3804-832a03e16381' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_snapshot_management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -96,7 +96,7 @@ files:
|
|
96
96
|
- test/controllers/api/v2/snapshots_test.rb
|
97
97
|
- test/controllers/foreman_snapshot_management/snapshots_controller_test.rb
|
98
98
|
- test/test_plugin_helper.rb
|
99
|
-
homepage:
|
99
|
+
homepage: https://www.orcharhino.com
|
100
100
|
licenses: []
|
101
101
|
metadata: {}
|
102
102
|
post_install_message:
|