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

Invoking Yang 1.1 Action on ODL fails for Yang Model containing yang action under augmentation hierarchy.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Highest
    • Resolution: Done
    • None
    • None
    • None

    Description

      While Executing yang action requests on ODL via  POST request failes for augmented yang actions see attached screenshot

      By going through ODL wiki , it says that QName for augmented yang model would not be supported.

       
       Running into issue  its related to invocation of Yang 1.1 Action on Odl.
       
      When I am invoking action on Yang Model having Augmentations like below it fails with Exception : "Augmentation node has no Qname" ** 
       
      It occurs at time of getting  :  QName getNodeType() >> path.getNodeType() as shown in below code snippet.
       
      In Class : RestconfInvokeOperationsUtil.java     in Restconf Module.
       
      private static DOMDataTreeIdentifier prepareDataTreeId(final YangInstanceIdentifier yangIId,
      final SchemaPath schemaPath) {
      final List<PathArgument> pathArg = new ArrayList<>();
      for (PathArgument path : yangIId.getPathArguments()) {
      if (path.getNodeType().getLocalName().equals(schemaPath.getLastComponent().getLocalName()))

      { break; }

      pathArg.add(path);
      }
      YangInstanceIdentifier yangInstanceIdentifier = YangInstanceIdentifier.builder().append(pathArg).build();
      DOMDataTreeIdentifier domDataTreeIdentifier = new DOMDataTreeIdentifier(LogicalDatastoreType.OPERATIONAL,
      yangInstanceIdentifier);
      return domDataTreeIdentifier;
      }
       
       
      Yang Model : 
       
      module er-module 

        yang-version 1.1;
        namespace "https://example.com/ns/er-module";
        prefix rcsswm;
       
        import er-managed-element

      {     prefix emael;   }

        import er-yang-extensions

      {     prefix yexte;   }

       
        revision 2019-12-06

      {     yexte:version "3";     yexte:release "4";     yexte:correction "1";  }

       
      augment "/emael:ManagedElement/emael:SystemFunctions";
      augment "/emael:ManagedElement/emael:SystemFunctions" {

          list SwM {
            key "id";
            leaf id

      {         type string;       }

            yexte:is-system-created;
            container attributes 

      {         uses *SwMGrp*;      }

          }
       }
      grouping SwMGrp {
          action createUpgradePackage {
            input {
              leaf uri

      {           type string;        }

          }
         }
       }
      }
       

      Attachments

        1. Screenshot from 2020-05-28 14-23-23.png
          4.34 MB
          Ajay Deep Singh
        2. augment-main-a@2014-01-21.yang
          0.6 kB
          Ajay Deep Singh
        3. main@2014-01-21.yang
          0.1 kB
          Ajay Deep Singh

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ajay_dp001 Ajay Deep Singh
              ajay.dp001 Ajay Deep Singh
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: