crowbar-client 2.2.1 → 2.3.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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/lib/crowbar/client/app/backup.rb +148 -0
  4. data/lib/crowbar/client/app/entry.rb +4 -4
  5. data/lib/crowbar/client/app/node.rb +26 -13
  6. data/lib/crowbar/client/app/proposal.rb +59 -0
  7. data/lib/crowbar/client/app.rb +3 -3
  8. data/lib/crowbar/client/command/{reset/proposal.rb → backup/create.rb} +9 -3
  9. data/lib/crowbar/client/command/backup/delete.rb +42 -0
  10. data/lib/crowbar/client/command/backup/download.rb +68 -0
  11. data/lib/crowbar/client/command/backup/list.rb +76 -0
  12. data/lib/crowbar/client/command/{reset/nodes.rb → backup/upload.rb} +9 -4
  13. data/lib/crowbar/client/command/{reset.rb → backup.rb} +14 -5
  14. data/lib/crowbar/client/command/node/group.rb +44 -0
  15. data/lib/crowbar/client/command/node/list.rb +37 -16
  16. data/lib/crowbar/client/command/node.rb +3 -0
  17. data/lib/crowbar/client/command/proposal/reset.rb +48 -0
  18. data/lib/crowbar/client/command/proposal.rb +3 -0
  19. data/lib/crowbar/client/command.rb +3 -3
  20. data/lib/crowbar/client/config.rb +5 -5
  21. data/lib/crowbar/client/mixin/barclamp.rb +1 -4
  22. data/lib/crowbar/client/request/backup/create.rb +46 -0
  23. data/lib/crowbar/client/request/{reset/proposal.rb → backup/delete.rb} +8 -4
  24. data/lib/crowbar/client/request/backup/download.rb +47 -0
  25. data/lib/crowbar/client/request/{reset/nodes.rb → backup/list.rb} +6 -3
  26. data/lib/crowbar/client/request/backup/upload.rb +48 -0
  27. data/lib/crowbar/client/request/backup.rb +38 -0
  28. data/lib/crowbar/client/request/base.rb +4 -4
  29. data/lib/crowbar/client/request/node/group.rb +39 -0
  30. data/lib/crowbar/client/request/node.rb +3 -0
  31. data/lib/crowbar/client/request/party.rb +2 -2
  32. data/lib/crowbar/client/request/proposal/reset.rb +40 -0
  33. data/lib/crowbar/client/request/proposal.rb +3 -0
  34. data/lib/crowbar/client/request.rb +3 -3
  35. data/lib/crowbar/client/version.rb +2 -2
  36. data/spec/crowbar/client/command/backup/create_spec.rb +42 -0
  37. data/spec/crowbar/client/command/backup/delete_spec.rb +41 -0
  38. data/spec/crowbar/client/command/backup/download_spec.rb +40 -0
  39. data/spec/crowbar/client/command/{reset/nodes_spec.rb → backup/list_spec.rb} +3 -3
  40. data/spec/crowbar/client/command/backup/upload_spec.rb +40 -0
  41. data/spec/crowbar/client/command/{reset/proposal_spec.rb → node/group_spec.rb} +3 -3
  42. data/spec/crowbar/client/command/proposal/create_spec.rb +3 -7
  43. data/spec/crowbar/client/command/proposal/edit_spec.rb +4 -8
  44. data/spec/crowbar/client/command/proposal/reset_spec.rb +39 -0
  45. data/spec/crowbar/client/request/{reset/proposal_spec.rb → backup/create_spec.rb} +37 -36
  46. data/spec/crowbar/client/request/{reset/nodes_spec.rb → backup/delete_spec.rb} +34 -36
  47. data/spec/crowbar/client/request/backup/download_spec.rb +53 -0
  48. data/spec/crowbar/client/request/backup/list_spec.rb +52 -0
  49. data/spec/crowbar/client/request/backup/upload_spec.rb +55 -0
  50. data/spec/crowbar/client/request/barclamp/list_spec.rb +1 -1
  51. data/spec/crowbar/client/request/batch/build_spec.rb +1 -1
  52. data/spec/crowbar/client/request/batch/export_spec.rb +1 -1
  53. data/spec/crowbar/client/request/host_ip/allocate_spec.rb +1 -1
  54. data/spec/crowbar/client/request/host_ip/deallocate_spec.rb +1 -1
  55. data/spec/crowbar/client/request/installer/start_spec.rb +1 -1
  56. data/spec/crowbar/client/request/installer/status_spec.rb +1 -1
  57. data/spec/crowbar/client/request/interface/disable_spec.rb +1 -1
  58. data/spec/crowbar/client/request/interface/enable_spec.rb +1 -1
  59. data/spec/crowbar/client/request/node/action_spec.rb +1 -1
  60. data/spec/crowbar/client/request/node/delete_spec.rb +1 -1
  61. data/spec/crowbar/client/request/node/group_spec.rb +53 -0
  62. data/spec/crowbar/client/request/node/list_spec.rb +1 -1
  63. data/spec/crowbar/client/request/node/rename_spec.rb +1 -1
  64. data/spec/crowbar/client/request/node/role_spec.rb +1 -1
  65. data/spec/crowbar/client/request/node/show_spec.rb +1 -1
  66. data/spec/crowbar/client/request/node/status_spec.rb +1 -1
  67. data/spec/crowbar/client/request/node/transition_spec.rb +1 -1
  68. data/spec/crowbar/client/request/proposal/commit_spec.rb +1 -1
  69. data/spec/crowbar/client/request/proposal/create_spec.rb +34 -36
  70. data/spec/crowbar/client/request/proposal/delete_spec.rb +1 -1
  71. data/spec/crowbar/client/request/proposal/dequeue_spec.rb +1 -1
  72. data/spec/crowbar/client/request/proposal/edit_spec.rb +34 -36
  73. data/spec/crowbar/client/request/proposal/list_spec.rb +1 -1
  74. data/spec/crowbar/client/request/proposal/reset_spec.rb +53 -0
  75. data/spec/crowbar/client/request/proposal/show_spec.rb +1 -1
  76. data/spec/crowbar/client/request/proposal/template_spec.rb +1 -1
  77. data/spec/crowbar/client/request/repository/activate_all_spec.rb +1 -1
  78. data/spec/crowbar/client/request/repository/activate_spec.rb +1 -1
  79. data/spec/crowbar/client/request/repository/deactivate_all_spec.rb +1 -1
  80. data/spec/crowbar/client/request/repository/deactivate_spec.rb +1 -1
  81. data/spec/crowbar/client/request/repository/list_spec.rb +1 -1
  82. data/spec/crowbar/client/request/role/list_spec.rb +1 -1
  83. data/spec/crowbar/client/request/role/show_spec.rb +1 -1
  84. data/spec/crowbar/client/request/server/api_spec.rb +1 -1
  85. data/spec/crowbar/client/request/virtual_ip/allocate_spec.rb +1 -1
  86. data/spec/crowbar/client/request/virtual_ip/deallocate_spec.rb +1 -1
  87. data/spec/fixtures/upload.tgz +0 -0
  88. data/spec/spec_helper.rb +2 -0
  89. data/{lib/crowbar/client/request/reset.rb → spec/support/helper_methods.rb} +10 -11
  90. data/spec/support/request_examples.rb +31 -12
  91. metadata +130 -96
  92. data/lib/crowbar/client/app/reset.rb +0 -58
@@ -55,30 +55,51 @@ module Crowbar
55
55
  protected
56
56
 
57
57
  def headings
58
- [].tap do |values|
59
- values.push("Name") if options["names"]
60
- values.push("Alias") if options["aliases"]
58
+ if options["meta"]
59
+ [
60
+ "Name",
61
+ "Alias",
62
+ "Group",
63
+ "Status"
64
+ ]
65
+ else
66
+ [
67
+ "Name"
68
+ ]
61
69
  end
62
70
  end
63
71
 
64
72
  def content_from(request)
65
- [].tap do |row|
73
+ result = [].tap do |row|
66
74
  request.parsed_response["nodes"].each do |child|
67
- values = {}
68
- values[:name] = child["name"] if options["names"]
69
- values[:alias] = child["alias"] if options["aliases"]
70
-
71
- row.push(
72
- values
73
- )
75
+ if options["meta"]
76
+ row.push(
77
+ child.slice(
78
+ "name",
79
+ "alias",
80
+ "group",
81
+ "status"
82
+ )
83
+ )
84
+ else
85
+ row.push(
86
+ child.slice(
87
+ "name"
88
+ )
89
+ )
90
+ end
74
91
  end
75
92
  end
76
- end
77
93
 
78
- def checks
79
- msg = "Please provide only names or aliases switch"
80
- raise BadOptionsError,
81
- msg unless options["names"] || options["aliases"]
94
+ result.sort do |x, y|
95
+ [
96
+ x["name"],
97
+ x["alias"]
98
+ ] <=> [
99
+ y["name"],
100
+ y["alias"]
101
+ ]
102
+ end
82
103
  end
83
104
  end
84
105
  end
@@ -24,6 +24,9 @@ module Crowbar
24
24
  autoload :Delete,
25
25
  File.expand_path("../node/delete", __FILE__)
26
26
 
27
+ autoload :Group,
28
+ File.expand_path("../node/group", __FILE__)
29
+
27
30
  autoload :Hardware,
28
31
  File.expand_path("../node/hardware", __FILE__)
29
32
 
@@ -0,0 +1,48 @@
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
+ module Crowbar
18
+ module Client
19
+ module Command
20
+ module Proposal
21
+ class Reset < Base
22
+ include Mixin::Barclamp
23
+
24
+ def request
25
+ @request ||= Request::Proposal::Reset.new(
26
+ args
27
+ )
28
+ end
29
+
30
+ def execute
31
+ validate_barclamp! args.barclamp
32
+
33
+ request.process do |request|
34
+ case request.code
35
+ when 200
36
+ say "Successfully reset #{args.proposal} proposal"
37
+ when 404
38
+ say "Proposal does not exist"
39
+ else
40
+ err request.parsed_response["error"]
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -36,6 +36,9 @@ module Crowbar
36
36
  autoload :List,
37
37
  File.expand_path("../proposal/list", __FILE__)
38
38
 
39
+ autoload :Reset,
40
+ File.expand_path("../proposal/reset", __FILE__)
41
+
39
42
  autoload :Show,
40
43
  File.expand_path("../proposal/show", __FILE__)
41
44
  end
@@ -17,6 +17,9 @@
17
17
  module Crowbar
18
18
  module Client
19
19
  module Command
20
+ autoload :Backup,
21
+ File.expand_path("../command/backup", __FILE__)
22
+
20
23
  autoload :Barclamp,
21
24
  File.expand_path("../command/barclamp", __FILE__)
22
25
 
@@ -44,9 +47,6 @@ module Crowbar
44
47
  autoload :Repository,
45
48
  File.expand_path("../command/repository", __FILE__)
46
49
 
47
- autoload :Reset,
48
- File.expand_path("../command/reset", __FILE__)
49
-
50
50
  autoload :Role,
51
51
  File.expand_path("../command/role", __FILE__)
52
52
 
@@ -109,15 +109,15 @@ module Crowbar
109
109
  def merge
110
110
  result = {}.tap do |overwrite|
111
111
  defaults.keys.each do |key|
112
- case
112
+ overwrite[key] = case
113
113
  when options[key] != defaults[key]
114
- overwrite[key] = options[key]
114
+ options[key]
115
115
  when config[key].present?
116
- overwrite[key] = config[key]
116
+ config[key]
117
117
  when options[key].present?
118
- overwrite[key] = options[key]
118
+ options[key]
119
119
  else
120
- overwrite[key] = defaults[key]
120
+ defaults[key]
121
121
  end
122
122
  end
123
123
  end
@@ -29,10 +29,7 @@ module Crowbar
29
29
  end
30
30
 
31
31
  def available_barclamps
32
- @available_barclamps ||= Request::Barclamp::List
33
- .new
34
- .process
35
- .keys
32
+ @available_barclamps ||= Request::Barclamp::List.new.process.keys
36
33
  end
37
34
  end
38
35
  end
@@ -0,0 +1,46 @@
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 "easy_diff"
18
+
19
+ module Crowbar
20
+ module Client
21
+ module Request
22
+ module Backup
23
+ class Create < Base
24
+ def content
25
+ super.easy_merge!(
26
+ backup: {
27
+ name: attrs.backup
28
+ }
29
+ )
30
+ end
31
+
32
+ def method
33
+ :post
34
+ end
35
+
36
+ def url
37
+ [
38
+ "utils",
39
+ "backups"
40
+ ].join("/")
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -17,14 +17,18 @@
17
17
  module Crowbar
18
18
  module Client
19
19
  module Request
20
- module Reset
21
- class Proposal < Base
20
+ module Backup
21
+ class Delete < Base
22
22
  def method
23
- :get
23
+ :delete
24
24
  end
25
25
 
26
26
  def url
27
- [].join("/")
27
+ [
28
+ "utils",
29
+ "backups",
30
+ attrs.id
31
+ ].join("/")
28
32
  end
29
33
  end
30
34
  end
@@ -0,0 +1,47 @@
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 "easy_diff"
18
+
19
+ module Crowbar
20
+ module Client
21
+ module Request
22
+ module Backup
23
+ class Download < Base
24
+ def headers
25
+ super.easy_merge!(
26
+ "Content-Type" => "application/octet-stream",
27
+ "Accept" => "application/octet-stream"
28
+ )
29
+ end
30
+
31
+ def method
32
+ :get
33
+ end
34
+
35
+ def url
36
+ [
37
+ "utils",
38
+ "backups",
39
+ attrs.id,
40
+ "download"
41
+ ].join("/")
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -17,14 +17,17 @@
17
17
  module Crowbar
18
18
  module Client
19
19
  module Request
20
- module Reset
21
- class Nodes < Base
20
+ module Backup
21
+ class List < Base
22
22
  def method
23
23
  :get
24
24
  end
25
25
 
26
26
  def url
27
- [].join("/")
27
+ [
28
+ "utils",
29
+ "backups"
30
+ ].join("/")
28
31
  end
29
32
  end
30
33
  end
@@ -0,0 +1,48 @@
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 "easy_diff"
18
+
19
+ module Crowbar
20
+ module Client
21
+ module Request
22
+ module Backup
23
+ class Upload < Base
24
+ def params
25
+ {
26
+ headers: headers,
27
+ query: {
28
+ file: attrs.file
29
+ }
30
+ }
31
+ end
32
+
33
+ def method
34
+ :post
35
+ end
36
+
37
+ def url
38
+ [
39
+ "utils",
40
+ "backups",
41
+ "upload"
42
+ ].join("/")
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,38 @@
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
+ module Crowbar
18
+ module Client
19
+ module Request
20
+ module Backup
21
+ autoload :Create,
22
+ File.expand_path("../backup/create", __FILE__)
23
+
24
+ autoload :Delete,
25
+ File.expand_path("../backup/delete", __FILE__)
26
+
27
+ autoload :Download,
28
+ File.expand_path("../backup/download", __FILE__)
29
+
30
+ autoload :List,
31
+ File.expand_path("../backup/list", __FILE__)
32
+
33
+ autoload :Upload,
34
+ File.expand_path("../backup/upload", __FILE__)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -36,13 +36,13 @@ module Crowbar
36
36
  end
37
37
 
38
38
  def headers
39
- @headers ||= {}
39
+ @headers ||= {
40
+ "Content-Type" => "application/json",
41
+ "Accept" => "application/json"
42
+ }
40
43
  end
41
44
 
42
45
  def params
43
- headers["Content-Type"] ||= "application/json"
44
- headers["Accept"] ||= "application/json"
45
-
46
46
  {
47
47
  body: content.to_json,
48
48
  headers: headers
@@ -0,0 +1,39 @@
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
+ module Crowbar
18
+ module Client
19
+ module Request
20
+ module Node
21
+ class Group < Base
22
+ def method
23
+ :post
24
+ end
25
+
26
+ def url
27
+ [
28
+ "nodes",
29
+ "groups",
30
+ "1.0",
31
+ attrs.name,
32
+ attrs.value
33
+ ].join("/")
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -24,6 +24,9 @@ module Crowbar
24
24
  autoload :Delete,
25
25
  File.expand_path("../node/delete", __FILE__)
26
26
 
27
+ autoload :Group,
28
+ File.expand_path("../node/group", __FILE__)
29
+
27
30
  autoload :List,
28
31
  File.expand_path("../node/list", __FILE__)
29
32
 
@@ -14,13 +14,13 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "httparty"
17
+ require "httmultiparty"
18
18
 
19
19
  module Crowbar
20
20
  module Client
21
21
  module Request
22
22
  class Party
23
- include HTTParty
23
+ include HTTMultiParty
24
24
 
25
25
  follow_redirects true
26
26
  format :json
@@ -0,0 +1,40 @@
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
+ module Crowbar
18
+ module Client
19
+ module Request
20
+ module Proposal
21
+ class Reset < Base
22
+ def method
23
+ :post
24
+ end
25
+
26
+ def url
27
+ [
28
+ "crowbar",
29
+ attrs.barclamp,
30
+ "1.0",
31
+ "proposals",
32
+ "reset",
33
+ attrs.proposal
34
+ ].join("/")
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -36,6 +36,9 @@ module Crowbar
36
36
  autoload :List,
37
37
  File.expand_path("../proposal/list", __FILE__)
38
38
 
39
+ autoload :Reset,
40
+ File.expand_path("../proposal/reset", __FILE__)
41
+
39
42
  autoload :Show,
40
43
  File.expand_path("../proposal/show", __FILE__)
41
44
 
@@ -17,6 +17,9 @@
17
17
  module Crowbar
18
18
  module Client
19
19
  module Request
20
+ autoload :Backup,
21
+ File.expand_path("../request/backup", __FILE__)
22
+
20
23
  autoload :Barclamp,
21
24
  File.expand_path("../request/barclamp", __FILE__)
22
25
 
@@ -47,9 +50,6 @@ module Crowbar
47
50
  autoload :Repository,
48
51
  File.expand_path("../request/repository", __FILE__)
49
52
 
50
- autoload :Reset,
51
- File.expand_path("../request/reset", __FILE__)
52
-
53
53
  autoload :Role,
54
54
  File.expand_path("../request/role", __FILE__)
55
55
 
@@ -18,8 +18,8 @@ module Crowbar
18
18
  module Client
19
19
  class Version
20
20
  MAJOR = 2
21
- MINOR = 2
22
- PATCH = 1
21
+ MINOR = 3
22
+ PATCH = 0
23
23
 
24
24
  PRE = nil
25
25
 
@@ -0,0 +1,42 @@
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::Command::Backup::Create" do
20
+ include_context "command_context"
21
+
22
+ subject do
23
+ ::Crowbar::Client::Command::Backup::Create.new(
24
+ stdin,
25
+ stdout,
26
+ stderr,
27
+ backup: {
28
+ name: "test-backup"
29
+ }
30
+ )
31
+ end
32
+
33
+ it "should always return a request class" do
34
+ expect(subject.request).to(
35
+ be_a(
36
+ ::Crowbar::Client::Request::Backup::Create
37
+ )
38
+ )
39
+ end
40
+
41
+ pending
42
+ end
@@ -0,0 +1,41 @@
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::Command::Backup::Delete" do
20
+ include_context "command_context"
21
+
22
+ subject do
23
+ ::Crowbar::Client::Command::Backup::Delete.new(
24
+ stdin,
25
+ stdout,
26
+ stderr,
27
+ name: "test-backup",
28
+ created_at: "20150303-170203"
29
+ )
30
+ end
31
+
32
+ it "should always return a request class" do
33
+ expect(subject.request).to(
34
+ be_a(
35
+ ::Crowbar::Client::Request::Backup::Delete
36
+ )
37
+ )
38
+ end
39
+
40
+ pending
41
+ end