NMS-18182: Karaf shell commands for working with requisitions, foreignSources, and detectors.#8417
NMS-18182: Karaf shell commands for working with requisitions, foreignSources, and detectors.#8417
Conversation
…nSources, and detectors.
marshallmassengill
left a comment
There was a problem hiding this comment.
This looks awesome. I'd be ok with targeting this at 2025 if we know it doesn't break anything. It looks like everything is net new.
garcia-sr
left a comment
There was a problem hiding this comment.
LGTM! This is awesome stuff and I think it'll be super handy to have this inside Karaf.
cgorantla
left a comment
There was a problem hiding this comment.
I think we need to trim down these commands and think about what we really need.
IMO, we should limit karaf commands to debug things quickly and understand the current state of the application. Expanding them to do complex operations will be extra burden to maintain.
...c/main/java/org/opennms/netmgt/provision/requisition/command/AddDetectorToForeignSource.java
Outdated
Show resolved
Hide resolved
...ell/src/main/java/org/opennms/netmgt/provision/requisition/command/AddRequisitionedNode.java
Outdated
Show resolved
Hide resolved
| @Option(name = "-v", aliases = "--verbose", description = "Be verbose; show us the node XML") | ||
| private boolean verbose = false; | ||
|
|
||
| public Object execute() { |
There was a problem hiding this comment.
Not sure if having so many options with so many multi valued makes sense. We should consider improvements to this command
There was a problem hiding this comment.
The node model is complicated. I wanted to make sure that as many bases as possible were covered, but the only required arguments are requisition, nodelabel and ipaddress.
...ell/src/main/java/org/opennms/netmgt/provision/requisition/command/AddRequisitionedNode.java
Show resolved
Hide resolved
...n/java/org/opennms/netmgt/provision/requisition/command/DeleteDetectorFromForeignSource.java
Outdated
Show resolved
Hide resolved
...hell/src/main/java/org/opennms/netmgt/provision/requisition/command/DeleteForeignSource.java
Outdated
Show resolved
Hide resolved
...-shell/src/main/java/org/opennms/netmgt/provision/requisition/command/DeleteRequisition.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/opennms/netmgt/provision/requisition/command/SynchronizeRequisition.java
Outdated
Show resolved
Hide resolved
|
|
||
| if (wait) { | ||
| try { | ||
| while (!importEventListener.isDone()) { |
There was a problem hiding this comment.
what if importEventListener never done ? We should not hang the command.
There was a problem hiding this comment.
It will print dots until the event comes in. This is a copy of what was already done in ImportRequisition.java , not an original idea :-)
User can always ctrl+c to end the command if they do not wish to wait (or run without --wait)
...ell/src/main/java/org/opennms/netmgt/provision/requisition/command/AddRequisitionedNode.java
Outdated
Show resolved
Hide resolved
b82a671
Karaf shell commands for working with requisitions, requisitioned nodes, foreign source definitions, and detectors. These have been baking on and off for quite some time now (probably since Q2 2023, cough cough) and after this last round of revisions I have everything working and cleaned up enough for a review.
I think these could enable some really interesting emergent workflows.
External References
Example usage output: