Skip to content

Commit

Permalink
fix(netapp-ontap-restapi-plugin): fix hardware API requests for bays …
Browse files Browse the repository at this point in the history
…and tests (#5395)

Co-authored-by: Lucie Dubrunfaut <[email protected]>

Refs: CTOR-783
  • Loading branch information
itoussies authored Feb 20, 2025
1 parent d40ae9b commit 0d10876
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/storage/netapp/ontap/restapi/mode/hardware.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ sub get_shelves {

return if (defined($self->{shelves}));

$self->{shelves} = $self->{custom}->request_api(endpoint => '/api/storage/shelves?fields=name,state,serial_number,bay,frus');
$self->{shelves} = $self->{custom}->request_api(endpoint => '/api/storage/shelves?fields=name,state,serial_number,bays,frus');
}

sub save_custom {
Expand Down
10 changes: 5 additions & 5 deletions tests/storage/netapp/ontap/restapi/aggregates.robot
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Aggregates ${tc}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: Aggregates 'aggregate1' state: online, space usage total: 9.46 GB used: 1.99 MB (0.02%) free: 9.46 GB (100.00%), other : skipped (no value(s)), read iops: 500, write iops: 200, other-iops : skipped (no value(s)), total iops: 1000, read latency: 500 µs, write latency: 200 µs, other-latency : skipped (no value(s)), total latency: 1000 µs | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 2 --warning-status='\\\%{state} !~ /notonline/i' WARNING: Aggregates 'aggregate1' state: online | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 3 --critical-status='\\\%{state} !~ /notonline/i' CRITICAL: Aggregates 'aggregate1' state: online | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 6 --warning-usage-prct=50:50 WARNING: Aggregates 'aggregate1' used : 0.02 % | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;50:50;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 7 --critical-usage-prct=50:50 CRITICAL: Aggregates 'aggregate1' used : 0.02 % | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;50:50;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 1 ${EMPTY} OK: Aggregates 'aggregate1' state: online, space usage total: 9.46 GB used: 1.99 MB (0.02%) free: 9.46 GB (100.00%), read iops: 500, write iops: 200, other iops: 100, total iops: 1000, read latency: 500 µs, write latency: 200 µs, other latency: 100 µs, total latency: 1000 µs | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.other.usage.bytespersecond'=100B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.other.usage.iops'=100iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.other.latency.microseconds'=100µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 2 --warning-status='\\\%{state} !~ /notonline/i' WARNING: Aggregates 'aggregate1' state: online | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.other.usage.bytespersecond'=100B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.other.usage.iops'=100iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.other.latency.microseconds'=100µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 3 --critical-status='\\\%{state} !~ /notonline/i' CRITICAL: Aggregates 'aggregate1' state: online | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.other.usage.bytespersecond'=100B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.other.usage.iops'=100iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.other.latency.microseconds'=100µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 6 --warning-usage-prct=50:50 WARNING: Aggregates 'aggregate1' used : 0.02 % | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;50:50;;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.other.usage.bytespersecond'=100B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.other.usage.iops'=100iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.other.latency.microseconds'=100µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
... 7 --critical-usage-prct=50:50 CRITICAL: Aggregates 'aggregate1' used : 0.02 % | 'aggregate1#aggregate.space.usage.bytes'=2088960B;;;0;10156769280 'aggregate1#aggregate.space.free.bytes'=10156560384B;;;0;10156769280 'aggregate1#aggregate.space.usage.percentage'=0.02%;;50:50;0;100 'aggregate1#aggregate.io.read.usage.bytespersecond'=500B/s;;;; 'aggregate1#aggregate.io.write.usage.bytespersecond'=200B/s;;;0; 'aggregate1#aggregate.io.other.usage.bytespersecond'=100B/s;;;0; 'aggregate1#aggregate.io.total.usage.bytespersecond'=1000B/s;;;0; 'aggregate1#aggregate.io.read.usage.iops'=500iops;;;0; 'aggregate1#aggregate.io.write.usage.iops'=200iops;;;0; 'aggregate1#aggregate.io.other.usage.iops'=100iops;;;0; 'aggregate1#aggregate.io.total.usage.iops'=1000iops;;;0; 'aggregate1#aggregate.io.read.latency.microseconds'=500µs;;;0; 'aggregate1#aggregate.io.write.latency.microseconds'=200µs;;;0; 'aggregate1#aggregate.io.other.latency.microseconds'=100µs;;;0; 'aggregate1#aggregate.io.total.latency.microseconds'=1000µs;;;0;
8 changes: 4 additions & 4 deletions tests/storage/netapp/ontap/restapi/cluster.robot
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Cluster ${tc}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: cluster 'cluster1' read : Buffer creation, write : Buffer creation, other : skipped (no value(s)), total : Buffer creation, read iops: 200, write iops: 100, other-iops : skipped (no value(s)), total iops: 1000, read latency: 200 ms, write latency: 100 ms, other-latency : skipped (no value(s)), total latency: 1000 ms - node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 2 ${EMPTY} OK: cluster 'cluster1' other : skipped (no value(s)), read iops: 200, write iops: 100, other-iops : skipped (no value(s)), total iops: 1000, read latency: 200 ms, write latency: 100 ms, other-latency : skipped (no value(s)), total latency: 1000 ms - node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.write.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.total.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 3 --warning-node-status='\\\%{state} !~ /notonline/i' WARNING: cluster 'cluster1' node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.write.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.total.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 4 --critical-node-status='\\\%{state} !~ /notonline/i' CRITICAL: cluster 'cluster1' node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.write.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.total.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 1 ${EMPTY} OK: cluster 'cluster1' read : Buffer creation, write : Buffer creation, other : Buffer creation, total : Buffer creation, read iops: 200, write iops: 100, other iops: 100, total iops: 1000, read latency: 200 ms, write latency: 100 ms, other latency: 100 ms, total latency: 1000 ms - node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.other.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster.io.other.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 2 ${EMPTY} OK: cluster 'cluster1' read iops: 200, write iops: 100, other iops: 100, total iops: 1000, read latency: 200 ms, write latency: 100 ms, other latency: 100 ms, total latency: 1000 ms - node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.write.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.other.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.total.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.other.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster.io.other.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 3 --warning-node-status='\\\%{state} !~ /notonline/i' WARNING: cluster 'cluster1' node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.write.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.other.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.total.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.other.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster.io.other.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
... 4 --critical-node-status='\\\%{state} !~ /notonline/i' CRITICAL: cluster 'cluster1' node 'node-01' state: online [link status: string] | 'cluster1#cluster.io.read.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.write.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.other.usage.bytespersecond'=0B/s;;;; 'cluster1#cluster.io.total.usage.bytespersecond'=0B/s;;;0; 'cluster1#cluster.io.read.usage.iops'=200iops;;;0; 'cluster1#cluster.io.write.usage.iops'=100iops;;;0; 'cluster1#cluster.io.other.usage.iops'=100iops;;;0; 'cluster1#cluster.io.total.usage.iops'=1000iops;;;0; 'cluster.io.read.latency.milliseconds'=200ms;;;0; 'cluster1#cluster.io.write.latency.milliseconds'=100ms;;;0; 'cluster.io.other.latency.milliseconds'=100ms;;;0; 'cluster1#cluster.io.total.latency.milliseconds'=1000ms;;;0;
Loading

0 comments on commit 0d10876

Please sign in to comment.