cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
608
Views
0
Helpful
2
Replies

General question about handling errors in NSO

previousqna
Level 5
Level 5

All ,

 

 

I’m working through setting up a web portal for a pre-pilot demo.

 

I’m looking for any general guidance in how to verify success.

 

 

Example:

 

When executing template.apply() , I don’t see any return value.

 

So if a device happens to be out of sync , there is no indication I can find other then an NSO console message.

 

 

Just trying to figure out how to provide some feedback to the web portal.

 

2 Replies 2

previousqna
Level 5
Level 5

Yes when you return from template apply, this is still very eraly in the overall transaction, you code has just been called to help fastmap compute the set of config changes on the device but the device has not been touched.

 

 

There is no way then that you can use the service callback for the pupose of giving feedbackon a commit becauae it returns well before the commit is started.

 

 

However if a deivce is out of sync the commit will abort (default behavior) and there should be feedback in the web portal.

That is right. Errors that occur during commit (i.e. device/NED errors, out of sync, etc.) are reflected through the API.

 

 

If you use REST, these errors are returned as HTTP error codes which you should be able to catch in your code. Those are documented in the NSO northbound guide. I believe the NSO Web UI guide should have similar documentation for JSON-RPC.