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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/crowbar/client/app/backup.rb +148 -0
- data/lib/crowbar/client/app/entry.rb +4 -4
- data/lib/crowbar/client/app/node.rb +26 -13
- data/lib/crowbar/client/app/proposal.rb +59 -0
- data/lib/crowbar/client/app.rb +3 -3
- data/lib/crowbar/client/command/{reset/proposal.rb → backup/create.rb} +9 -3
- data/lib/crowbar/client/command/backup/delete.rb +42 -0
- data/lib/crowbar/client/command/backup/download.rb +68 -0
- data/lib/crowbar/client/command/backup/list.rb +76 -0
- data/lib/crowbar/client/command/{reset/nodes.rb → backup/upload.rb} +9 -4
- data/lib/crowbar/client/command/{reset.rb → backup.rb} +14 -5
- data/lib/crowbar/client/command/node/group.rb +44 -0
- data/lib/crowbar/client/command/node/list.rb +37 -16
- data/lib/crowbar/client/command/node.rb +3 -0
- data/lib/crowbar/client/command/proposal/reset.rb +48 -0
- data/lib/crowbar/client/command/proposal.rb +3 -0
- data/lib/crowbar/client/command.rb +3 -3
- data/lib/crowbar/client/config.rb +5 -5
- data/lib/crowbar/client/mixin/barclamp.rb +1 -4
- data/lib/crowbar/client/request/backup/create.rb +46 -0
- data/lib/crowbar/client/request/{reset/proposal.rb → backup/delete.rb} +8 -4
- data/lib/crowbar/client/request/backup/download.rb +47 -0
- data/lib/crowbar/client/request/{reset/nodes.rb → backup/list.rb} +6 -3
- data/lib/crowbar/client/request/backup/upload.rb +48 -0
- data/lib/crowbar/client/request/backup.rb +38 -0
- data/lib/crowbar/client/request/base.rb +4 -4
- data/lib/crowbar/client/request/node/group.rb +39 -0
- data/lib/crowbar/client/request/node.rb +3 -0
- data/lib/crowbar/client/request/party.rb +2 -2
- data/lib/crowbar/client/request/proposal/reset.rb +40 -0
- data/lib/crowbar/client/request/proposal.rb +3 -0
- data/lib/crowbar/client/request.rb +3 -3
- data/lib/crowbar/client/version.rb +2 -2
- data/spec/crowbar/client/command/backup/create_spec.rb +42 -0
- data/spec/crowbar/client/command/backup/delete_spec.rb +41 -0
- data/spec/crowbar/client/command/backup/download_spec.rb +40 -0
- data/spec/crowbar/client/command/{reset/nodes_spec.rb → backup/list_spec.rb} +3 -3
- data/spec/crowbar/client/command/backup/upload_spec.rb +40 -0
- data/spec/crowbar/client/command/{reset/proposal_spec.rb → node/group_spec.rb} +3 -3
- data/spec/crowbar/client/command/proposal/create_spec.rb +3 -7
- data/spec/crowbar/client/command/proposal/edit_spec.rb +4 -8
- data/spec/crowbar/client/command/proposal/reset_spec.rb +39 -0
- data/spec/crowbar/client/request/{reset/proposal_spec.rb → backup/create_spec.rb} +37 -36
- data/spec/crowbar/client/request/{reset/nodes_spec.rb → backup/delete_spec.rb} +34 -36
- data/spec/crowbar/client/request/backup/download_spec.rb +53 -0
- data/spec/crowbar/client/request/backup/list_spec.rb +52 -0
- data/spec/crowbar/client/request/backup/upload_spec.rb +55 -0
- data/spec/crowbar/client/request/barclamp/list_spec.rb +1 -1
- data/spec/crowbar/client/request/batch/build_spec.rb +1 -1
- data/spec/crowbar/client/request/batch/export_spec.rb +1 -1
- data/spec/crowbar/client/request/host_ip/allocate_spec.rb +1 -1
- data/spec/crowbar/client/request/host_ip/deallocate_spec.rb +1 -1
- data/spec/crowbar/client/request/installer/start_spec.rb +1 -1
- data/spec/crowbar/client/request/installer/status_spec.rb +1 -1
- data/spec/crowbar/client/request/interface/disable_spec.rb +1 -1
- data/spec/crowbar/client/request/interface/enable_spec.rb +1 -1
- data/spec/crowbar/client/request/node/action_spec.rb +1 -1
- data/spec/crowbar/client/request/node/delete_spec.rb +1 -1
- data/spec/crowbar/client/request/node/group_spec.rb +53 -0
- data/spec/crowbar/client/request/node/list_spec.rb +1 -1
- data/spec/crowbar/client/request/node/rename_spec.rb +1 -1
- data/spec/crowbar/client/request/node/role_spec.rb +1 -1
- data/spec/crowbar/client/request/node/show_spec.rb +1 -1
- data/spec/crowbar/client/request/node/status_spec.rb +1 -1
- data/spec/crowbar/client/request/node/transition_spec.rb +1 -1
- data/spec/crowbar/client/request/proposal/commit_spec.rb +1 -1
- data/spec/crowbar/client/request/proposal/create_spec.rb +34 -36
- data/spec/crowbar/client/request/proposal/delete_spec.rb +1 -1
- data/spec/crowbar/client/request/proposal/dequeue_spec.rb +1 -1
- data/spec/crowbar/client/request/proposal/edit_spec.rb +34 -36
- data/spec/crowbar/client/request/proposal/list_spec.rb +1 -1
- data/spec/crowbar/client/request/proposal/reset_spec.rb +53 -0
- data/spec/crowbar/client/request/proposal/show_spec.rb +1 -1
- data/spec/crowbar/client/request/proposal/template_spec.rb +1 -1
- data/spec/crowbar/client/request/repository/activate_all_spec.rb +1 -1
- data/spec/crowbar/client/request/repository/activate_spec.rb +1 -1
- data/spec/crowbar/client/request/repository/deactivate_all_spec.rb +1 -1
- data/spec/crowbar/client/request/repository/deactivate_spec.rb +1 -1
- data/spec/crowbar/client/request/repository/list_spec.rb +1 -1
- data/spec/crowbar/client/request/role/list_spec.rb +1 -1
- data/spec/crowbar/client/request/role/show_spec.rb +1 -1
- data/spec/crowbar/client/request/server/api_spec.rb +1 -1
- data/spec/crowbar/client/request/virtual_ip/allocate_spec.rb +1 -1
- data/spec/crowbar/client/request/virtual_ip/deallocate_spec.rb +1 -1
- data/spec/fixtures/upload.tgz +0 -0
- data/spec/spec_helper.rb +2 -0
- data/{lib/crowbar/client/request/reset.rb → spec/support/helper_methods.rb} +10 -11
- data/spec/support/request_examples.rb +31 -12
- metadata +130 -96
- 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
|
-
[]
|
59
|
-
|
60
|
-
|
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
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
@@ -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
|
@@ -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
|
-
|
114
|
+
options[key]
|
115
115
|
when config[key].present?
|
116
|
-
|
116
|
+
config[key]
|
117
117
|
when options[key].present?
|
118
|
-
|
118
|
+
options[key]
|
119
119
|
else
|
120
|
-
|
120
|
+
defaults[key]
|
121
121
|
end
|
122
122
|
end
|
123
123
|
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
|
21
|
-
class
|
20
|
+
module Backup
|
21
|
+
class Delete < Base
|
22
22
|
def method
|
23
|
-
:
|
23
|
+
:delete
|
24
24
|
end
|
25
25
|
|
26
26
|
def url
|
27
|
-
[
|
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
|
21
|
-
class
|
20
|
+
module Backup
|
21
|
+
class List < Base
|
22
22
|
def method
|
23
23
|
:get
|
24
24
|
end
|
25
25
|
|
26
26
|
def url
|
27
|
-
[
|
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
|
@@ -14,13 +14,13 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "
|
17
|
+
require "httmultiparty"
|
18
18
|
|
19
19
|
module Crowbar
|
20
20
|
module Client
|
21
21
|
module Request
|
22
22
|
class Party
|
23
|
-
include
|
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
|
@@ -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
|
|
@@ -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
|