Hi,

I am using yang-patch to modify some of the leaf node values. But whenever the 
PATCH request fails, it is not giving the cause of the failure unlike the POST 
or PUT methods, but just gives an one-liner error that "canCommit encountered 
an unexpected failure". Is there any way in which the PATCH response can give 
the details regarding the failure ?

In the below example I am trying to modify one of the attribute leaf node 
'hostname' value of a non-existing list node "12' . Ideally it is expected that 
it PATCH should report the data does not exist for the node 12, but it is 
reporting "canCommit encountered an unexpected failure". How to make the PATCH 
response to have more details in the error message ?

GET : http://{{ipaddr}}:8181/restconf/config/connector-config:connectors
{
  "connectors": {
    "connector": [
      {
        "uid": "7",
        "mgmt-ip": "1.1.1.1",
        "hostname": "onus.org"
      }
    ]
  }
}


PATCH request : 
http://{{ipaddr}}:8181/restconf/config/connector-config:connectors
{"ietf-restconf:yang-patch" : {
    "patch-id" : "0",
    "edit" :[
      {
        "edit-id" : "edit1",
        "operation" : "merge",
        "target" : "/connector-config:connector[connector-config:uid ='12']",
        "value":  {
               "connector" : {
                               "uid":"12",
                               "hostname": "opendaylight.org"
               }
        }
      }
    ]
  }
}


PATCH response :
{
  "ietf-yang-patch:yang-patch-status": {
    "patch-id": "0",
    "errors": {
      "error": [
        {
          "error-type": "application",
          "error-tag": "operation-failed",
          "error-message": "canCommit encountered an unexpected failure"
        }
      ]
    },
    "edit-status": {
      "edit": [
        {
          "edit-id": "edit1",
          "ok": [
            null
          ]
        }
      ]
    }
  }
}

Regards
-Satish
_______________________________________________
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to