[CONTROLLER-1197] Restconf RPC: XML sub-element namespace error when top-level namespace is specified Created: 12/Mar/15  Updated: 19/Oct/17  Resolved: 14/May/15

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

Type: Bug
Reporter: Vratko Polak Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 2833

 Description   

https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#Creating_LSP_2
specifies the new way of add-lsp using XML input, the change from Helium is that
top-level <input> needs to have namespace specified explicitly (required in Lithium).

This format looks like it should also work on Helium, but it leads to an error on sub-element "lsp":
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
<error>
<error-type>application</error-type>
<error-tag>unknown-element</error-tag>
<error-message>Schema node "lsp" was not found in module.</error-message>
</error>
</errors>

Analogous error is present also in master branch, but Helium-SR3 has deadline sooner.



 Comments   
Comment by Tony Tkacik [ 12/Mar/15 ]

Is the lsp element augmented to the input or it is from pcep model?

Comment by Vratko Polak [ 13/Mar/15 ]

(In reply to Tony Tkacik from comment #1)
> Is the lsp element augmented to the input or it is from pcep model?

Augmented. Here are top-level and sub-level elements used:

Original Helium guide (works correctly):
<input>
<arguments>
<lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">

Current Lithium guide (this bug):
<input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
<arguments>
<lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">

And todays news: it works again when :stateful after xmlns is removed (future Lithium guide I guess):
<input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
<arguments>
<lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">

Strange thing is that there is also another sub-element (same level as arguments) which does not have problem with namespace alias:
<network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>

As the "future Lithium guide" way works also for master branch builds, I am decreasing importance to Minor.

Comment by Tony Tkacik [ 12/May/15 ]

Namespace aliasing is not problem:

<network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>

network-topology-ref is from default namespace of parent - urn:opendaylight:params:xml:ns:yang:topology:pcep

xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology" is only used in instance identifier and not on XML Elements.

Comment by Vratko Polak [ 14/May/15 ]

So, the bug was in the previous guide,
<lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
defined namespace alias, but it did not tell restconf that "lsp" is not in namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep", right?

Comment by Tony Tkacik [ 14/May/15 ]

Seems so

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