collins_client 0.2.20 → 0.2.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/collins_client.gemspec +1 -0
- data/lib/collins/api.rb +2 -0
- data/lib/collins/api/asset.rb +1 -0
- data/lib/collins/api/ipmi.rb +17 -0
- data/lib/collins/asset.rb +9 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6afd6d1e81ac9f0be91c9f51a1f70ab3061d517
|
4
|
+
data.tar.gz: 267ac66abed3eaa9097aa327730937cef88e7242
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a26161a69c4fc8e7a85a68e3024ba0ad04df1b0be9dae45fe255cbdd0ef897eb8a70402387bbfe55640c76273e3940c0e2552653f4de60135b18e8a618c82f8
|
7
|
+
data.tar.gz: eedba513d88c58b05e54874eb3e43428261dbf2acf0cac7a98469d2f7f46e8a070d480b2619c1573db42bfa27a8a303dbf786534a44d8796a9021c8b8bc52d14
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.21
|
data/collins_client.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
"lib/collins/api/asset_type.rb",
|
25
25
|
"lib/collins/api/attributes.rb",
|
26
26
|
"lib/collins/api/ip_address.rb",
|
27
|
+
"lib/collins/api/ipmi.rb",
|
27
28
|
"lib/collins/api/logging.rb",
|
28
29
|
"lib/collins/api/management.rb",
|
29
30
|
"lib/collins/api/tag.rb",
|
data/lib/collins/api.rb
CHANGED
@@ -4,6 +4,7 @@ require 'collins/api/asset_state'
|
|
4
4
|
require 'collins/api/asset_type'
|
5
5
|
require 'collins/api/attributes'
|
6
6
|
require 'collins/api/ip_address'
|
7
|
+
require 'collins/api/ipmi'
|
7
8
|
require 'collins/api/logging'
|
8
9
|
require 'collins/api/management'
|
9
10
|
require 'collins/api/tag'
|
@@ -108,6 +109,7 @@ module Collins
|
|
108
109
|
include Collins::Api::AssetType
|
109
110
|
include Collins::Api::Attributes
|
110
111
|
include Collins::Api::IpAddress
|
112
|
+
include Collins::Api::Ipmi
|
111
113
|
include Collins::Api::Logging
|
112
114
|
include Collins::Api::Management
|
113
115
|
include Collins::Api::Tag
|
data/lib/collins/api/asset.rb
CHANGED
@@ -8,6 +8,7 @@ module Collins; module Api
|
|
8
8
|
asset = get_asset_or_tag asset_or_tag
|
9
9
|
parameters = {
|
10
10
|
:generate_ipmi => get_option(:generate_ipmi, options, false),
|
11
|
+
:ipmi_pool => get_option(:ipmi_pool, options, nil),
|
11
12
|
:status => get_option(:status, options, asset.status),
|
12
13
|
:type => get_option(:type, options, asset.type)
|
13
14
|
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
module Collins; module Api
|
3
|
+
|
4
|
+
module Ipmi
|
5
|
+
|
6
|
+
def ipmi_pools
|
7
|
+
logger.debug("Finding IPMI address pools")
|
8
|
+
http_get("/api/ipmi/pools") do |response|
|
9
|
+
parse_response response, :expects => 200, :default => [], :raise => strict? do |json|
|
10
|
+
json["data"]["POOLS"]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end # module Ipmi
|
16
|
+
|
17
|
+
end; end
|
data/lib/collins/asset.rb
CHANGED
@@ -193,6 +193,15 @@ module Collins
|
|
193
193
|
extract(extras, "HARDWARE", "CPU") || []
|
194
194
|
end
|
195
195
|
|
196
|
+
# @return [Fixnum] Number of GPU's found
|
197
|
+
def gpu_count
|
198
|
+
(extract(extras, "HARDWARE", "GPU") || []).length
|
199
|
+
end
|
200
|
+
# @return [Array<Hash>] GPU information
|
201
|
+
def gpus
|
202
|
+
extract(extras, "HARDWARE", "GPU") || []
|
203
|
+
end
|
204
|
+
|
196
205
|
# @return [Array<Hash>] Disk information
|
197
206
|
def disks
|
198
207
|
extract(extras, "HARDWARE", "DISK") || []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collins_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Matheny
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/collins/api/asset_type.rb
|
120
120
|
- lib/collins/api/attributes.rb
|
121
121
|
- lib/collins/api/ip_address.rb
|
122
|
+
- lib/collins/api/ipmi.rb
|
122
123
|
- lib/collins/api/logging.rb
|
123
124
|
- lib/collins/api/management.rb
|
124
125
|
- lib/collins/api/tag.rb
|