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 +4 -4
- data/lib/radfish/idrac/version.rb +1 -1
- data/lib/radfish/idrac_adapter.rb +45 -5
- 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: bd2c3bf25651e2968b2bbb5646abfe3be4af7679d750f1f5d958a8440db7762a
|
4
|
+
data.tar.gz: e6235fd71297dc9ef3feea51d9d30e8ad80e645e4b37e8000a396be45fa628ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8a449130e8451cf9eacb9fc5cccbba1d8180ce874933488426b8ae1c589313a8ba6f725115351b40b2cf8c334869b6973c2d076231fe3347cbe96eed2727fb5
|
7
|
+
data.tar.gz: 8835042ad7199c7a88965099f2e5473101db5e5c7597ba09a195b1b790743aee2f2c2f7a1ba1110697094ac3dd8737154123e3c84f4bded61ea1f036c842888f
|
@@ -302,16 +302,56 @@ module Radfish
|
|
302
302
|
end
|
303
303
|
end
|
304
304
|
|
305
|
-
def drives
|
306
|
-
|
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
|
-
|
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
|
-
|
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
|