radfish 0.2.5 → 0.2.8
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/cli.rb +7 -5
- data/lib/radfish/client.rb +11 -3
- data/lib/radfish/version.rb +1 -1
- data/lib/radfish/volume.rb +33 -10
- 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: b57f1bd62815e2443eadeeb512c54df7c694da3cb11a88317ca0e788748dfdca
|
4
|
+
data.tar.gz: 7481606f6651361c81c13a2dc319670d34891affab6540394d30b2730df88a64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da233a9a62801ecf8a50018dbc5e8c73cb7e7582bda980337cd934040f8583883cacfac803f266ce379b616b5a9531f67b97dec2c638e41e46f2f2aff858d56f
|
7
|
+
data.tar.gz: 9582794ab67b7e5e60c1bb47b8fd29c6556172e8b89c1309bf3cd1c7ccbc6fe61bb5317bf3077f968cb19102a61282ef49d446ba6afff24bfa1657e5e48c0abc
|
data/lib/radfish/cli.rb
CHANGED
@@ -406,11 +406,13 @@ module Radfish
|
|
406
406
|
puts "No volumes found".yellow
|
407
407
|
else
|
408
408
|
all_volumes.each do |vol|
|
409
|
-
name = vol
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
409
|
+
name = vol.name
|
410
|
+
bytes = vol.respond_to?(:capacity_bytes) ? vol.capacity_bytes : nil
|
411
|
+
capacity = bytes ? (bytes.to_f / (1000**3)).round(2) : nil
|
412
|
+
raid_type = vol.raid_type
|
413
|
+
status = vol.health
|
414
|
+
cap_str = capacity ? "#{capacity} GB" : "Unknown size"
|
415
|
+
puts "#{name}: #{cap_str} - #{raid_type} (Status: #{status})".cyan
|
414
416
|
end
|
415
417
|
end
|
416
418
|
end
|
data/lib/radfish/client.rb
CHANGED
@@ -231,10 +231,18 @@ module Radfish
|
|
231
231
|
id: fetch.call(:id),
|
232
232
|
name: fetch.call(:name),
|
233
233
|
capacity_bytes: fetch.call(:capacity_bytes),
|
234
|
-
|
235
|
-
|
236
|
-
|
234
|
+
raid_type: fetch.call(:raid_type),
|
235
|
+
volume_type: fetch.call(:volume_type),
|
236
|
+
drives: fetch.call(:drives),
|
237
237
|
encrypted: fetch.call(:encrypted),
|
238
|
+
lock_status: fetch.call(:lock_status),
|
239
|
+
stripe_size: fetch.call(:stripe_size),
|
240
|
+
operation_percent_complete: fetch.call(:operation_percent_complete),
|
241
|
+
operation_name: fetch.call(:operation_name),
|
242
|
+
write_cache_policy: fetch.call(:write_cache_policy),
|
243
|
+
read_cache_policy: fetch.call(:read_cache_policy),
|
244
|
+
fastpath: fetch.call(:fastpath),
|
245
|
+
health: fetch.call(:health),
|
238
246
|
adapter_data: raw
|
239
247
|
)
|
240
248
|
end
|
data/lib/radfish/version.rb
CHANGED
data/lib/radfish/volume.rb
CHANGED
@@ -2,21 +2,37 @@
|
|
2
2
|
|
3
3
|
module Radfish
|
4
4
|
class Volume
|
5
|
-
|
6
|
-
|
5
|
+
# Canonical, normalized attributes only.
|
6
|
+
attr_reader :id, :name, :capacity_bytes, :raid_type, :volume_type, :drives,
|
7
|
+
:encrypted, :lock_status, :stripe_size, :fastpath,
|
8
|
+
:operation_percent_complete, :operation_name,
|
9
|
+
:write_cache_policy, :read_cache_policy, :health,
|
10
|
+
:adapter_data, :controller
|
7
11
|
|
8
12
|
def initialize(client:, controller:, id: nil, name: nil, capacity_bytes: nil,
|
9
|
-
|
10
|
-
|
13
|
+
raid_type: nil, volume_type: nil, drives: nil, encrypted: nil,
|
14
|
+
lock_status: nil, stripe_size: nil,
|
15
|
+
operation_percent_complete: nil, operation_name: nil,
|
16
|
+
write_cache_policy: nil, read_cache_policy: nil,
|
17
|
+
fastpath: nil,
|
18
|
+
health: nil, adapter_data: nil)
|
11
19
|
@client = client
|
12
20
|
@controller = controller
|
13
21
|
@id = id
|
14
22
|
@name = name
|
15
23
|
@capacity_bytes = capacity_bytes
|
16
|
-
@capacity_gb = capacity_gb || (capacity_bytes ? (capacity_bytes.to_f / (1000**3)).round(2) : nil)
|
17
24
|
@raid_type = raid_type
|
18
|
-
@
|
25
|
+
@volume_type = volume_type
|
26
|
+
@drives = Array(drives) # normalized list of drive reference ids (e.g., @odata.id)
|
19
27
|
@encrypted = encrypted
|
28
|
+
@lock_status = lock_status
|
29
|
+
@stripe_size = stripe_size
|
30
|
+
@operation_percent_complete = operation_percent_complete
|
31
|
+
@operation_name = operation_name
|
32
|
+
@write_cache_policy = write_cache_policy
|
33
|
+
@read_cache_policy = read_cache_policy
|
34
|
+
@fastpath = fastpath
|
35
|
+
@health = health
|
20
36
|
@adapter_data = adapter_data
|
21
37
|
end
|
22
38
|
|
@@ -29,12 +45,19 @@ module Radfish
|
|
29
45
|
id: id,
|
30
46
|
name: name,
|
31
47
|
capacity_bytes: capacity_bytes,
|
32
|
-
capacity_gb: capacity_gb,
|
33
48
|
raid_type: raid_type,
|
34
|
-
|
35
|
-
|
49
|
+
volume_type: volume_type,
|
50
|
+
drives: drives,
|
51
|
+
encrypted: encrypted,
|
52
|
+
lock_status: lock_status,
|
53
|
+
stripe_size: stripe_size,
|
54
|
+
operation_percent_complete: operation_percent_complete,
|
55
|
+
operation_name: operation_name,
|
56
|
+
write_cache_policy: write_cache_policy,
|
57
|
+
read_cache_policy: read_cache_policy,
|
58
|
+
fastpath: fastpath,
|
59
|
+
health: health
|
36
60
|
}.compact
|
37
61
|
end
|
38
62
|
end
|
39
63
|
end
|
40
|
-
|