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

Adding key into yang list existing services

tsiemers1
Spotlight
Spotlight

Has anybody ever added an additional leaf into the service list key? In testing, it looks to work fine but we have 900 existing services in this package already and just curious how it could affect them. From what we see it should go over all the existing service entries and update the key with the deviceName.

 

OLD:

 

list test-l2vpn {
    description "Configure test l2vpn services";

    uses ncs:service-data;
    ncs:servicepoint test-l2vpn-servicepoint;

    key circuit_id;
    leaf circuit_id {
      description "Circuit ID used to identify service";
      tailf:info "Unique circuit id";
      tailf:cli-allow-range;
      type string;
    }

    leaf deviceName {
      description "Hostname of device";
      tailf:info "Hostname of device";
      type leafref {
        path /ncs:devices/ncs:device/ncs:name;
      }
    }

NEW:

 

 

list test-l2vpn {
    description "Configure test l2vpn services";

    uses ncs:service-data;
    ncs:servicepoint test-l2vpn-servicepoint;

    key "circuit_id deviceName";
    leaf circuit_id {
      description "Circuit ID used to identify service";
      tailf:info "Unique circuit id";
      tailf:cli-allow-range;
      type string;
    }

    leaf deviceName {
      description "Hostname of device";
      tailf:info "Hostname of device";
      type leafref {
        path /ncs:devices/ncs:device/ncs:name;
      }
    }
1 Accepted Solution

Accepted Solutions

yfherzog
Cisco Employee
Cisco Employee

Have a look at the development guide under section "Automatic Schema Upgrades and Downgrades".

It explains the limitations of what could be handled automatically by NSO. In case you case is not covered, there's also an option to create an upgrade package to handle the transition (explained a bit further down on the same document).

View solution in original post

2 Replies 2

yfherzog
Cisco Employee
Cisco Employee

Have a look at the development guide under section "Automatic Schema Upgrades and Downgrades".

It explains the limitations of what could be handled automatically by NSO. In case you case is not covered, there's also an option to create an upgrade package to handle the transition (explained a bit further down on the same document).

Thanks, that was it. 

 

Key changes

When a key of a list is modified, CDB tries to upgrade the key using the same rules as explained above for adding, deleting, re-ordering, change of type, and change of hash value. If automatic upgrade of a key fails the entire list instance will be deleted.

 

Looks like since all existing services already have the leaf already it should work.