cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
477
Views
0
Helpful
3
Replies

Optimizing nested actions

yfherzog
Cisco Employee
Cisco Employee

Hi,

Suppose that I have an action that invokes multiple nested actions, and those nested actions connect to devices to fetch some data (e.g. using exec actions or RPCs). All actions are implemented in python.

The idea is to have modular actions that will be reused in different occasions by different "main" actions.

Is there any way to write the code in such way that will optimize the execution of such actions?

For example, all device calls are usually made to the same device sequentially.

Is there a way to make NSO reuse the same device sessions, rather than establishing new ones?

Any other steps that can optimize such implementation?

Thanks,

Yftach

1 Accepted Solution

Accepted Solutions

Yes, that one, and this:

  - Python API: It was not possible to e.g. call an action from inside

    another action or service if they were both registered to the same

    ncs.dp.Daemon. This has been fixed.

Point being, you probably want NSO 4.5 for your experiments.

View solution in original post

3 Replies 3

Jan Lindblad
Cisco Employee
Cisco Employee

There are some improvements in this area in the NSO 4.5 CHANGES file. Have a look.

Hi Jan,

Can you point me to the relevant changes in the file?

Is this the one?

"Python API: Service and Action now execute requests in separate threads improving parallelism."

If so, how do we take advantage of that?

Thanks,

Yftach

Yes, that one, and this:

  - Python API: It was not possible to e.g. call an action from inside

    another action or service if they were both registered to the same

    ncs.dp.Daemon. This has been fixed.

Point being, you probably want NSO 4.5 for your experiments.