radfish-idrac 0.1.4 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a58b55f6a0455e66cd44bed5363451e773c675d2a9fd65d7fa5e6bae77669778
4
- data.tar.gz: fab0e351a3112e0376b6d065e5faeb6280f7a2dfea90db9d8845bca67e82e4fb
3
+ metadata.gz: bd2c3bf25651e2968b2bbb5646abfe3be4af7679d750f1f5d958a8440db7762a
4
+ data.tar.gz: e6235fd71297dc9ef3feea51d9d30e8ad80e645e4b37e8000a396be45fa628ec
5
5
  SHA512:
6
- metadata.gz: 05f39a32177f9ef7f07fed8d5911d5a0d6bccaad7d315868895356e645866a39ab6a2a6bb1063349925d82336cc65736ffee6a594dad88e643f501035289e658
7
- data.tar.gz: 8e5e9cd3ef3f62d3152b695c35702bccd924df41540bac3434d20182f67c829eee7fa65ccd553ecaf43b75cd9bbbecfef1313269e63a2855aa5b984f831d0178
6
+ metadata.gz: c8a449130e8451cf9eacb9fc5cccbba1d8180ce874933488426b8ae1c589313a8ba6f725115351b40b2cf8c334869b6973c2d076231fe3347cbe96eed2727fb5
7
+ data.tar.gz: 8835042ad7199c7a88965099f2e5473101db5e5c7597ba09a195b1b790743aee2f2c2f7a1ba1110697094ac3dd8737154123e3c84f4bded61ea1f036c842888f
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Radfish
4
4
  module Idrac
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
@@ -302,16 +302,56 @@ module Radfish
302
302
  end
303
303
  end
304
304
 
305
- def drives
306
- @idrac_client.drives
305
+ def drives(controller_id)
306
+ # The iDRAC gem requires a controller_id
307
+ raise ArgumentError, "Controller ID is required" unless controller_id
308
+
309
+ drive_data = @idrac_client.drives(controller_id)
310
+
311
+ # Convert to OpenStruct for consistency
312
+ drive_data.map { |drive| OpenStruct.new(drive) }
307
313
  end
308
314
 
309
- def volumes
310
- @idrac_client.volumes
315
+ def volumes(controller_id)
316
+ # The iDRAC gem requires a controller_id
317
+ raise ArgumentError, "Controller ID is required" unless controller_id
318
+
319
+ volume_data = @idrac_client.volumes(controller_id)
320
+
321
+ # Convert to OpenStruct for consistency
322
+ volume_data.map { |volume| OpenStruct.new(volume) }
311
323
  end
312
324
 
313
325
  def storage_summary
314
- @idrac_client.storage_summary
326
+ # The iDRAC gem doesn't have a storage_summary method
327
+ # We need to build it from controllers, drives, and volumes
328
+ begin
329
+ controllers = @idrac_client.controllers
330
+ total_drives = 0
331
+ total_volumes = 0
332
+
333
+ controllers.each do |controller|
334
+ if controller["@odata.id"]
335
+ drives = @idrac_client.drives(controller["@odata.id"]) rescue []
336
+ volumes = @idrac_client.volumes(controller["@odata.id"]) rescue []
337
+ total_drives += drives.size
338
+ total_volumes += volumes.size
339
+ end
340
+ end
341
+
342
+ {
343
+ "controller_count" => controllers.size,
344
+ "drive_count" => total_drives,
345
+ "volume_count" => total_volumes
346
+ }
347
+ rescue => e
348
+ puts "Error fetching storage summary: #{e.message}" if @debug
349
+ {
350
+ "controller_count" => 0,
351
+ "drive_count" => 0,
352
+ "volume_count" => 0
353
+ }
354
+ end
315
355
  end
316
356
 
317
357
  # Virtual Media
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radfish-idrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Siegel