Skip to content

Commit

Permalink
HZN-801: Added documentation for the Edge Status Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
christianpape committed Jul 6, 2016
1 parent 9f21190 commit c7b5b1c
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,26 @@ This can be achieved by setting the GraphML attribute `nodeID` on the GraphML No

==== Edge Status Provider

TODO
It is also possible to compute a status for each edge in a given graph.
Just place Groovy scripts (with file extension .groovy) in the directory `$OPENNMS_HOME/etc/graphml-edge-status`.
All of the scripts will be evaluated and the most severe status will be used for the edge in the topology's visualization.

The following simple Groovy script example will apply a different style and severity if the edge's associated source node is down.

.Scriptable edge status
[source, groovy]
----
import org.opennms.netmgt.model.OnmsSeverity;
import org.opennms.features.topology.plugins.topo.graphml.GraphMLEdgeStatus;
if ( sourceNode != null && sourceNode.isDown() ) {
return new GraphMLEdgeStatus(OnmsSeverity.WARNING, [ 'stroke-dasharray' : '5,5', 'stroke' : 'yellow', 'stroke-width' : '6' ]);
} else {
return new GraphMLEdgeStatus(OnmsSeverity.NORMAL, []);
}
----

If the script shouldn't contribute any status to an edge just return null.

[[gd-topology-graphml-layers]]
==== Layers
Expand Down

0 comments on commit c7b5b1c

Please sign in to comment.