Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-860

Some BBF yang devices using actions have invalid swagger URLs generated.

XMLWordPrintable

      This problem was discovered in Lighty.io version14.0 and version15.1 - which can be seen on ODL versions Silicon and Phosphorus SR1. 

      It seems that some BBF (Broadband Forum) yang files that include "actions" construct invalid "POST" urls in the swagger. 

      This is an extension to NETCONF-859.  The same yang files are included in this JIRA, HOWEVER, the bbf-software-management yang has been modified to work with swagger (workaround for NETCONF-859). The version of the yang included here is the same, but the file content differs slightly to address NETCONF-859. The delta in the bbf-software-management yang file is shown below - the leafref path was changed to the actual definition. 

      928c928,930
      < type uint8;

      > type leafref

      { > path "../../../../../../../bbf-swm:revisions/bbf-swm:revision/bbf-swm:id"; > }

      968c970,972
      < type bbf-yang:string-ascii64;

      > type leafref

      { > path "../../../../../../../bbf-swm:revisions/bbf-swm:revision/bbf-swm:alias"; > }

      Inside the yang file, there is an action called "download" which exists in a container called "download":
      container download {
      when "boolean(../../capability='bbf-swm:download') and count(../revision[state='downloading'])=0"

      { description "Only applicable if the 'download' capability is supported and no other download of a revision is in progress for this software."; }

      presence "Downloading of revisions for this software is
      enabled.";
      config false;
      description
      "Provides containment for the action 'download'.";
      action download {
      if-feature "software-actions";
      description
      "Download the specified software revision to this
      component.
      ....

      The bbf-software-manager yang augments ietf-hardware. Under ietf-hardware we can see that the URL for the "download" above is messed up.

      The picture of this is attached.
      The URL shown/generated is
      rests/operationsata/network-topology:network-topology/topology=topology-netconf/node-myDevice/yang-ext:mount/ietf-hardware/component=

      {name}/bbf-software-management:software/software={name1}/revisions/download/download

      The beginning of the generated URL should be /restconf/operations/...

      Also included in this set of yang files is the bbf-hardware yang file which includes a "reset" action. The yang may be easier to look at for this one. It also is an "action" to do a reset, and it also contains a URL that is messed up.

      rests/operationsata/network-topology:network-topology/topology=topology-netconf/node=myDevice/yang-ext:mount/ietf-hardware:hardware/component={name}

      /bbf-hardware:reset

      To recreate this, use netconf testtool to create a device simulator using all the yang models attached to this JIRA. The device will get mounted. Go into swagger and you will notice that the two mentioned generated URLs which are POST requests for underlying "actions" have bad URLs. Also, there is no parameters - each URL has some parameters, but the parameters section in the swagger does not show any.

       

            yaroslav.lastivka Yaroslav Lastivka
            rmagaldi Robert Magaldi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: