idrac 0.8.0 → 0.8.1
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/idrac.gemspec +4 -4
- data/lib/idrac/firmware.rb +3 -3
- data/lib/idrac/storage.rb +1 -1
- data/lib/idrac/system.rb +5 -5
- data/lib/idrac/utility.rb +2 -2
- data/lib/idrac/version.rb +1 -1
- metadata +7 -13
- data/bin/idrac-tsr +0 -90
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 527454266f07cf2a797f42c324d9a8a17ddc2586f72aa00af935500ea4386ef1
|
4
|
+
data.tar.gz: 3ff97e72d6947dd6c08e34d7682daa579b3bf3d4f505726feb4ab280172db56e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a76db748a58725fe2c6409c40df95449d5a648a9647a816e8653f2c31adcb519d2d88a2e1a452e902ce7efb65d868f78e2a9bc09bf4952aaf141ed1b518b9836
|
7
|
+
data.tar.gz: 1e2bca28672a8ac30ad0573040374d016417a77cc6c264fb5434ce1ed40561260cccb54eb58385aeebe749fc27de20d780adeee82a67dabc7a49f54e299033bb
|
data/idrac.gemspec
CHANGED
@@ -10,14 +10,14 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = "API Client for Dell iDRAC"
|
12
12
|
spec.description = "A Ruby client for the Dell iDRAC API"
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/buildio/idrac"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">=
|
15
|
+
spec.required_ruby_version = ">= 2.7.0"
|
16
16
|
|
17
17
|
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
18
18
|
|
19
19
|
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
-
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/buildio/idrac"
|
21
21
|
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
22
22
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
|
|
41
41
|
spec.add_dependency "thor", "~> 1.2", ">= 1.2.0"
|
42
42
|
spec.add_dependency "base64", "~> 0.1", ">= 0.1.0"
|
43
43
|
spec.add_dependency "colorize", "~> 1.1", ">= 1.1.0"
|
44
|
-
spec.add_dependency "activesupport", ">=
|
44
|
+
spec.add_dependency "activesupport", ">= 7.0"
|
45
45
|
|
46
46
|
# Development dependencies
|
47
47
|
spec.add_development_dependency "bundler", "~> 2.4", ">= 2.4.0"
|
data/lib/idrac/firmware.rb
CHANGED
@@ -57,7 +57,7 @@ module IDRAC
|
|
57
57
|
puts "Retrieving system inventory..."
|
58
58
|
|
59
59
|
# Get basic system information
|
60
|
-
system_uri = URI.parse("#{client.base_url}/redfish/v1/Systems/System.Embedded.1")
|
60
|
+
# system_uri = URI.parse("#{client.base_url}/redfish/v1/Systems/System.Embedded.1") # Not used, kept for reference
|
61
61
|
system_response = client.authenticated_request(:get, "/redfish/v1/Systems/System.Embedded.1")
|
62
62
|
|
63
63
|
if system_response.status != 200
|
@@ -67,7 +67,7 @@ module IDRAC
|
|
67
67
|
system_data = JSON.parse(system_response.body)
|
68
68
|
|
69
69
|
# Get firmware inventory
|
70
|
-
firmware_uri = URI.parse("#{client.base_url}/redfish/v1/UpdateService/FirmwareInventory")
|
70
|
+
# firmware_uri = URI.parse("#{client.base_url}/redfish/v1/UpdateService/FirmwareInventory") # Not used, kept for reference
|
71
71
|
firmware_response = client.authenticated_request(:get, "/redfish/v1/UpdateService/FirmwareInventory")
|
72
72
|
|
73
73
|
if firmware_response.status != 200
|
@@ -479,7 +479,7 @@ module IDRAC
|
|
479
479
|
end
|
480
480
|
|
481
481
|
# Upload the firmware file
|
482
|
-
file_content = File.read(firmware_path)
|
482
|
+
# file_content = File.read(firmware_path) # Not used directly, file is read by Faraday
|
483
483
|
|
484
484
|
headers = {
|
485
485
|
'Content-Type' => 'multipart/form-data',
|
data/lib/idrac/storage.rb
CHANGED
@@ -212,7 +212,7 @@ module IDRAC
|
|
212
212
|
if controller_comp
|
213
213
|
# Try to find the matching virtual disk
|
214
214
|
# Format is typically "Disk.Virtual.X:RAID...."
|
215
|
-
vd_name = vol["Id"] || vol["Name"]
|
215
|
+
# vd_name = vol["Id"] || vol["Name"] # Not used, kept for debugging
|
216
216
|
vd_comp = controller_comp["Components"]&.find do |comp|
|
217
217
|
comp["FQDD"] =~ /Disk\.Virtual\.\d+:#{controller_fqdd}/
|
218
218
|
end
|
data/lib/idrac/system.rb
CHANGED
@@ -142,7 +142,7 @@ module IDRAC
|
|
142
142
|
end
|
143
143
|
end
|
144
144
|
end
|
145
|
-
rescue
|
145
|
+
rescue
|
146
146
|
# Ignore errors, just continue
|
147
147
|
end
|
148
148
|
|
@@ -152,7 +152,7 @@ module IDRAC
|
|
152
152
|
if idrac_net && idrac_net["mac"] && idrac_net["ipv4"]
|
153
153
|
nic_ip_map[idrac_net["mac"].upcase] = idrac_net["ipv4"]
|
154
154
|
end
|
155
|
-
rescue
|
155
|
+
rescue
|
156
156
|
# Ignore errors, just continue
|
157
157
|
end
|
158
158
|
|
@@ -218,7 +218,7 @@ module IDRAC
|
|
218
218
|
break
|
219
219
|
end
|
220
220
|
end
|
221
|
-
rescue
|
221
|
+
rescue
|
222
222
|
# Ignore errors and try the next port type
|
223
223
|
end
|
224
224
|
end
|
@@ -775,7 +775,7 @@ module IDRAC
|
|
775
775
|
|
776
776
|
# Try to get license information (new approach that works with iDRAC 8 too)
|
777
777
|
license_info = license_info() rescue nil
|
778
|
-
license_version = license_version() rescue nil
|
778
|
+
# license_version = license_version() rescue nil # Not used currently
|
779
779
|
|
780
780
|
if license_info
|
781
781
|
license_type = license_info["LicenseType"] || "Unknown"
|
@@ -819,4 +819,4 @@ module IDRAC
|
|
819
819
|
end
|
820
820
|
end
|
821
821
|
end
|
822
|
-
end
|
822
|
+
end
|
data/lib/idrac/utility.rb
CHANGED
@@ -374,7 +374,7 @@ module IDRAC
|
|
374
374
|
break
|
375
375
|
end
|
376
376
|
sleep 30
|
377
|
-
rescue
|
377
|
+
rescue
|
378
378
|
tries += 1
|
379
379
|
if tries > 5
|
380
380
|
debug "Failed to reconnect to iDRAC after 5 attempts", 1, :red
|
@@ -395,7 +395,7 @@ module IDRAC
|
|
395
395
|
else
|
396
396
|
debug "Failed to reset iDRAC. Status code: #{response.status}", 1, :red
|
397
397
|
end
|
398
|
-
rescue
|
398
|
+
rescue
|
399
399
|
debug "Failed to reset iDRAC. Status code: #{response.status}", 1, :red
|
400
400
|
debug "Error response: #{response.body}", 2, :red
|
401
401
|
end
|
data/lib/idrac/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idrac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Siegel
|
@@ -155,20 +155,14 @@ dependencies:
|
|
155
155
|
requirements:
|
156
156
|
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
159
|
-
- - "<"
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
version: '8.1'
|
158
|
+
version: '7.0'
|
162
159
|
type: :runtime
|
163
160
|
prerelease: false
|
164
161
|
version_requirements: !ruby/object:Gem::Requirement
|
165
162
|
requirements:
|
166
163
|
- - ">="
|
167
164
|
- !ruby/object:Gem::Version
|
168
|
-
version: '
|
169
|
-
- - "<"
|
170
|
-
- !ruby/object:Gem::Version
|
171
|
-
version: '8.1'
|
165
|
+
version: '7.0'
|
172
166
|
- !ruby/object:Gem::Dependency
|
173
167
|
name: bundler
|
174
168
|
requirement: !ruby/object:Gem::Requirement
|
@@ -260,7 +254,6 @@ files:
|
|
260
254
|
- README.md
|
261
255
|
- bin/console
|
262
256
|
- bin/idrac
|
263
|
-
- bin/idrac-tsr
|
264
257
|
- bin/setup
|
265
258
|
- idrac.gemspec
|
266
259
|
- lib/idrac.rb
|
@@ -281,11 +274,12 @@ files:
|
|
281
274
|
- lib/idrac/version.rb
|
282
275
|
- lib/idrac/virtual_media.rb
|
283
276
|
- lib/idrac/web.rb
|
284
|
-
homepage:
|
277
|
+
homepage: https://github.com/buildio/idrac
|
285
278
|
licenses:
|
286
279
|
- MIT
|
287
280
|
metadata:
|
288
|
-
homepage_uri:
|
281
|
+
homepage_uri: https://github.com/buildio/idrac
|
282
|
+
source_code_uri: https://github.com/buildio/idrac
|
289
283
|
rdoc_options: []
|
290
284
|
require_paths:
|
291
285
|
- lib
|
@@ -293,7 +287,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
293
287
|
requirements:
|
294
288
|
- - ">="
|
295
289
|
- !ruby/object:Gem::Version
|
296
|
-
version:
|
290
|
+
version: 2.7.0
|
297
291
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
292
|
requirements:
|
299
293
|
- - ">="
|
data/bin/idrac-tsr
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require_relative '../lib/idrac'
|
4
|
-
require 'optparse'
|
5
|
-
|
6
|
-
options = {
|
7
|
-
host: ENV['IDRAC_HOST'],
|
8
|
-
username: ENV['IDRAC_USER'] || 'root',
|
9
|
-
password: ENV['IDRAC_PASSWORD'] || 'calvin',
|
10
|
-
output: nil,
|
11
|
-
data_types: [0, 1, 2], # Default: Hardware, OS, Debug
|
12
|
-
timeout: 600,
|
13
|
-
verbose: false
|
14
|
-
}
|
15
|
-
|
16
|
-
OptionParser.new do |opts|
|
17
|
-
opts.banner = "Usage: idrac-tsr [options]"
|
18
|
-
|
19
|
-
opts.on("-h", "--host HOST", "iDRAC host address") do |h|
|
20
|
-
options[:host] = h
|
21
|
-
end
|
22
|
-
|
23
|
-
opts.on("-u", "--username USER", "Username (default: root)") do |u|
|
24
|
-
options[:username] = u
|
25
|
-
end
|
26
|
-
|
27
|
-
opts.on("-p", "--password PASS", "Password (default: calvin)") do |p|
|
28
|
-
options[:password] = p
|
29
|
-
end
|
30
|
-
|
31
|
-
opts.on("-o", "--output FILE", "Output filename (default: auto-generated)") do |o|
|
32
|
-
options[:output] = o
|
33
|
-
end
|
34
|
-
|
35
|
-
opts.on("-d", "--data TYPES", "Data types to collect (comma-separated: 0=HW,1=OS,2=Debug,3=TTY,4=All)") do |d|
|
36
|
-
options[:data_types] = d.split(',').map(&:to_i)
|
37
|
-
end
|
38
|
-
|
39
|
-
opts.on("-t", "--timeout SECONDS", Integer, "Timeout in seconds (default: 600)") do |t|
|
40
|
-
options[:timeout] = t
|
41
|
-
end
|
42
|
-
|
43
|
-
opts.on("-v", "--verbose", "Verbose output") do
|
44
|
-
options[:verbose] = true
|
45
|
-
end
|
46
|
-
|
47
|
-
opts.on("--help", "Show this message") do
|
48
|
-
puts opts
|
49
|
-
exit
|
50
|
-
end
|
51
|
-
end.parse!
|
52
|
-
|
53
|
-
if options[:host].nil?
|
54
|
-
puts "Error: Host is required. Use -h HOST or set IDRAC_HOST environment variable"
|
55
|
-
exit 1
|
56
|
-
end
|
57
|
-
|
58
|
-
begin
|
59
|
-
client = IDRAC::Client.new(
|
60
|
-
host: options[:host],
|
61
|
-
username: options[:username],
|
62
|
-
password: options[:password],
|
63
|
-
verify_ssl: false
|
64
|
-
)
|
65
|
-
|
66
|
-
client.verbosity = options[:verbose] ? 1 : 0
|
67
|
-
|
68
|
-
puts "Connecting to #{options[:host]}..."
|
69
|
-
client.login
|
70
|
-
|
71
|
-
puts "Generating TSR logs (this may take several minutes)..."
|
72
|
-
result = client.generate_and_download_tsr(
|
73
|
-
output_file: options[:output],
|
74
|
-
data_selector_values: options[:data_types],
|
75
|
-
wait_timeout: options[:timeout]
|
76
|
-
)
|
77
|
-
|
78
|
-
if result
|
79
|
-
puts "✓ TSR logs saved to: #{result}"
|
80
|
-
puts " File size: #{File.size(result) / 1024 / 1024} MB" if File.exist?(result)
|
81
|
-
else
|
82
|
-
puts "✗ Failed to download TSR logs"
|
83
|
-
exit 1
|
84
|
-
end
|
85
|
-
|
86
|
-
client.logout
|
87
|
-
rescue => e
|
88
|
-
puts "Error: #{e.message}"
|
89
|
-
exit 1
|
90
|
-
end
|