cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
146
Views
20
Helpful
3
Replies
Highlighted
Beginner

How to identify changed portion of configuration

I’ve got a simple list as below

list datalist {

    leaf name {

        type string;

    }

    leaf node {

        type leafref {

            path "/ncs:devices/ncs:device/ncs:name";

         }

    leaf required {

        type int64;

    }

    leaf limit {

        type int64;

    }

I need to apply an algotithm (written in Python) that fires when an item in the list is added or removed. The algotithm is quite taxing so I’d like that it applies only on the changed portion of a configuration. How can I identify the relevant records in the list?

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: How to identify changed portion of configuration

It might also be worth mentioning that you have persistent opaque data available, if your computations are heavy you might be able to use that to cache partial results. This is the proplist argument for the create callback in python.
3 REPLIES 3
Cisco Employee

Re: How to identify changed portion of configuration

Kickers or subscribers is the way to go. Both of them are described in the development guide. 

Cisco Employee

Re: How to identify changed portion of configuration

It might also be worth mentioning that you have persistent opaque data available, if your computations are heavy you might be able to use that to cache partial results. This is the proplist argument for the create callback in python.
Cisco Employee

Re: How to identify changed portion of configuration

If you want to run these sort of subscriptions to changes in an external applications, there is aplan to implement RFC 8641 (fresh from last week!) soon.