Skip to content

Commit

Permalink
Added iSCSI multipath status to the API
Browse files Browse the repository at this point in the history
In this commit the multipath status is available in the following
endpoint:
/ovirt-engine/api/hosts/xxxx/storage

A new field has been added <available_paths> that represents the
multipaths that are NOT faulty as an integer value. This is useful for monitoring (you can
compare 'available_paths' to 'paths' and trigger an alert when
'available_paths' is lower than 'paths'.

Signed-off-by: Brooklyn Dewolf <contact@brooklyn.gent>
  • Loading branch information
BrooklynDewolf authored and sandrobonazzola committed Jun 5, 2024
1 parent 80d6b0f commit 65e9862
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ public int getPathCount() {
return getPathsDictionary() == null ? 0 : getPathsDictionary().size();
}

public int getAvailablePathCount() {
return getPathsDictionary() == null ? 0 : (int) getPathsDictionary().values().stream().filter(o -> o).count();
}

public Map<String, Boolean> getPathsDictionary() {
return pathsDictionary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static LogicalUnit map(LUNs entity, LogicalUnit template) {
model.setTarget(lunConnection.getIqn());
}

model.setAvailablePaths(entity.getAvailablePathCount());
model.setPaths(entity.getPathCount());
return model;
}
Expand Down

0 comments on commit 65e9862

Please sign in to comment.