Closed MuhendisBey closed 3 years ago
Hello @MuhendisBey,
Please try PATCH request in the format:
curl -X PATCH \
http://localhost:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=xxx-dhcp/yang-ext:mount/dhcpd-kea:dhcp-kea \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 30d2af9f-27b4-977e-92f7-6a2a00fadf9d' \
-d '{
"dhcpd-kea:dhcp-kea": {
"subnets": [
{
"id":8,
"net": "192.168.8.1",
"mask": "255.255.255.0",
"routers": "192.168.1.3, 192.168.1.8",
"tftpAddrs": "192.168.1.3"
}
]
}
}'
Please, define container in request payload or define list with id in path, for example:
curl -X PATCH \
http://localhost:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=xxx-dhcp/yang-ext:mount/dhcpd-kea:dhcp-kea/subnets=8 \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 2dff98c2-78a7-9e45-d144-4bc457df629b' \
-d '{
"subnets": [
{
"id":8,
"net": "192.168.8.25",
"mask": "255.255.255.0",
"routers": "192.168.1.3, 192.168.1.8",
"tftpAddrs": "192.168.1.3"
}
]
}'
Please let us know if this works.
Hello @caladi Thx for your reply, it's working.
In that case, i have two question: 1-> why i can't see them in the swagger? Does swagger render patch endpoints. 2-> As you can see in that yang, Id is the key element. is it possible to change value of id without creating new entry ?
Many thanks, With My Best Regards,
pathc operation doesn't work for container config
Branch lighty.io branch [v 14.x]
To Reproduce Steps to reproduce the behavior:
BODY: { "subnets": [ { "id":8, "net": "192.168.8.0", "mask": "255.255.255.0", "routers": "192.168.1.3, 192.168.1.8", "tftpAddrs": "192.168.1.3" } ] }
Expected behavior user shouldn't get an error.
Environment (please complete the following information):
Here is the yang file