cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
388
Views
0
Helpful
1
Replies

NSO 6.x - Python reference counting

Jason S.
Level 1
Level 1

We're currently running NSO 5.7, and we're working to upgrade to 6.x and are looking at the required changes to our service packages.

One of my service packages takes advantage of the reference counting in Python by creating a configuration in every instance, but in reality it's only built once and the same config is used by every service, and with the config remaining through service deletes until the last service using it(regardless of it was the originating service) is removed.

In the NSO 6.x documentation it says that this is enabled by default for XML and Python:

Services Deep Dive - Network Services Orchestrator (NSO) v6.1 - Cisco DevNet
"A well-known solution to this kind of problem is reference counting. NSO uses reference counting by default with the XML templates and Python Maagic API, while in Java Maapi and Navu APIs, the sharedCreate()sharedSet(), and sharedSetValues() functions need to be used."

This would imply that the create() function in Python already does this, similar to the 5.7 functionality.  But in the Python API docs, it says the shared_* versions of those functions should be used.

Python API Overview - Network Services Orchestrator (NSO) v6.1 - Cisco DevNet

Can someone clarify if it's required to update all of these function calls to the shared equivalents?

 

Thanks,

Jason

1 Accepted Solution

Accepted Solutions

cohult
Cisco Employee
Cisco Employee

Your Python API Overview link points to the low-level Python API, where you must use the shared_* versions in your service code. 
The documentation you quote refers to the Python Maagic API, which is used on top of high-level MAAPI.

View solution in original post

1 Reply 1

cohult
Cisco Employee
Cisco Employee

Your Python API Overview link points to the low-level Python API, where you must use the shared_* versions in your service code. 
The documentation you quote refers to the Python Maagic API, which is used on top of high-level MAAPI.