crowbar-client 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -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
|
+
require_relative "../../../../spec_helper"
|
18
|
+
|
19
|
+
describe "Crowbar::Client::Command::Backup::Download" do
|
20
|
+
include_context "command_context"
|
21
|
+
|
22
|
+
subject do
|
23
|
+
::Crowbar::Client::Command::Backup::Download.new(
|
24
|
+
stdin,
|
25
|
+
stdout,
|
26
|
+
stderr,
|
27
|
+
id: 1
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should always return a request class" do
|
32
|
+
expect(subject.request).to(
|
33
|
+
be_a(
|
34
|
+
::Crowbar::Client::Request::Backup::Download
|
35
|
+
)
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
pending
|
40
|
+
end
|
@@ -16,11 +16,11 @@
|
|
16
16
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
|
-
describe "Crowbar::Client::Command::
|
19
|
+
describe "Crowbar::Client::Command::Backup::List" do
|
20
20
|
include_context "command_context"
|
21
21
|
|
22
22
|
subject do
|
23
|
-
::Crowbar::Client::Command::
|
23
|
+
::Crowbar::Client::Command::Backup::List.new(
|
24
24
|
stdin,
|
25
25
|
stdout,
|
26
26
|
stderr
|
@@ -30,7 +30,7 @@ describe "Crowbar::Client::Command::Reset::Nodes" do
|
|
30
30
|
it "should always return a request class" do
|
31
31
|
expect(subject.request).to(
|
32
32
|
be_a(
|
33
|
-
::Crowbar::Client::Request::
|
33
|
+
::Crowbar::Client::Request::Backup::List
|
34
34
|
)
|
35
35
|
)
|
36
36
|
end
|
@@ -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
|
+
require_relative "../../../../spec_helper"
|
18
|
+
|
19
|
+
describe "Crowbar::Client::Command::Backup::Upload" do
|
20
|
+
include_context "command_context"
|
21
|
+
|
22
|
+
subject do
|
23
|
+
::Crowbar::Client::Command::Backup::Upload.new(
|
24
|
+
stdin,
|
25
|
+
stdout,
|
26
|
+
stderr,
|
27
|
+
file: Tempfile.new("test")
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should always return a request class" do
|
32
|
+
expect(subject.request).to(
|
33
|
+
be_a(
|
34
|
+
::Crowbar::Client::Request::Backup::Upload
|
35
|
+
)
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
pending
|
40
|
+
end
|
@@ -16,11 +16,11 @@
|
|
16
16
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
|
-
describe "Crowbar::Client::Command::
|
19
|
+
describe "Crowbar::Client::Command::Node::Group" do
|
20
20
|
include_context "command_context"
|
21
21
|
|
22
22
|
subject do
|
23
|
-
::Crowbar::Client::Command::
|
23
|
+
::Crowbar::Client::Command::Node::Group.new(
|
24
24
|
stdin,
|
25
25
|
stdout,
|
26
26
|
stderr
|
@@ -30,7 +30,7 @@ describe "Crowbar::Client::Command::Reset::Proposal" do
|
|
30
30
|
it "should always return a request class" do
|
31
31
|
expect(subject.request).to(
|
32
32
|
be_a(
|
33
|
-
::Crowbar::Client::Request::
|
33
|
+
::Crowbar::Client::Request::Node::Group
|
34
34
|
)
|
35
35
|
)
|
36
36
|
end
|
@@ -28,14 +28,10 @@ describe "Crowbar::Client::Command::Proposal::Create" do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should always return a request class" do
|
31
|
-
subject.args
|
32
|
-
barclamp: "testing"
|
33
|
-
)
|
31
|
+
subject.args[:barclamp] = "testing"
|
34
32
|
|
35
|
-
subject.options
|
36
|
-
|
37
|
-
data: "{}"
|
38
|
-
)
|
33
|
+
subject.options[:merge] = true
|
34
|
+
subject.options[:data] = "{}"
|
39
35
|
|
40
36
|
stub_request(:get, "http://crowbar/crowbar/testing/1.0/proposals/template")
|
41
37
|
.with(
|
@@ -28,15 +28,11 @@ describe "Crowbar::Client::Command::Proposal::Edit" do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should always return a request class" do
|
31
|
-
subject.args
|
32
|
-
|
33
|
-
proposal: "default"
|
34
|
-
)
|
31
|
+
subject.args[:barclamp] = "testing"
|
32
|
+
subject.args[:proposal] = "default"
|
35
33
|
|
36
|
-
subject.options
|
37
|
-
|
38
|
-
data: "{}"
|
39
|
-
)
|
34
|
+
subject.options[:merge] = true
|
35
|
+
subject.options[:data] = "{}"
|
40
36
|
|
41
37
|
stub_request(:get, "http://crowbar/crowbar/testing/1.0/proposals/default")
|
42
38
|
.with(
|
@@ -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
|
+
require_relative "../../../../spec_helper"
|
18
|
+
|
19
|
+
describe "Crowbar::Client::Command::Proposal::Reset" do
|
20
|
+
include_context "command_context"
|
21
|
+
|
22
|
+
subject do
|
23
|
+
::Crowbar::Client::Command::Proposal::Reset.new(
|
24
|
+
stdin,
|
25
|
+
stdout,
|
26
|
+
stderr
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should always return a request class" do
|
31
|
+
expect(subject.request).to(
|
32
|
+
be_a(
|
33
|
+
::Crowbar::Client::Request::Proposal::Reset
|
34
|
+
)
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
pending
|
39
|
+
end
|
@@ -16,40 +16,41 @@
|
|
16
16
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
|
-
describe "Crowbar::Client::Request::
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
19
|
+
describe "Crowbar::Client::Request::Backup::Create" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
|
+
subject do
|
22
|
+
::Crowbar::Client::Request::Backup::Create.new(
|
23
|
+
attrs
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
let!(:attrs) do
|
28
|
+
{
|
29
|
+
backup: "test-backup"
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
let!(:params) do
|
34
|
+
{
|
35
|
+
backup: {
|
36
|
+
name: "test-backup"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
let!(:method) do
|
42
|
+
:post
|
43
|
+
end
|
44
|
+
|
45
|
+
let!(:url) do
|
46
|
+
"utils/backups"
|
47
|
+
end
|
48
|
+
|
49
|
+
let!(:headers) do
|
50
|
+
{
|
51
|
+
"Content-Type" => "application/json",
|
52
|
+
"Accept" => "application/json"
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
55
56
|
end
|
@@ -16,40 +16,38 @@
|
|
16
16
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
|
-
describe "Crowbar::Client::Request::
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
pending
|
54
|
-
|
19
|
+
describe "Crowbar::Client::Request::Backup::Delete" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
|
+
subject do
|
22
|
+
::Crowbar::Client::Request::Backup::Delete.new(
|
23
|
+
attrs
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
let!(:attrs) do
|
28
|
+
{
|
29
|
+
id: 1
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
let!(:params) do
|
34
|
+
{
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
let!(:method) do
|
39
|
+
:delete
|
40
|
+
end
|
41
|
+
|
42
|
+
let!(:url) do
|
43
|
+
"utils/backups/1"
|
44
|
+
end
|
45
|
+
|
46
|
+
let!(:headers) do
|
47
|
+
{
|
48
|
+
"Content-Type" => "application/json",
|
49
|
+
"Accept" => "application/json"
|
50
|
+
}
|
51
|
+
end
|
52
|
+
end
|
55
53
|
end
|
@@ -0,0 +1,53 @@
|
|
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::Download" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
|
+
subject do
|
22
|
+
::Crowbar::Client::Request::Backup::Download.new(
|
23
|
+
attrs
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
let!(:attrs) do
|
28
|
+
{
|
29
|
+
id: 1
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
let!(:params) do
|
34
|
+
{
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
let!(:method) do
|
39
|
+
:get
|
40
|
+
end
|
41
|
+
|
42
|
+
let!(:url) do
|
43
|
+
"utils/backups/1/download"
|
44
|
+
end
|
45
|
+
|
46
|
+
let!(:headers) do
|
47
|
+
{
|
48
|
+
"Content-Type" => "application/octet-stream",
|
49
|
+
"Accept" => "application/octet-stream"
|
50
|
+
}
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -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::List" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
|
+
subject do
|
22
|
+
::Crowbar::Client::Request::Backup::List.new(
|
23
|
+
attrs
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
let!(:attrs) do
|
28
|
+
{
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
let!(:params) do
|
33
|
+
{
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
let!(:method) do
|
38
|
+
:get
|
39
|
+
end
|
40
|
+
|
41
|
+
let!(:url) do
|
42
|
+
"utils/backups"
|
43
|
+
end
|
44
|
+
|
45
|
+
let!(:headers) do
|
46
|
+
{
|
47
|
+
"Content-Type" => "application/json",
|
48
|
+
"Accept" => "application/json"
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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::Upload" do
|
20
|
+
it_behaves_like "a request class", false do
|
21
|
+
subject do
|
22
|
+
::Crowbar::Client::Request::Backup::Upload.new(
|
23
|
+
attrs
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
let!(:attrs) do
|
28
|
+
{
|
29
|
+
file: fixture_path(
|
30
|
+
"upload.tgz"
|
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/backups/upload"
|
45
|
+
end
|
46
|
+
|
47
|
+
let!(:headers) do
|
48
|
+
{
|
49
|
+
"Accept" => "application/json",
|
50
|
+
"Content-Length" => "468",
|
51
|
+
"Content-Type" => "multipart/form-data; boundary=-----------RubyMultipartPost"
|
52
|
+
}
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Barclamp::List" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::Barclamp::List.new(
|
23
23
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Batch::Build" do
|
20
|
-
# it_behaves_like "a request class" do
|
20
|
+
# it_behaves_like "a request class", true do
|
21
21
|
# subject do
|
22
22
|
# ::Crowbar::Client::Request::Batch::Build.new(
|
23
23
|
# attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Batch::Export" do
|
20
|
-
# it_behaves_like "a request class" do
|
20
|
+
# it_behaves_like "a request class", true do
|
21
21
|
# subject do
|
22
22
|
# ::Crowbar::Client::Request::Batch::Export.new(
|
23
23
|
# attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::HostIP::Allocate" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::HostIP::Allocate.new(
|
23
23
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::HostIP::Deallocate" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::HostIP::Deallocate.new(
|
23
23
|
attrs
|
@@ -18,7 +18,7 @@
|
|
18
18
|
require_relative "../../../../spec_helper"
|
19
19
|
|
20
20
|
describe "Crowbar::Client::Request::Installer::Start" do
|
21
|
-
it_behaves_like "a request class" do
|
21
|
+
it_behaves_like "a request class", true do
|
22
22
|
subject do
|
23
23
|
::Crowbar::Client::Request::Installer::Start.new(
|
24
24
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Installer::Status" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::Installer::Status.new(
|
23
23
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Interface::Disable" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::Interface::Disable.new(
|
23
23
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Interface::Enable" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::Interface::Enable.new(
|
23
23
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Node::Action" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::Node::Action.new(
|
23
23
|
attrs
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require_relative "../../../../spec_helper"
|
18
18
|
|
19
19
|
describe "Crowbar::Client::Request::Node::Delete" do
|
20
|
-
it_behaves_like "a request class" do
|
20
|
+
it_behaves_like "a request class", true do
|
21
21
|
subject do
|
22
22
|
::Crowbar::Client::Request::Node::Delete.new(
|
23
23
|
attrs
|