crowbar-client 2.3.0 → 2.4.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/crowbar/client/app/backup.rb +87 -21
  4. data/lib/crowbar/client/app/base.rb +20 -0
  5. data/lib/crowbar/client/app/batch.rb +44 -31
  6. data/lib/crowbar/client/app/host_ip.rb +2 -0
  7. data/lib/crowbar/client/app/interface.rb +2 -0
  8. data/lib/crowbar/client/app/virtual_ip.rb +2 -0
  9. data/lib/crowbar/client/command/backup.rb +3 -0
  10. data/lib/crowbar/client/command/backup/delete.rb +2 -0
  11. data/lib/crowbar/client/command/backup/download.rb +21 -14
  12. data/lib/crowbar/client/command/backup/list.rb +6 -3
  13. data/lib/crowbar/client/command/backup/restore.rb +42 -0
  14. data/lib/crowbar/client/command/backup/upload.rb +13 -0
  15. data/lib/crowbar/client/command/base.rb +3 -0
  16. data/lib/crowbar/client/command/batch/build.rb +26 -0
  17. data/lib/crowbar/client/command/batch/export.rb +43 -0
  18. data/lib/crowbar/client/command/installer/start.rb +2 -0
  19. data/lib/crowbar/client/filter/hash.rb +1 -1
  20. data/lib/crowbar/client/request/backup.rb +3 -0
  21. data/lib/crowbar/client/request/backup/create.rb +1 -3
  22. data/lib/crowbar/client/request/backup/delete.rb +1 -1
  23. data/lib/crowbar/client/request/backup/download.rb +1 -1
  24. data/lib/crowbar/client/request/backup/restore.rb +38 -0
  25. data/lib/crowbar/client/request/backup/upload.rb +0 -2
  26. data/lib/crowbar/client/request/batch/build.rb +17 -2
  27. data/lib/crowbar/client/request/batch/export.rb +22 -2
  28. data/lib/crowbar/client/version.rb +1 -1
  29. data/spec/crowbar/client/command/backup/create_spec.rb +1 -3
  30. data/spec/crowbar/client/command/backup/delete_spec.rb +1 -2
  31. data/spec/crowbar/client/command/backup/download_spec.rb +1 -1
  32. data/spec/crowbar/client/command/backup/restore_spec.rb +40 -0
  33. data/spec/crowbar/client/command/backup/upload_spec.rb +4 -1
  34. data/spec/crowbar/client/command/batch/build_spec.rb +5 -1
  35. data/spec/crowbar/client/request/backup/create_spec.rb +2 -4
  36. data/spec/crowbar/client/request/backup/delete_spec.rb +2 -2
  37. data/spec/crowbar/client/request/backup/download_spec.rb +2 -2
  38. data/spec/crowbar/client/request/backup/list_spec.rb +2 -4
  39. data/spec/crowbar/client/request/backup/restore_spec.rb +52 -0
  40. data/spec/crowbar/client/request/batch/build_spec.rb +35 -44
  41. data/spec/crowbar/client/request/batch/export_spec.rb +33 -44
  42. data/spec/crowbar/client/request/proposal/create_spec.rb +2 -1
  43. data/spec/crowbar/client/request/proposal/edit_spec.rb +2 -1
  44. data/spec/fixtures/batch.yml +0 -0
  45. metadata +11 -3
@@ -24,7 +24,10 @@ describe "Crowbar::Client::Command::Backup::Upload" do
24
24
  stdin,
25
25
  stdout,
26
26
  stderr,
27
- file: Tempfile.new("test")
27
+ {},
28
+ file: fixture_path(
29
+ "upload.tgz"
30
+ )
28
31
  )
29
32
  end
30
33
 
@@ -23,7 +23,11 @@ describe "Crowbar::Client::Command::Batch::Build" do
23
23
  ::Crowbar::Client::Command::Batch::Build.new(
24
24
  stdin,
25
25
  stdout,
26
- stderr
26
+ stderr,
27
+ {},
28
+ file: fixture_path(
29
+ "batch.yml"
30
+ )
27
31
  )
28
32
  end
29
33
 
@@ -26,15 +26,13 @@ describe "Crowbar::Client::Request::Backup::Create" do
26
26
 
27
27
  let!(:attrs) do
28
28
  {
29
- backup: "test-backup"
29
+ name: "test-backup"
30
30
  }
31
31
  end
32
32
 
33
33
  let!(:params) do
34
34
  {
35
- backup: {
36
- name: "test-backup"
37
- }
35
+ name: "test-backup"
38
36
  }
39
37
  end
40
38
 
@@ -26,7 +26,7 @@ describe "Crowbar::Client::Request::Backup::Delete" do
26
26
 
27
27
  let!(:attrs) do
28
28
  {
29
- id: 1
29
+ name: "foo"
30
30
  }
31
31
  end
32
32
 
@@ -40,7 +40,7 @@ describe "Crowbar::Client::Request::Backup::Delete" do
40
40
  end
41
41
 
42
42
  let!(:url) do
43
- "utils/backups/1"
43
+ "utils/backups/foo"
44
44
  end
45
45
 
46
46
  let!(:headers) do
@@ -26,7 +26,7 @@ describe "Crowbar::Client::Request::Backup::Download" do
26
26
 
27
27
  let!(:attrs) do
28
28
  {
29
- id: 1
29
+ name: "foo"
30
30
  }
31
31
  end
32
32
 
@@ -40,7 +40,7 @@ describe "Crowbar::Client::Request::Backup::Download" do
40
40
  end
41
41
 
42
42
  let!(:url) do
43
- "utils/backups/1/download"
43
+ "utils/backups/foo/download"
44
44
  end
45
45
 
46
46
  let!(:headers) do
@@ -25,13 +25,11 @@ describe "Crowbar::Client::Request::Backup::List" do
25
25
  end
26
26
 
27
27
  let!(:attrs) do
28
- {
29
- }
28
+ {}
30
29
  end
31
30
 
32
31
  let!(:params) do
33
- {
34
- }
32
+ {}
35
33
  end
36
34
 
37
35
  let!(:method) do
@@ -0,0 +1,52 @@
1
+ #
2
+ # Copyright 2015, 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::Request::Backup::Restore" do
20
+ it_behaves_like "a request class", true do
21
+ subject do
22
+ ::Crowbar::Client::Request::Backup::Restore.new(
23
+ attrs
24
+ )
25
+ end
26
+
27
+ let!(:attrs) do
28
+ {
29
+ name: "foo"
30
+ }
31
+ end
32
+
33
+ let!(:params) do
34
+ {}
35
+ end
36
+
37
+ let!(:method) do
38
+ :post
39
+ end
40
+
41
+ let!(:url) do
42
+ "utils/backups/foo/restore"
43
+ end
44
+
45
+ let!(:headers) do
46
+ {
47
+ "Content-Type" => "application/json",
48
+ "Accept" => "application/json"
49
+ }
50
+ end
51
+ end
52
+ end
@@ -17,48 +17,39 @@
17
17
  require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Batch::Build" do
20
- # it_behaves_like "a request class", true do
21
- # subject do
22
- # ::Crowbar::Client::Request::Batch::Build.new(
23
- # attrs
24
- # )
25
- # end
26
-
27
- # let!(:attrs) do
28
- # {
29
- # node: "",
30
- # network: "",
31
- # range: "",
32
- # suggest: "",
33
- # prop: "default"
34
- # }
35
- # end
36
-
37
- # let!(:params) do
38
- # {
39
- # name: "",
40
- # network: "",
41
- # range: "",
42
- # suggestion: ""
43
- # }
44
- # end
45
-
46
- # let!(:method) do
47
- # :post
48
- # end
49
-
50
- # let!(:url) do
51
- # "crowbar/network/1.0/allocate_ip/default"
52
- # end
53
-
54
- # let!(:headers) do
55
- # {
56
- # "Content-Type" => "application/json",
57
- # "Accept" => "application/json"
58
- # }
59
- # end
60
- # end
61
-
62
- pending
63
-
20
+ it_behaves_like "a request class", false do
21
+ subject do
22
+ ::Crowbar::Client::Request::Batch::Build.new(
23
+ attrs
24
+ )
25
+ end
26
+
27
+ let!(:attrs) do
28
+ {
29
+ file: fixture_path(
30
+ "batch.yml"
31
+ ).open
32
+ }
33
+ end
34
+
35
+ let!(:params) do
36
+ {}
37
+ end
38
+
39
+ let!(:method) do
40
+ :post
41
+ end
42
+
43
+ let!(:url) do
44
+ "utils/batch/build"
45
+ end
46
+
47
+ let!(:headers) do
48
+ {
49
+ "Accept" => "application/json",
50
+ "Content-Length" => "403",
51
+ "Content-Type" => "multipart/form-data; boundary=-----------RubyMultipartPost"
52
+ }
53
+ end
54
+ end
64
55
  end
@@ -17,48 +17,37 @@
17
17
  require_relative "../../../../spec_helper"
18
18
 
19
19
  describe "Crowbar::Client::Request::Batch::Export" do
20
- # it_behaves_like "a request class", true do
21
- # subject do
22
- # ::Crowbar::Client::Request::Batch::Export.new(
23
- # attrs
24
- # )
25
- # end
26
-
27
- # let!(:attrs) do
28
- # {
29
- # node: "",
30
- # network: "",
31
- # range: "",
32
- # suggest: "",
33
- # prop: "default"
34
- # }
35
- # end
36
-
37
- # let!(:params) do
38
- # {
39
- # name: "",
40
- # network: "",
41
- # range: "",
42
- # suggestion: ""
43
- # }
44
- # end
45
-
46
- # let!(:method) do
47
- # :post
48
- # end
49
-
50
- # let!(:url) do
51
- # "crowbar/network/1.0/allocate_ip/default"
52
- # end
53
-
54
- # let!(:headers) do
55
- # {
56
- # "Content-Type" => "application/json",
57
- # "Accept" => "application/json"
58
- # }
59
- # end
60
- # end
61
-
62
- pending
63
-
20
+ it_behaves_like "a request class", true do
21
+ subject do
22
+ ::Crowbar::Client::Request::Batch::Export.new(
23
+ attrs
24
+ )
25
+ end
26
+
27
+ let!(:attrs) do
28
+ {}
29
+ end
30
+
31
+ let!(:params) do
32
+ {
33
+ includes: nil,
34
+ excludes: nil
35
+ }
36
+ end
37
+
38
+ let!(:method) do
39
+ :post
40
+ end
41
+
42
+ let!(:url) do
43
+ "utils/batch/export"
44
+ end
45
+
46
+ let!(:headers) do
47
+ {
48
+ "Content-Type" => "application/octet-stream",
49
+ "Accept" => "application/octet-stream"
50
+ }
51
+ end
52
+ end
64
53
  end
@@ -28,7 +28,8 @@ describe "Crowbar::Client::Request::Proposal::Create" do
28
28
  {
29
29
  barclamp: "ntp",
30
30
  proposal: "default",
31
- data: "{}"
31
+ data: "{}",
32
+ payload: {}
32
33
  }
33
34
  end
34
35
 
@@ -28,7 +28,8 @@ describe "Crowbar::Client::Request::Proposal::Edit" do
28
28
  {
29
29
  barclamp: "ntp",
30
30
  proposal: "default",
31
- data: "{}"
31
+ data: "{}",
32
+ payload: {}
32
33
  }
33
34
  end
34
35
 
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowbar-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Boerger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-18 00:00:00.000000000 Z
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -229,6 +229,7 @@ files:
229
229
  - lib/crowbar/client/command/backup/delete.rb
230
230
  - lib/crowbar/client/command/backup/download.rb
231
231
  - lib/crowbar/client/command/backup/list.rb
232
+ - lib/crowbar/client/command/backup/restore.rb
232
233
  - lib/crowbar/client/command/backup/upload.rb
233
234
  - lib/crowbar/client/command/barclamp.rb
234
235
  - lib/crowbar/client/command/barclamp/list.rb
@@ -308,6 +309,7 @@ files:
308
309
  - lib/crowbar/client/request/backup/delete.rb
309
310
  - lib/crowbar/client/request/backup/download.rb
310
311
  - lib/crowbar/client/request/backup/list.rb
312
+ - lib/crowbar/client/request/backup/restore.rb
311
313
  - lib/crowbar/client/request/backup/upload.rb
312
314
  - lib/crowbar/client/request/barclamp.rb
313
315
  - lib/crowbar/client/request/barclamp/list.rb
@@ -368,6 +370,7 @@ files:
368
370
  - spec/crowbar/client/command/backup/delete_spec.rb
369
371
  - spec/crowbar/client/command/backup/download_spec.rb
370
372
  - spec/crowbar/client/command/backup/list_spec.rb
373
+ - spec/crowbar/client/command/backup/restore_spec.rb
371
374
  - spec/crowbar/client/command/backup/upload_spec.rb
372
375
  - spec/crowbar/client/command/barclamp/list_spec.rb
373
376
  - spec/crowbar/client/command/batch/build_spec.rb
@@ -424,6 +427,7 @@ files:
424
427
  - spec/crowbar/client/request/backup/delete_spec.rb
425
428
  - spec/crowbar/client/request/backup/download_spec.rb
426
429
  - spec/crowbar/client/request/backup/list_spec.rb
430
+ - spec/crowbar/client/request/backup/restore_spec.rb
427
431
  - spec/crowbar/client/request/backup/upload_spec.rb
428
432
  - spec/crowbar/client/request/barclamp/list_spec.rb
429
433
  - spec/crowbar/client/request/batch/build_spec.rb
@@ -466,6 +470,7 @@ files:
466
470
  - spec/crowbar/client/util/editor_spec.rb
467
471
  - spec/crowbar/client/util/runner_spec.rb
468
472
  - spec/crowbar/client_spec.rb
473
+ - spec/fixtures/batch.yml
469
474
  - spec/fixtures/upload.tgz
470
475
  - spec/spec_helper.rb
471
476
  - spec/support/command_context.rb
@@ -491,12 +496,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
491
496
  version: '0'
492
497
  requirements: []
493
498
  rubyforge_project:
494
- rubygems_version: 2.2.2
499
+ rubygems_version: 2.2.5
495
500
  signing_key:
496
501
  specification_version: 4
497
502
  summary: Crowbar commandline client
498
503
  test_files:
499
504
  - spec/fixtures/upload.tgz
505
+ - spec/fixtures/batch.yml
500
506
  - spec/support/command_context.rb
501
507
  - spec/support/request_examples.rb
502
508
  - spec/support/helper_methods.rb
@@ -528,6 +534,7 @@ test_files:
528
534
  - spec/crowbar/client/request/backup/create_spec.rb
529
535
  - spec/crowbar/client/request/backup/download_spec.rb
530
536
  - spec/crowbar/client/request/backup/delete_spec.rb
537
+ - spec/crowbar/client/request/backup/restore_spec.rb
531
538
  - spec/crowbar/client/request/backup/upload_spec.rb
532
539
  - spec/crowbar/client/request/repository/activate_spec.rb
533
540
  - spec/crowbar/client/request/repository/list_spec.rb
@@ -584,6 +591,7 @@ test_files:
584
591
  - spec/crowbar/client/command/backup/create_spec.rb
585
592
  - spec/crowbar/client/command/backup/download_spec.rb
586
593
  - spec/crowbar/client/command/backup/delete_spec.rb
594
+ - spec/crowbar/client/command/backup/restore_spec.rb
587
595
  - spec/crowbar/client/command/backup/upload_spec.rb
588
596
  - spec/crowbar/client/command/repository/activate_spec.rb
589
597
  - spec/crowbar/client/command/repository/list_spec.rb