idrac 0.5.3 → 0.5.5
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/bin/idrac +27 -27
- data/lib/idrac/client.rb +27 -0
- data/lib/idrac/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 905a49888753b1dcfe826181f2a758083ef39a0964afefac2358ff17474645aa
|
4
|
+
data.tar.gz: e45f1e19020802027765730e0903cd57191964d0d6d14638a919f1da0dec8ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f09916115ddf02707df2f193eef9e0e7172a92c8fce94a1960002fed7429aa0bc4802d31074c3684e93404ea7c21de20a314340359a17b634c9db83b4590625
|
7
|
+
data.tar.gz: aeb4bea7d57908961898095dbf38c934f2178d42785b8ce630aaf0c6ebf6fe1d6b6c83f3e8b615ca28797c196e938a4a83f2c4a0e8c83fa152976891308d6c18
|
data/bin/idrac
CHANGED
@@ -557,10 +557,10 @@ module IDRAC
|
|
557
557
|
with_idrac_client do |client|
|
558
558
|
controller = client.controller
|
559
559
|
puts "\nStorage Controller Summary:".green.bold
|
560
|
-
puts "Name: #{controller
|
561
|
-
puts "Model: #{controller
|
562
|
-
puts "Health: #{controller
|
563
|
-
puts "Manufacturer: #{controller
|
560
|
+
puts "Name: #{controller.name}".cyan
|
561
|
+
puts "Model: #{controller.model}".cyan
|
562
|
+
puts "Health: #{controller.status&.health || 'Unknown'}".cyan
|
563
|
+
puts "Manufacturer: #{controller.manufacturer}".cyan
|
564
564
|
|
565
565
|
if client.controller_encryption_capable?(controller)
|
566
566
|
puts "Encryption Capable: Yes".green
|
@@ -581,17 +581,17 @@ module IDRAC
|
|
581
581
|
puts "-" * 80
|
582
582
|
|
583
583
|
controllers.each do |controller|
|
584
|
-
puts "Controller: #{controller
|
585
|
-
puts " Model: #{controller
|
586
|
-
puts " Status: #{controller
|
587
|
-
puts " Drives: #{controller
|
588
|
-
puts " Firmware: #{controller
|
589
|
-
puts " Type: #{controller
|
590
|
-
puts " PCI Slot: #{controller
|
584
|
+
puts "Controller: #{controller.name}".cyan.bold
|
585
|
+
puts " Model: #{controller.model}"
|
586
|
+
puts " Status: #{controller.status}"
|
587
|
+
puts " Drives: #{controller.drives_count}"
|
588
|
+
puts " Firmware: #{controller.firmware_version}"
|
589
|
+
puts " Type: #{controller.controller_type}"
|
590
|
+
puts " PCI Slot: #{controller.pci_slot}"
|
591
591
|
|
592
|
-
if controller
|
593
|
-
puts " Encryption: #{controller
|
594
|
-
puts " Encryption Mode: #{controller
|
592
|
+
if controller.encryption_capability
|
593
|
+
puts " Encryption: #{controller.encryption_capability}"
|
594
|
+
puts " Encryption Mode: #{controller.encryption_mode || 'Disabled'}"
|
595
595
|
end
|
596
596
|
|
597
597
|
puts
|
@@ -610,17 +610,17 @@ module IDRAC
|
|
610
610
|
|
611
611
|
puts "\nPhysical Drives (#{drives.size}):".green.bold
|
612
612
|
drives.each do |drive|
|
613
|
-
capacity_gb = drive
|
614
|
-
health_color = drive
|
613
|
+
capacity_gb = drive.capacity_bytes.to_f / (1024**3)
|
614
|
+
health_color = drive.health == "OK" ? :green : :red
|
615
615
|
|
616
|
-
puts "#{drive
|
617
|
-
puts " Model: #{drive
|
618
|
-
puts " Health: #{drive
|
616
|
+
puts "#{drive.name}:".bold
|
617
|
+
puts " Model: #{drive.model}".cyan
|
618
|
+
puts " Health: #{drive.health.send(health_color)}"
|
619
619
|
puts " Capacity: #{capacity_gb.round(2)} GB".cyan
|
620
|
-
puts " Media Type: #{drive
|
621
|
-
puts " Serial: #{drive
|
622
|
-
if drive
|
623
|
-
puts " Encryption: #{drive
|
620
|
+
puts " Media Type: #{drive.media_type}".cyan
|
621
|
+
puts " Serial: #{drive.serial}".cyan
|
622
|
+
if drive.encryption_ability
|
623
|
+
puts " Encryption: #{drive.encryption_ability}".cyan
|
624
624
|
end
|
625
625
|
puts ""
|
626
626
|
end
|
@@ -675,7 +675,7 @@ module IDRAC
|
|
675
675
|
confirmation = $stdin.gets.chomp.downcase
|
676
676
|
|
677
677
|
if confirmation == 'y'
|
678
|
-
client.create_virtual_disk(controller
|
678
|
+
client.create_virtual_disk(controller.odata_id, drives, name: options[:name], raid_type: options[:raid])
|
679
679
|
puts "Volume created successfully".green
|
680
680
|
else
|
681
681
|
puts "Operation cancelled".yellow
|
@@ -763,7 +763,7 @@ module IDRAC
|
|
763
763
|
# Get keyid if not provided
|
764
764
|
keyid = options[:keyid] || "RAID-Key-#{Time.now.strftime('%Y%m%d')}"
|
765
765
|
|
766
|
-
client.enable_local_key_management(controller
|
766
|
+
client.enable_local_key_management(controller.odata_id, passphrase: passphrase, keyid: keyid)
|
767
767
|
puts "Encryption enabled successfully".green
|
768
768
|
end
|
769
769
|
end
|
@@ -784,7 +784,7 @@ module IDRAC
|
|
784
784
|
confirmation = $stdin.gets.chomp
|
785
785
|
|
786
786
|
if confirmation == 'DISABLE'
|
787
|
-
client.disable_local_key_management(controller
|
787
|
+
client.disable_local_key_management(controller.odata_id)
|
788
788
|
puts "Encryption disabled successfully".green
|
789
789
|
else
|
790
790
|
puts "Operation cancelled".yellow
|
@@ -1262,7 +1262,7 @@ module IDRAC
|
|
1262
1262
|
puts "\n[TEST] Storage management".cyan.bold
|
1263
1263
|
begin
|
1264
1264
|
controller = client.controller
|
1265
|
-
puts "✓ Storage controller: #{controller
|
1265
|
+
puts "✓ Storage controller: #{controller.name} (#{controller.model})".green
|
1266
1266
|
|
1267
1267
|
drives = client.drives(controller)
|
1268
1268
|
puts "✓ Found #{drives.size} physical drives".green
|
data/lib/idrac/client.rb
CHANGED
@@ -302,6 +302,33 @@ module IDRAC
|
|
302
302
|
end
|
303
303
|
end
|
304
304
|
|
305
|
+
def get_firmware_version
|
306
|
+
response = authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1?$select=FirmwareVersion")
|
307
|
+
|
308
|
+
if response.status == 200
|
309
|
+
begin
|
310
|
+
data = JSON.parse(response.body)
|
311
|
+
return data["FirmwareVersion"]
|
312
|
+
rescue JSON::ParserError
|
313
|
+
raise Error, "Failed to parse firmware version response: #{response.body}"
|
314
|
+
end
|
315
|
+
else
|
316
|
+
# Try again without the $select parameter for older firmware
|
317
|
+
response = authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1")
|
318
|
+
|
319
|
+
if response.status == 200
|
320
|
+
begin
|
321
|
+
data = JSON.parse(response.body)
|
322
|
+
return data["FirmwareVersion"]
|
323
|
+
rescue JSON::ParserError
|
324
|
+
raise Error, "Failed to parse firmware version response: #{response.body}"
|
325
|
+
end
|
326
|
+
else
|
327
|
+
raise Error, "Failed to get firmware version. Status code: #{response.status}"
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
305
332
|
# Execute a block with automatic retries
|
306
333
|
# @param max_retries [Integer] Maximum number of retry attempts
|
307
334
|
# @param initial_delay [Integer] Initial delay in seconds between retries (increases exponentially)
|
data/lib/idrac/version.rb
CHANGED