cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
490
Views
5
Helpful
4
Replies
Goodmon
Beginner

Re-deploy Reconcile in one NSO Transaction

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

4 REPLIES 4
Goodmon
Beginner

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

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.

View solution in original post

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?

Simply adding another ConfParam was the solution. Thank you