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

python RPC call edit-config and get-config

mhemmatp
Cisco Employee
Cisco Employee

Hello all,

 

I have a remote netconf device which is connected to my NSO. In documentation, I found some examples to read my configuration and to modify some leaves. But I am going to call some RPCs as well as calling edit-config and get operations. I am not sure how can I do it in python API in NSO.  Any help is very welcomed.

 

Kind Regards,

1 Reply 1

mhemmatp
Cisco Employee
Cisco Employee

Actually, I figured out how to call an rpc. It could be like:

 

with ncs.maapi.single_write_trans('admin','python') as trans:
root=ncs.maagic.get_root(trans)
device=root.devices.device["test"]
out=device.rpc.(model_prefix)__rpc_(rpc_name).(rpc_name)()
trans.apply()

 

Actually, my only question now is reading operational data as well as modifying the configuration.