We tried creating an EventAdmin model under a Network topology using rest API
The model got created but when a test trap is sent from the source, the event never gets raised on the model.
However, when creating the same EventAdmin model again manually from the Spectrum OneClick console using the same values as in the rest API, the test trap is successfully raised.
Why does this occur and how can it be fixed?
The problem is that if the model's topology location is not defined via associations, then the newly, REST API created EventAdmin model goes to Lost & Found. In OneClick, on the other hand, you automatically set its place in the topology depending on where you are when you create it.
To fix this, an association to a topology model needs to be created. When you create that association, the TopologyModelNameString should be automatically populated. The association required here is the "Contains" relation.
When a device is discovered and a model is created in the SpectroSERVER database, associations are created linking it to the various views that the device is a member of.
For example, a "Contains" association for the Topology container and the Global Collection containers using its hex identifier (0x10002). So this is what you would have to add to complete the creation of the EventAdmin model. So in this case, a Contains association between the new EventAdmin model and the container/GC that contains it needs to be created, using;
You can find out what the current Relation Model_Handles (RMHandle) are by using the VNM shell (vnmsh) command line. For example:
In the above example, is a Cisco Catalyst 37xx device. From the above, it can be seen that the Catalyst device model (Model_Handle =) is in the Universe container, which it. Also, it is shown that the device model other models, such as Apps, interfaces etc..
If you look at the following link, it describes how to create an association relation via RESTful API:
The "Contains" association relation, as described in the TechDocs: