[CONTROLLER-224] Redundant data in RESTCONF Created: 21/Mar/14  Updated: 25/Jul/23  Resolved: 07/Apr/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Dana Kutenicsova Assignee: Tony Tkacik
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Issue Links:
Blocks
is blocked by CONTROLLER-208 Verify downstream projects to be work... Resolved
External issue ID: 565
Priority: 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).


Generated at Wed Feb 07 19:52:30 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.