Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-224

Redundant data in RESTCONF

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • restconf
    • None
    • Operating System: Linux
      Platform: PC

    • 565
    • High

    Description

      I augment network-topology.yang :

      grouping topology-pcep-type {
      container topology-pcep

      { presence "indicates a PCEP-aware topology"; }

      }

      augment "/nt:network-topology/nt:topology/nt:topology-types" {
      uses topology-pcep-type;
      }

      Code to create the container:

      // Make sure the topology does not exist
      final Object c = dataProvider.readOperationalData(topology);
      Preconditions.checkArgument(c == null, "Topology %s already exists", topology);

      // Now create the base topology
      final TopologyKey k = InstanceIdentifier.keyOf(topology);
      final DataModificationTransaction t = dataProvider.beginTransaction();
      t.putOperationalData(topology, new TopologyBuilder().setKey(k).setTopologyId(k.getTopologyId()).setTopologyTypes(
      new TopologyTypesBuilder().addAugmentation(TopologyTypes1.class, new TopologyTypes1Builder().setTopologyPcep(new TopologyPcepBuilder().build()).build()).build()).setNode(new ArrayList<Node>()).build());

      Futures.addCallback(JdkFutureAdapters.listenInPoolThread(t.commit()), new FutureCallback<RpcResult<TransactionStatus>>() {
      @Override
      public void onSuccess(final RpcResult<TransactionStatus> result) {
      LOG.trace("Topology {} created successfully", topology);
      }

      @Override
      public void onFailure(final Throwable t) {
      LOG.error("Failed to create topology {}", topology);
      }
      });

      The resulting xml shows two instances of pcep-topology with the same namespace:

      <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
      <topology-id>pcep-topology</topology-id>
      <topology-types>
      <topology-pcep xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep"/>
      </topology-types>
      <topology-types>
      <topology-pcep xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep"/>
      </topology-types>

      In the code, there is a check for already existing topology and the log file, only shows one success LOG output:

      TRACE o.o.b.p.t.p.ServerSessionManager - Topology InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology, org.opend
      aylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology[key=TopologyKey [_topologyId=Uri [_value=pcep-topology]]]]] created successfully

      Almost the same behaviour with example-linkstate-topology:

      <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
      <server-provided>true</server-provided>
      <topology-id>example-linkstate-topology</topology-id>
      <topology-types/>
      <topology-types/>

      2014-03-21 01:36:53.440 PDT [nioEventLoopGroup-5-6] DEBUG o.o.b.b.t.p.AbstractTopologyBuilder - Initiating topology builder from RIBImpl{} at InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology[key=TopologyKey [_topologyId=Uri [_value=example-linkstate-topology]]]]]

      Not sure if RESTCONF issue, or the data is not correctly written/read to/from md-sal, but this did work maybe a week ago (first noticed 03/18).

      Attachments

        Issue Links

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

          Activity

            People

              tony.tkacik@gmail.com Tony Tkacik
              dkutenicsova Dana Kutenicsova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: