How to add filter for leaf node in get-config query of restconf. Gets " must be Container or List yang type" error.

asked 2015-08-31 08:31:35 -0800

harsharya91 gravatar image

updated 2015-08-31 08:46:27 -0800

This is my yang module.

container configuration {
    config true;
    container system {
         description "System parameters";
          leaf host-name {
                type string {
                     length "1 .. 255";
                }
          }
          leaf time-zone {
                type string;
          }
     }
}

http://ip:8080/restconf/config/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/configuration:configuration/system/
{
    "system": {
        "time-zone": "America/New_York",
        "host-name": "foo"
    }
} 

How to write restconf get-config query to filter only host-name ? 
http://ip:8080/restconf/config/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/configuration:configuration/system/host-name

{
    "errors": {
        "error": [
            {
                "error-type": "protocol",
                "error-tag": "invalid-value",
                "error-message": "URI has bad format. Node \"host-name\" must be Container or List yang type."
            }
        ]
    }
}
edit retag flag offensive close merge delete