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

how to influence NSO when deleting leaf nodes using netconf ned

jmsherry
Level 1
Level 1
We use nso to configure juniper junos routers via netconf ned.
We have a service template to apply interface egress shaper, which is equivalent to the below junos cli command:
 
set class-of-service interfaces xe-0/0/10 unit 2819 shaping-rate 1g
 
The service template has this section:
            <class-of-service>
              <interfaces>
                <interface>
                  <name>{interface}</name>
                  <unit>
                    <name>{unit}</name>
                      <shaping-rate>
                       <rate>{shapingrate}</rate>
                     </shaping-rate>
                  </unit>
                </interface>
              </interfaces>
            </class-of-service>
 
1g is fed into yang attribute shapingrate by user. 
when the said nso service is deleted, nso will remove the above command. However in junos, below command is invalid
"delete class-of-service interfaces xe-0/0/10 unit 2819 shaping-rate 1g"
 
The accepted command by junos cli is 
a - "delete class-of-service interfaces xe-0/0/10 unit 2819 shaping-rate"
or 
b - "delete class-of-service interfaces xe-0/0/10 unit 2819 shaping-rate 1000000"
 
Is there a way to instruct NSO to operate in "option a" manner, for "class-of-service interfaces xxx unit xx shaping-rate" command only, when deleting a service, don't delete its leaf value but rather the leaf node?
2 Accepted Solutions

Accepted Solutions

snovello
Cisco Employee
Cisco Employee
I am guessing that the value of shapingrate, that you passed into the service was ‘1g’, that the router accepts it in create, but not in delete. Probably if you pass in 1000000000 the delete will work. So then to make your service work you would write a function that evaluates and removes units.

A trace of the Netconf command sent by NSO to the router, with the router response would be good, your explanation is clear but it uses CLI commands and of course NSO not sending CLI commands to the router.

View solution in original post

Thanks for the reply. i will give your solution a try. 

View solution in original post

2 Replies 2

snovello
Cisco Employee
Cisco Employee
I am guessing that the value of shapingrate, that you passed into the service was ‘1g’, that the router accepts it in create, but not in delete. Probably if you pass in 1000000000 the delete will work. So then to make your service work you would write a function that evaluates and removes units.

A trace of the Netconf command sent by NSO to the router, with the router response would be good, your explanation is clear but it uses CLI commands and of course NSO not sending CLI commands to the router.

Thanks for the reply. i will give your solution a try.