crowbar-client 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +7 -0
  3. data/lib/crowbar/client/app.rb +3 -0
  4. data/lib/crowbar/client/app/entry.rb +4 -0
  5. data/lib/crowbar/client/app/upgrade.rb +280 -0
  6. data/lib/crowbar/client/command.rb +3 -0
  7. data/lib/crowbar/client/command/upgrade.rb +50 -0
  8. data/lib/crowbar/client/command/upgrade/backup.rb +45 -0
  9. data/lib/crowbar/client/command/upgrade/crowbar.rb +45 -0
  10. data/lib/crowbar/client/command/upgrade/node.rb +45 -0
  11. data/lib/crowbar/client/command/upgrade/prechecks.rb +61 -0
  12. data/lib/crowbar/client/command/upgrade/prepare.rb +45 -0
  13. data/lib/crowbar/client/command/upgrade/repocheck.rb +61 -0
  14. data/lib/crowbar/client/command/upgrade/services.rb +45 -0
  15. data/lib/crowbar/client/command/upgrade/status.rb +61 -0
  16. data/lib/crowbar/client/config.rb +2 -4
  17. data/lib/crowbar/client/request.rb +3 -0
  18. data/lib/crowbar/client/request/upgrade.rb +50 -0
  19. data/lib/crowbar/client/request/upgrade/backup.rb +83 -0
  20. data/lib/crowbar/client/request/upgrade/crowbar.rb +63 -0
  21. data/lib/crowbar/client/request/upgrade/node.rb +75 -0
  22. data/lib/crowbar/client/request/upgrade/prechecks.rb +63 -0
  23. data/lib/crowbar/client/request/upgrade/prepare.rb +63 -0
  24. data/lib/crowbar/client/request/upgrade/repocheck.rb +72 -0
  25. data/lib/crowbar/client/request/upgrade/services.rb +63 -0
  26. data/lib/crowbar/client/request/upgrade/status.rb +62 -0
  27. data/lib/crowbar/client/version.rb +2 -2
  28. data/spec/crowbar/client/command/upgrade/backup_spec.rb +34 -0
  29. data/spec/crowbar/client/command/upgrade/crowbar_spec.rb +31 -0
  30. data/spec/crowbar/client/command/upgrade/node_spec.rb +32 -0
  31. data/spec/crowbar/client/command/upgrade/prechecks_spec.rb +31 -0
  32. data/spec/crowbar/client/command/upgrade/prepare_spec.rb +31 -0
  33. data/spec/crowbar/client/command/upgrade/repocheck_spec.rb +34 -0
  34. data/spec/crowbar/client/command/upgrade/services_spec.rb +31 -0
  35. data/spec/crowbar/client/command/upgrade/status_spec.rb +31 -0
  36. data/spec/crowbar/client/request/backup/create_spec.rb +4 -0
  37. data/spec/crowbar/client/request/backup/delete_spec.rb +4 -0
  38. data/spec/crowbar/client/request/backup/download_spec.rb +4 -0
  39. data/spec/crowbar/client/request/backup/list_spec.rb +4 -0
  40. data/spec/crowbar/client/request/backup/restore_spec.rb +4 -0
  41. data/spec/crowbar/client/request/backup/upload_spec.rb +4 -0
  42. data/spec/crowbar/client/request/{party_spec.rb → rest_spec.rb} +3 -3
  43. data/spec/crowbar/client/request/upgrade/backup_spec.rb +53 -0
  44. data/spec/crowbar/client/request/upgrade/crowbar_spec.rb +53 -0
  45. data/spec/crowbar/client/request/upgrade/node_spec.rb +55 -0
  46. data/spec/crowbar/client/request/upgrade/prechecks_spec.rb +53 -0
  47. data/spec/crowbar/client/request/upgrade/prepare_spec.rb +53 -0
  48. data/spec/crowbar/client/request/upgrade/repocheck_spec.rb +56 -0
  49. data/spec/crowbar/client/request/upgrade/services_spec.rb +53 -0
  50. data/spec/crowbar/client/request/upgrade/status_spec.rb +53 -0
  51. metadata +55 -4
@@ -0,0 +1,62 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require "easy_diff"
18
+
19
+ module Crowbar
20
+ module Client
21
+ module Request
22
+ module Upgrade
23
+ #
24
+ # Implementation for the upgrade status request
25
+ #
26
+ class Status < Base
27
+ #
28
+ # Override the request headers
29
+ #
30
+ # @return [Hash] the headers for the request
31
+ #
32
+ def headers
33
+ super.easy_merge!(
34
+ ::Crowbar::Client::Util::ApiVersion.new(2.0).headers
35
+ )
36
+ end
37
+
38
+ #
39
+ # HTTP method that gets used by the request
40
+ #
41
+ # @return [Symbol] the method for the request
42
+ #
43
+ def method
44
+ :get
45
+ end
46
+
47
+ #
48
+ # Path to the API endpoint for the request
49
+ #
50
+ # @return [String] path to the API endpoint
51
+ #
52
+ def url
53
+ [
54
+ "api",
55
+ "upgrade"
56
+ ].join("/")
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -28,12 +28,12 @@ module Crowbar
28
28
  #
29
29
  # Minor version
30
30
  #
31
- MINOR = 0
31
+ MINOR = 1
32
32
 
33
33
  #
34
34
  # Patch version
35
35
  #
36
- PATCH = 1
36
+ PATCH = 0
37
37
 
38
38
  #
39
39
  # Optional suffix
@@ -0,0 +1,34 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Backup" do
20
+ include_context "command_context"
21
+
22
+ ["crowbar", "openstack"].each do |component|
23
+ it_behaves_like "a command class", true do
24
+ subject do
25
+ ::Crowbar::Client::Command::Upgrade::Backup.new(
26
+ stdin,
27
+ stdout,
28
+ stderr,
29
+ component: component
30
+ )
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Crowbar" do
20
+ include_context "command_context"
21
+
22
+ it_behaves_like "a command class", true do
23
+ subject do
24
+ ::Crowbar::Client::Command::Upgrade::Crowbar.new(
25
+ stdin,
26
+ stdout,
27
+ stderr
28
+ )
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Node" do
20
+ include_context "command_context"
21
+
22
+ it_behaves_like "a command class", true do
23
+ subject do
24
+ ::Crowbar::Client::Command::Upgrade::Node.new(
25
+ stdin,
26
+ stdout,
27
+ stderr,
28
+ id: 1
29
+ )
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Prepare" do
20
+ include_context "command_context"
21
+
22
+ it_behaves_like "a command class", true do
23
+ subject do
24
+ ::Crowbar::Client::Command::Upgrade::Prepare.new(
25
+ stdin,
26
+ stdout,
27
+ stderr
28
+ )
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Prechecks" do
20
+ include_context "command_context"
21
+
22
+ it_behaves_like "a command class", true do
23
+ subject do
24
+ ::Crowbar::Client::Command::Upgrade::Prechecks.new(
25
+ stdin,
26
+ stdout,
27
+ stderr
28
+ )
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,34 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Backup" do
20
+ include_context "command_context"
21
+
22
+ ["ha", "storage"].each do |addon|
23
+ it_behaves_like "a command class", true do
24
+ subject do
25
+ ::Crowbar::Client::Command::Upgrade::Backup.new(
26
+ stdin,
27
+ stdout,
28
+ stderr,
29
+ addon: addon
30
+ )
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Services" do
20
+ include_context "command_context"
21
+
22
+ it_behaves_like "a command class", true do
23
+ subject do
24
+ ::Crowbar::Client::Command::Upgrade::Services.new(
25
+ stdin,
26
+ stdout,
27
+ stderr
28
+ )
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../../../spec_helper"
18
+
19
+ describe "Crowbar::Client::Command::Upgrade::Status" do
20
+ include_context "command_context"
21
+
22
+ it_behaves_like "a command class", true do
23
+ subject do
24
+ ::Crowbar::Client::Command::Upgrade::Status.new(
25
+ stdin,
26
+ stdout,
27
+ stderr
28
+ )
29
+ end
30
+ end
31
+ end
@@ -18,6 +18,10 @@ require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Backup::Create" do
20
20
  it_behaves_like "a request class", true do
21
+ before(:each) do
22
+ ::Crowbar::Client::Config.apiversion = 2.0
23
+ end
24
+
21
25
  subject do
22
26
  ::Crowbar::Client::Request::Backup::Create.new(
23
27
  attrs
@@ -18,6 +18,10 @@ require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Backup::Delete" do
20
20
  it_behaves_like "a request class", true do
21
+ before(:each) do
22
+ ::Crowbar::Client::Config.apiversion = 2.0
23
+ end
24
+
21
25
  subject do
22
26
  ::Crowbar::Client::Request::Backup::Delete.new(
23
27
  attrs
@@ -18,6 +18,10 @@ require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Backup::Download" do
20
20
  it_behaves_like "a request class", true do
21
+ before(:each) do
22
+ ::Crowbar::Client::Config.apiversion = 2.0
23
+ end
24
+
21
25
  subject do
22
26
  ::Crowbar::Client::Request::Backup::Download.new(
23
27
  attrs
@@ -18,6 +18,10 @@ require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Backup::List" do
20
20
  it_behaves_like "a request class", true do
21
+ before(:each) do
22
+ ::Crowbar::Client::Config.apiversion = 2.0
23
+ end
24
+
21
25
  subject do
22
26
  ::Crowbar::Client::Request::Backup::List.new(
23
27
  attrs
@@ -18,6 +18,10 @@ require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Backup::Restore" do
20
20
  it_behaves_like "a request class", true do
21
+ before(:each) do
22
+ ::Crowbar::Client::Config.apiversion = 2.0
23
+ end
24
+
21
25
  subject do
22
26
  ::Crowbar::Client::Request::Backup::Restore.new(
23
27
  attrs
@@ -18,6 +18,10 @@ require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Backup::Upload" do
20
20
  it_behaves_like "a request class", false do
21
+ before(:each) do
22
+ ::Crowbar::Client::Config.apiversion = 2.0
23
+ end
24
+
21
25
  subject do
22
26
  ::Crowbar::Client::Request::Backup::Upload.new(
23
27
  attrs
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2015, SUSE Linux GmbH
2
+ # Copyright 2016, SUSE Linux GmbH
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
16
16
 
17
17
  require_relative "../../../spec_helper"
18
18
 
19
- describe "Crowbar::Client::Request::Party" do
20
- subject { ::Crowbar::Client::Request::Party }
19
+ describe "Crowbar::Client::Request::Rest" do
20
+ subject { ::Crowbar::Client::Request::Rest }
21
21
 
22
22
  pending
23
23
 
@@ -0,0 +1,53 @@
1
+
2
+ #
3
+ # Copyright 2016, SUSE Linux GmbH
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require_relative "../../../../spec_helper"
19
+
20
+ describe "Crowbar::Client::Request::Upgrade::Backup" do
21
+ it_behaves_like "a request class", true do
22
+ subject do
23
+ ::Crowbar::Client::Request::Upgrade::Backup.new(
24
+ attrs
25
+ )
26
+ end
27
+
28
+ let!(:attrs) do
29
+ {
30
+ component: "openstack"
31
+ }
32
+ end
33
+
34
+ let!(:params) do
35
+ nil
36
+ end
37
+
38
+ let!(:method) do
39
+ :post
40
+ end
41
+
42
+ let!(:url) do
43
+ "api/openstack/backup"
44
+ end
45
+
46
+ let!(:headers) do
47
+ {
48
+ "Content-Type" => "application/vnd.crowbar.v2.0+json",
49
+ "Accept" => "application/vnd.crowbar.v2.0+json"
50
+ }
51
+ end
52
+ end
53
+ end