02-03-2021 09:20 PM
Hey All,
Currently having a problem on NSO 5.3.2.3.
I am trying to build a reconcile action that can go into a brownfields network device, populate some service data and then take ownership of the configuration on the device.
I have managed to achieve this, using Maapi and templates in my NSO code to stamp service data templates, using a similar method to this :
ConfPath confPath = new ConfPath("/gm:network/networkshaper/ShaperData:ShaperData{%s}", uID); //apply Template createTemplate.apply(maapi, myActionTrans, confPath, createVariables);
Then, calling an API to go and re-deploy reconcile (keeping non service config) from an external python script. I have decided now that I want to do the redeploy reconcile within NSO, and understand that it might be possible using Maapi.
I have tried to emulate the way my API call was working here :
maapi.requestAction(new ConfXMLParam[0], "/gm:network/networkshaper/ShaperData:ShaperData/{"+deviceName+"}/re-deploy");
However I keep getting the error of "DpCallbackException: Not able to parse" the above line.
Any suggestions or examples would be fantastic.
Regards,
John
Solved! Go to Solution.
02-04-2021 09:17 AM
You need to add action parameters. This is slightly complicated in Navu so take a look at examples.ncs/getting-started/developing-with-ncs/2-actions for a full example of how to do it.
02-03-2021 10:17 PM
Quick update.
Have modified to use a NavuAction, and can now successfully re-deploy services. Now the question becomes how to reconcile them?
no child action node "re-deploy reconcile" possible children : NavuAction: "check-sync" NavuAction: "deep-check-sync" NavuAction: "re-deploy" NavuAction: "reactive-re-deploy" NavuAction: "touch" NavuAction: "get-modifications" NavuAction: "un-deploy"
Again, any help or suggestions greatly appreciated.
Regards,
John
02-04-2021 09:17 AM
You need to add action parameters. This is slightly complicated in Navu so take a look at examples.ncs/getting-started/developing-with-ncs/2-actions for a full example of how to do it.
02-08-2021 07:19 PM
Hi there,
Thank you for your reply. I looked around and found some examples as per your suggestion, and have managed to do it using MAAPI.
I added the following Params to my maapi transaction
ConfXMLParam[] params = new ConfXMLParam[3]; params[0] = new ConfXMLParamStart(nsPrefix, "reconcile"); params[1] = new ConfXMLParamLeaf(nsPrefix, "keep-non-service-config"); params[2] = new ConfXMLParamStop(nsPrefix, "reconcile");
And that has worked. Now I would like to add the ability to use No-networking, but it doesn't appear in tailf-ncs-services.yang under the re-deploy command. How would be the best way to approach this requirement?
02-08-2021 07:26 PM
Simply adding another ConfParam was the solution. Thank you
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide