I’m creating an Apama EPL code to add new devices to existing smart rules, because I have a lot of smart rules and the manual process is very time-consuming.
I can get managed objects from my smart rules and the only field that I checked and that references devices is ‘enabledSources’, however, when I include the device ID in this property, it shows in the ‘info’ tab that the device is active, but the smart rule doesn’t work for him.
How can I do to include devices in my smart rules with Apama EPL?
The easiest way would be that instead of changing the MO via inventory API you change it via the API of the SmartRule microservice. Then you are doing technically the same as the UI does.
As already said these are not documented APIs but you could just open the developer tools in the browser and see how the call is being made from the UI.
Note: The only way to send a PUT method that I found, without exception and minimum body, is with the ‘enabled’ property. Because, when I update my MO, the service route is updated as well (same PUT route)