07-31-2019 12:09 PM - edited 07-31-2019 01:12 PM
Testing out trying to use yang-patch (rfc 8072) for pushing two edits of the same service in one restconf call. I can get the yang-patch to work fine and it creates two services and commits them with the one call.
The problem I am running into is not getting a response from yang-patch. Per the RFC section 2.6:
If a YANG Patch is completed without errors, the RESTCONF server MUST return a "yang-patch-status" message with a "global-status" choice set to "ok". Refer to Appendix A.1.2 for an example of a successful YANG Patch response.
Currently with postman, curl, or python calls I am getting 500 internal errors.
Am I missing a step that will show the yang-patch-status? Attached is yang, below the restconf call.
RESTCONF: (Shell Curl)
curl --request PATCH \ --url http://ncslab.com:8080/restconf/data/patch-service-test \ --header 'Accept: application/yang-data+json' \ --header 'Authorization: Basic daaaaaaaaaaaaa2Ux' \ --header 'Content-Type: application/yang-patch+json' \ --data 'service_patch.json'
service_patch.json
{ "ietf-yang-patch:yang-patch": { "patch-id": "patch-1", "comment": "Test Patch responses", "edit": [ { "edit-id": "edit1", "operation": "create", "target": "/", "value": { "patch-service-test:patch-service-test": [ { "patch-service-test:circuit_id": "patch_yang_CID_1", "patch-service-test:name": "patch_description1", "patch-service-test:deviceName": "xe_virl", "patch-service-test:deviceID": "1111", "patch-service-test:deviceType": "cisco-ios", "patch-service-test:interfaceType": "GigabitEthernet", "patch-service-test:interfaceName": "0/0/0" } ] } }, { "edit-id": "edit2", "operation": "create", "target": "/", "value": { "patch-service-test:patch-service-test": [ { "patch-service-test:circuit_id": "patch_yang_CID_2", "patch-service-test:name": "patch_description2", "patch-service-test:deviceName": "xe_virl", "patch-service-test:deviceID": "1111", "patch-service-test:deviceType": "cisco-ios", "patch-service-test:interfaceType": "GigabitEthernet", "patch-service-test:interfaceName": "0/0/0" } ] } } ] } }
The server just responds with the following:
500 Internal Server Error
Logs from NSO just show the service being created and a commit performed by rest.
Can more verbose logging be turned on or something added to the restconf call to get the response part working?
07-31-2019 01:08 PM
07-31-2019 01:10 PM
08-07-2019 06:26 AM
Just upgraded to 4.7.4.3, saw in changelog this was fixed in 4.7.4.1. Works now.
- restconf: Corrected the body format of yang-patch-status response
message in success cases.
(ENG-20606, RT:36346, PS-31425)
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: