crowbar-client 3.6.1 → 3.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/lib/crowbar/client/app.rb +6 -0
- data/lib/crowbar/client/app/entry.rb +13 -0
- data/lib/crowbar/client/app/proposal.rb +20 -0
- data/lib/crowbar/client/app/restricted.rb +136 -0
- data/lib/crowbar/client/app/ses.rb +54 -0
- data/lib/crowbar/client/command.rb +6 -0
- data/lib/crowbar/client/command/base.rb +9 -0
- data/lib/crowbar/client/command/proposal/edit.rb +5 -1
- data/lib/crowbar/client/command/proposal/show.rb +7 -1
- data/lib/crowbar/client/command/restricted.rb +38 -0
- data/lib/crowbar/client/command/restricted/allocate.rb +51 -0
- data/lib/crowbar/client/command/restricted/ping.rb +45 -0
- data/lib/crowbar/client/command/restricted/show.rb +72 -0
- data/lib/crowbar/client/command/restricted/transition.rb +47 -0
- data/lib/crowbar/client/command/ses.rb +29 -0
- data/lib/crowbar/client/command/ses/upload.rb +60 -0
- data/lib/crowbar/client/command/upgrade/repocheck.rb +3 -1
- data/lib/crowbar/client/config.rb +24 -8
- data/lib/crowbar/client/request.rb +6 -0
- data/lib/crowbar/client/request/restricted.rb +38 -0
- data/lib/crowbar/client/request/restricted/allocate.rb +50 -0
- data/lib/crowbar/client/request/restricted/ping.rb +49 -0
- data/lib/crowbar/client/request/restricted/show.rb +50 -0
- data/lib/crowbar/client/request/restricted/transition.rb +63 -0
- data/lib/crowbar/client/request/ses.rb +29 -0
- data/lib/crowbar/client/request/ses/upload.rb +65 -0
- data/lib/crowbar/client/util.rb +3 -0
- data/lib/crowbar/client/util/apiversion.rb +2 -8
- data/lib/crowbar/client/util/osrelease.rb +37 -0
- data/lib/crowbar/client/version.rb +2 -2
- metadata +26 -10
@@ -0,0 +1,50 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2019, SUSE
|
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 Restricted
|
21
|
+
#
|
22
|
+
# Implementation for the restricted show request
|
23
|
+
#
|
24
|
+
class Show < Base
|
25
|
+
#
|
26
|
+
# HTTP method that gets used by the request
|
27
|
+
#
|
28
|
+
# @return [Symbol] the method for the request
|
29
|
+
#
|
30
|
+
def method
|
31
|
+
:get
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Path to the API endpoint for the request
|
36
|
+
#
|
37
|
+
# @return [String] path to the API endpoint
|
38
|
+
#
|
39
|
+
def url
|
40
|
+
[
|
41
|
+
"restricted",
|
42
|
+
"show",
|
43
|
+
attrs.name
|
44
|
+
].join("/")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2019, SUSE
|
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 Restricted
|
23
|
+
#
|
24
|
+
# Implementation for the restricted transition request
|
25
|
+
#
|
26
|
+
class Transition < Base
|
27
|
+
#
|
28
|
+
# Override the request content
|
29
|
+
#
|
30
|
+
# @return [Hash] the content for the request
|
31
|
+
#
|
32
|
+
def content
|
33
|
+
super.easy_merge!(
|
34
|
+
state: attrs.state
|
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
|
+
:post
|
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
|
+
"restricted",
|
55
|
+
"transition",
|
56
|
+
attrs.name
|
57
|
+
].join("/")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2019, SUSE
|
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
|
+
#
|
21
|
+
# Module for the SES request implementations
|
22
|
+
#
|
23
|
+
module Ses
|
24
|
+
autoload :Upload,
|
25
|
+
File.expand_path("../ses/upload", __FILE__)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2019, SUSE
|
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 Ses
|
23
|
+
#
|
24
|
+
# Implementation for the SES config upload request
|
25
|
+
#
|
26
|
+
class Upload < Base
|
27
|
+
#
|
28
|
+
# Override the request content
|
29
|
+
#
|
30
|
+
# @return [Hash] the content for the request
|
31
|
+
#
|
32
|
+
def content
|
33
|
+
super.easy_merge!(
|
34
|
+
sesconfig: {
|
35
|
+
file: attrs.file
|
36
|
+
}
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# HTTP method that gets used by the request
|
42
|
+
#
|
43
|
+
# @return [Symbol] the method for the request
|
44
|
+
#
|
45
|
+
def method
|
46
|
+
:post
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Path to the API endpoint for the request
|
51
|
+
#
|
52
|
+
# @return [String] path to the API endpoint
|
53
|
+
#
|
54
|
+
def url
|
55
|
+
[
|
56
|
+
"ses",
|
57
|
+
"settings",
|
58
|
+
"upload"
|
59
|
+
].join("/")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/crowbar/client/util.rb
CHANGED
@@ -40,15 +40,9 @@ module Crowbar
|
|
40
40
|
|
41
41
|
class << self
|
42
42
|
def default
|
43
|
-
|
43
|
+
os_release = OsRelease.fields
|
44
44
|
|
45
|
-
if
|
46
|
-
os_release = Hash[
|
47
|
-
File.open(os_release_file).read.scan(/(\S+)\s*=\s*"([^"]+)/)
|
48
|
-
]
|
49
|
-
|
50
|
-
return 1.0 if os_release["VERSION_ID"] == "12.1" && os_release["ID"] == "sles"
|
51
|
-
end
|
45
|
+
return 1.0 if os_release["VERSION_ID"] == "12.1" && os_release["ID"] == "sles"
|
52
46
|
|
53
47
|
2.0
|
54
48
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2019, SUSE
|
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 Util
|
20
|
+
class OsRelease
|
21
|
+
class << self
|
22
|
+
def fields
|
23
|
+
os_release_file = "/etc/os-release"
|
24
|
+
|
25
|
+
if File.exist?(os_release_file)
|
26
|
+
return Hash[
|
27
|
+
File.open(os_release_file).read.scan(/(\S+)\s*=\s*"([^"]+)/)
|
28
|
+
]
|
29
|
+
end
|
30
|
+
|
31
|
+
{}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crowbar-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Boerger
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-09-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -114,22 +114,22 @@ dependencies:
|
|
114
114
|
name: activesupport
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- - ">="
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: 3.0.0
|
120
117
|
- - "<"
|
121
118
|
- !ruby/object:Gem::Version
|
122
119
|
version: 5.0.0
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 3.0.0
|
123
123
|
type: :runtime
|
124
124
|
prerelease: false
|
125
125
|
version_requirements: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- - ">="
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: 3.0.0
|
130
127
|
- - "<"
|
131
128
|
- !ruby/object:Gem::Version
|
132
129
|
version: 5.0.0
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 3.0.0
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: rest-client
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -244,9 +244,11 @@ files:
|
|
244
244
|
- lib/crowbar/client/app/node.rb
|
245
245
|
- lib/crowbar/client/app/proposal.rb
|
246
246
|
- lib/crowbar/client/app/repository.rb
|
247
|
+
- lib/crowbar/client/app/restricted.rb
|
247
248
|
- lib/crowbar/client/app/role.rb
|
248
249
|
- lib/crowbar/client/app/server.rb
|
249
250
|
- lib/crowbar/client/app/services.rb
|
251
|
+
- lib/crowbar/client/app/ses.rb
|
250
252
|
- lib/crowbar/client/app/upgrade.rb
|
251
253
|
- lib/crowbar/client/app/virtual_ip.rb
|
252
254
|
- lib/crowbar/client/command.rb
|
@@ -309,6 +311,11 @@ files:
|
|
309
311
|
- lib/crowbar/client/command/repository/deactivate.rb
|
310
312
|
- lib/crowbar/client/command/repository/deactivate_all.rb
|
311
313
|
- lib/crowbar/client/command/repository/list.rb
|
314
|
+
- lib/crowbar/client/command/restricted.rb
|
315
|
+
- lib/crowbar/client/command/restricted/allocate.rb
|
316
|
+
- lib/crowbar/client/command/restricted/ping.rb
|
317
|
+
- lib/crowbar/client/command/restricted/show.rb
|
318
|
+
- lib/crowbar/client/command/restricted/transition.rb
|
312
319
|
- lib/crowbar/client/command/role.rb
|
313
320
|
- lib/crowbar/client/command/role/list.rb
|
314
321
|
- lib/crowbar/client/command/role/show.rb
|
@@ -320,6 +327,8 @@ files:
|
|
320
327
|
- lib/crowbar/client/command/services/disable_restart.rb
|
321
328
|
- lib/crowbar/client/command/services/list_restarts.rb
|
322
329
|
- lib/crowbar/client/command/services/restart_flags.rb
|
330
|
+
- lib/crowbar/client/command/ses.rb
|
331
|
+
- lib/crowbar/client/command/ses/upload.rb
|
323
332
|
- lib/crowbar/client/command/upgrade.rb
|
324
333
|
- lib/crowbar/client/command/upgrade/admin.rb
|
325
334
|
- lib/crowbar/client/command/upgrade/backup.rb
|
@@ -419,6 +428,11 @@ files:
|
|
419
428
|
- lib/crowbar/client/request/repository/deactivate_all.rb
|
420
429
|
- lib/crowbar/client/request/repository/list.rb
|
421
430
|
- lib/crowbar/client/request/rest.rb
|
431
|
+
- lib/crowbar/client/request/restricted.rb
|
432
|
+
- lib/crowbar/client/request/restricted/allocate.rb
|
433
|
+
- lib/crowbar/client/request/restricted/ping.rb
|
434
|
+
- lib/crowbar/client/request/restricted/show.rb
|
435
|
+
- lib/crowbar/client/request/restricted/transition.rb
|
422
436
|
- lib/crowbar/client/request/role.rb
|
423
437
|
- lib/crowbar/client/request/role/list.rb
|
424
438
|
- lib/crowbar/client/request/role/show.rb
|
@@ -430,6 +444,8 @@ files:
|
|
430
444
|
- lib/crowbar/client/request/services/disable_restart.rb
|
431
445
|
- lib/crowbar/client/request/services/list_restarts.rb
|
432
446
|
- lib/crowbar/client/request/services/restart_flags.rb
|
447
|
+
- lib/crowbar/client/request/ses.rb
|
448
|
+
- lib/crowbar/client/request/ses/upload.rb
|
433
449
|
- lib/crowbar/client/request/upgrade.rb
|
434
450
|
- lib/crowbar/client/request/upgrade/admin.rb
|
435
451
|
- lib/crowbar/client/request/upgrade/backup.rb
|
@@ -448,6 +464,7 @@ files:
|
|
448
464
|
- lib/crowbar/client/util.rb
|
449
465
|
- lib/crowbar/client/util/apiversion.rb
|
450
466
|
- lib/crowbar/client/util/editor.rb
|
467
|
+
- lib/crowbar/client/util/osrelease.rb
|
451
468
|
- lib/crowbar/client/util/runner.rb
|
452
469
|
- lib/crowbar/client/version.rb
|
453
470
|
- spec/crowbar/client/app_spec.rb
|
@@ -619,8 +636,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
619
636
|
- !ruby/object:Gem::Version
|
620
637
|
version: '0'
|
621
638
|
requirements: []
|
622
|
-
|
623
|
-
rubygems_version: 2.7.8
|
639
|
+
rubygems_version: 3.1.4
|
624
640
|
signing_key:
|
625
641
|
specification_version: 4
|
626
642
|
summary: Crowbar commandline client
|