collins_shell 0.2.23 → 0.2.24
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/Gemfile.lock +38 -28
- data/README.md +1 -0
- data/VERSION +1 -1
- data/bin/collins-shell +1 -1
- data/collins_shell.gemspec +1 -1
- data/lib/collins_shell/asset.rb +6 -1
- data/lib/collins_shell/ipmi.rb +30 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edb044740d90a2cd1cc62c7d9a2a45f13e083882
|
4
|
+
data.tar.gz: 30f98f31b84e199fa6711345d76f431171f5eb81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c1d768fcae3485bbedfcb778fef65bc39e7865c61aeedee8042a32b12e0cdbce4ff8076e0014718be1eec26d3aca8fc01fb898a54b4a6deab0e3e8f2408a72a
|
7
|
+
data.tar.gz: 272e82b851265ec363391d33ca5383a41a61025a5f84b6d12387671bcaa3f4f34bc1d9355fe4b375dfcd3cd327639f88c9863667028d6cf61df0eb1d224e4b03
|
data/Gemfile.lock
CHANGED
@@ -1,32 +1,46 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
collins_shell (0.2.24)
|
5
|
+
collins_client (~> 0.2.11)
|
6
|
+
highline (~> 1.6.15)
|
7
|
+
mustache (~> 0.99.4)
|
8
|
+
pry (~> 0.9.9.6)
|
9
|
+
terminal-table (~> 1.4.5)
|
10
|
+
thor (~> 0.16.0)
|
11
|
+
|
1
12
|
GEM
|
2
13
|
remote: http://rubygems.org/
|
3
14
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
15
|
+
capistrano (2.15.9)
|
16
|
+
highline
|
17
|
+
net-scp (>= 1.0.0)
|
18
|
+
net-sftp (>= 2.0.0)
|
19
|
+
net-ssh (>= 2.0.14)
|
20
|
+
net-ssh-gateway (>= 1.1.0)
|
21
|
+
coderay (1.0.9)
|
22
|
+
collins_client (0.2.19)
|
23
|
+
httparty (~> 0.11.0)
|
7
24
|
diff-lcs (1.1.3)
|
8
|
-
|
9
|
-
|
10
|
-
httparty (0.8.3)
|
25
|
+
highline (1.6.21)
|
26
|
+
httparty (0.11.0)
|
11
27
|
multi_json (~> 1.0)
|
12
|
-
multi_xml
|
13
|
-
jeweler (1.8.4)
|
14
|
-
bundler (~> 1.0)
|
15
|
-
git (>= 1.2.5)
|
16
|
-
rake
|
17
|
-
rdoc
|
18
|
-
json (1.7.5)
|
28
|
+
multi_xml (>= 0.5.2)
|
19
29
|
method_source (0.7.1)
|
20
|
-
multi_json (1.
|
21
|
-
multi_xml (0.
|
22
|
-
mustache (0.99.
|
30
|
+
multi_json (1.12.1)
|
31
|
+
multi_xml (0.6.0)
|
32
|
+
mustache (0.99.8)
|
33
|
+
net-scp (1.2.1)
|
34
|
+
net-ssh (>= 2.6.5)
|
35
|
+
net-sftp (2.1.2)
|
36
|
+
net-ssh (>= 2.6.5)
|
37
|
+
net-ssh (4.1.0)
|
38
|
+
net-ssh-gateway (2.0.0)
|
39
|
+
net-ssh (>= 4.0.0)
|
23
40
|
pry (0.9.9.6)
|
24
41
|
coderay (~> 1.0.5)
|
25
42
|
method_source (~> 0.7.1)
|
26
43
|
slop (>= 2.4.4, < 3)
|
27
|
-
rake (10.0.3)
|
28
|
-
rdoc (3.12)
|
29
|
-
json (~> 1.4)
|
30
44
|
redcarpet (2.2.2)
|
31
45
|
rspec (2.10.0)
|
32
46
|
rspec-core (~> 2.10.0)
|
@@ -36,7 +50,6 @@ GEM
|
|
36
50
|
rspec-expectations (2.10.0)
|
37
51
|
diff-lcs (~> 1.1.3)
|
38
52
|
rspec-mocks (2.10.1)
|
39
|
-
rubygems-update (1.8.24)
|
40
53
|
slop (2.4.4)
|
41
54
|
terminal-table (1.4.5)
|
42
55
|
thor (0.16.0)
|
@@ -46,14 +59,11 @@ PLATFORMS
|
|
46
59
|
ruby
|
47
60
|
|
48
61
|
DEPENDENCIES
|
49
|
-
|
50
|
-
|
51
|
-
jeweler (~> 1.8.3)
|
52
|
-
mustache (~> 0.99.4)
|
53
|
-
pry (~> 0.9.9.6)
|
62
|
+
capistrano (~> 2.15.5)
|
63
|
+
collins_shell!
|
54
64
|
redcarpet
|
55
65
|
rspec (~> 2.10.0)
|
56
|
-
rubygems-update (~> 1.8.24)
|
57
|
-
terminal-table (~> 1.4.5)
|
58
|
-
thor (~> 0.16.0)
|
59
66
|
yard (~> 0.8)
|
67
|
+
|
68
|
+
BUNDLED WITH
|
69
|
+
1.13.6
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.24
|
data/bin/collins-shell
CHANGED
@@ -11,7 +11,7 @@ end
|
|
11
11
|
|
12
12
|
$:.unshift File.join File.dirname(__FILE__), *%w[.. lib]
|
13
13
|
# Allows us to use a dev version of collins-client if needed
|
14
|
-
$:.unshift File.join File.dirname(__FILE__), *%w[.. ..
|
14
|
+
$:.unshift File.join File.dirname(__FILE__), *%w[.. .. collins-client lib]
|
15
15
|
%w[collins_shell collins_shell/cli].each {|f| require f}
|
16
16
|
|
17
17
|
begin
|
data/collins_shell.gemspec
CHANGED
@@ -56,7 +56,7 @@ Gem::Specification.new do |s|
|
|
56
56
|
s.require_paths = ['lib']
|
57
57
|
s.summary = 'Shell for Collins API'
|
58
58
|
|
59
|
-
s.add_runtime_dependency('collins_client', '~> 0.2.
|
59
|
+
s.add_runtime_dependency('collins_client', '~> 0.2.20')
|
60
60
|
s.add_runtime_dependency('highline','~> 1.6.15')
|
61
61
|
s.add_runtime_dependency('mustache','~> 0.99.4')
|
62
62
|
s.add_runtime_dependency('pry','~> 0.9.9.6')
|
data/lib/collins_shell/asset.rb
CHANGED
@@ -20,9 +20,14 @@ module CollinsShell
|
|
20
20
|
method_option :ipmi, :type => :boolean, :desc => 'Generate IPMI data'
|
21
21
|
method_option :status, :type => :string, :desc => 'Status of asset'
|
22
22
|
method_option :type, :type => :string, :desc => 'Asset type'
|
23
|
+
method_option :ipmi_pool, :type => :string, :desc => 'IPMI pool'
|
23
24
|
def create
|
24
25
|
call_collins get_collins_client, "create asset" do |client|
|
25
|
-
asset = client.create!
|
26
|
+
asset = client.create!(options.tag,
|
27
|
+
:generate_ipmi => options.ipmi,
|
28
|
+
:status => options.status,
|
29
|
+
:type => options.type,
|
30
|
+
:ipmi_pool => options.ipmi_pool)
|
26
31
|
print_find_results asset, nil
|
27
32
|
end
|
28
33
|
end
|
data/lib/collins_shell/ipmi.rb
CHANGED
@@ -26,6 +26,22 @@ module CollinsShell
|
|
26
26
|
puts([ipmi.address,ipmi.gateway,ipmi.netmask,ipmi.username,ipmi.password].join(','))
|
27
27
|
end
|
28
28
|
|
29
|
+
desc 'generate', 'generate new IPMI address and creds'
|
30
|
+
use_collins_options
|
31
|
+
use_tag_option(true)
|
32
|
+
method_option :pool, :type => :string, :required => false, :desc => 'IPMI pool'
|
33
|
+
def generate
|
34
|
+
call_collins get_collins_client, "generate ipmi" do |client|
|
35
|
+
ipmi = client.ipmi_allocate options.tag, :pool => options.pool
|
36
|
+
if ipmi then
|
37
|
+
asset = client.get options.tag
|
38
|
+
CollinsShell::Ipmi.print_ipmi asset.ipmi
|
39
|
+
else
|
40
|
+
say_error "generate IPMI address"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
29
45
|
desc 'create', 'create a new IPMI address for the specified asset'
|
30
46
|
use_collins_options
|
31
47
|
use_tag_option(true)
|
@@ -62,6 +78,20 @@ module CollinsShell
|
|
62
78
|
end
|
63
79
|
end
|
64
80
|
|
81
|
+
desc 'pools', 'find all ipmi pools that are defined'
|
82
|
+
use_collins_options
|
83
|
+
def pools
|
84
|
+
call_collins get_collins_client, "ipmi pools" do |client|
|
85
|
+
# NAME, NETWORK, START_ADDRESS, SPECIFIED_GATEWAY, GATEWAY, BROADCAST, POSSIBLE_ADDRESSES
|
86
|
+
header = [["Pool","Network","Gateway","Broadcast","Possible Addresses","Start Address","Specified Gateway"]]
|
87
|
+
rows = client.ipmi_pools.map do |pool|
|
88
|
+
[pool["NAME"], pool["NETWORK"], pool["GATEWAY"], pool["BROADCAST"], pool["POSSIBLE_ADDRESSES"],
|
89
|
+
pool["START_ADDRESS"], pool["SPECIFIED_GATEWAY"]]
|
90
|
+
end
|
91
|
+
print_table header + rows
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
65
95
|
end
|
66
96
|
|
67
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collins_shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Matheny
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.2.
|
21
|
+
version: 0.2.20
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.2.
|
28
|
+
version: 0.2.20
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: highline
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.
|
222
|
+
rubygems_version: 2.6.12
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Shell for Collins API
|