[NETCONF-658] RFC 8040 "fields" query fails if requested subelement missing Created: 04/Mar/20 Updated: 06/Mar/20 Resolved: 06/Mar/20 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | High |
| Reporter: | Allan Clarke | Assignee: | Allan Clarke |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0 minutes | ||
| Time Spent: | 1 day, 6 hours | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
The RFC8040 implementation is too brittle to support real-word filtering situations. In this case, we're trying to retrieve the active alarm list from a set of components (logical-termination-points - LTPs). ] Query:
Expected behavior: |
| Comments |
| Comment by Allan Clarke [ 04/Mar/20 ] |
|
https://jira.opendaylight.org/browse/NETCONF-657 (useful resources and links in the comments) |
| Comment by Allan Clarke [ 04/Mar/20 ] |
|
Workflow...
|
| Comment by Allan Clarke [ 04/Mar/20 ] |
|
Resources... |
| Comment by Allan Clarke [ 04/Mar/20 ] |
|
|
| Comment by Allan Clarke [ 06/Mar/20 ] |
|
Ran testtool loaded with directory of attached Yang models... echo "Starting testtool (port=17830,cred=admin/admin) using extra schemas..." java -jar ./netconf/tools/netconf-testtool/target/netconf-testtool-*-SNAPSHOT-executable.jar --device-count 1 --schemas-dir ./extra_schemas/netconf-658b --md-sal true |
| Comment by Allan Clarke [ 06/Mar/20 ] |
|
Use the attached Postman collection to mount testtool as device, create content, apply query |
| Comment by Allan Clarke [ 06/Mar/20 ] |
|
So I got the back haul model 3 Yang files loaded into testtool (acting as a device). I made minor modifications by commenting out some of the model so my payloads were simpler. I created an instance in the device and the read gave this, which looks fine to me: <control-construct xmlns="urn:onf:yang:core-model-1-4"> <logical-termination-point> <uuid>xyz</uuid> <layer-protocol> <local-id>foobar</local-id> <ethernet-container-pac xmlns="urn:onf:yang:ethernet-container-2-0"> <ethernet-container-current-problems> <current-problem-list> <sequence-number>3</sequence-number> <problem-severity>SEVERITY_TYPE_MINOR</problem-severity> <timestamp>2020-03-06T11:00:02Z</timestamp> </current-problem-list> <current-problem-list> <sequence-number>2</sequence-number> <timestamp>2020-03-06T11:00:01Z</timestamp> <problem-name>bar</problem-name> </current-problem-list> <current-problem-list> <sequence-number>1</sequence-number> <problem-severity>SEVERITY_TYPE_CRITICAL</problem-severity> <timestamp>2020-03-06T11:00:00Z</timestamp> <problem-name>foo</problem-name> </current-problem-list> </ethernet-container-current-problems> </ethernet-container-pac> </layer-protocol> </logical-termination-point> </control-construct> I ran the original query URL (ignore the missing content type) from the JIRA issue, shown below: It resulted in the following error: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-message>Child ethernet-container-pac node missing in logical-termination-point</error-message> <error-tag>invalid-value</error-tag> <error-type>protocol</error-type> </error> </errors> I think that URL is not compatible with the Yang model. I changed the query URL to be: So this resulted in a successful query, yielding: <control-construct xmlns="urn:onf:yang:core-model-1-4"> <logical-termination-point> <layer-protocol> <ethernet-container-pac xmlns="urn:onf:yang:ethernet-container-2-0"> <ethernet-container-current-problems> <current-problem-list> <sequence-number>3</sequence-number> <problem-severity>SEVERITY_TYPE_MINOR</problem-severity> <timestamp>2020-03-06T11:00:02Z</timestamp> </current-problem-list> <current-problem-list> <sequence-number>2</sequence-number> <timestamp>2020-03-06T11:00:01Z</timestamp> <problem-name>bar</problem-name> </current-problem-list> <current-problem-list> <sequence-number>1</sequence-number> <problem-severity>SEVERITY_TYPE_CRITICAL</problem-severity> <timestamp>2020-03-06T11:00:00Z</timestamp> <problem-name>foo</problem-name> </current-problem-list> </ethernet-container-current-problems> </ethernet-container-pac> </layer-protocol> </logical-termination-point> </control-construct> So the original URL shows an error that is really more of a “typo” in the query. |
| Comment by Allan Clarke [ 06/Mar/20 ] |
|
Not a bug. User error. |