Anyone know how to make a DHCP-Server lease static via the REST API?
I’ve tried every combination I can think of.
I can set a comment:
curl -k -u 'api':'password' -X PATCH http://10.0.1.1/rest/ip/dhcp-server/lease/*85 --data '{"comment": "test"}' -H "content-type: application/json"
In the console, I would do:
/ip/dhcp-server/lease/make-static numbers=*85
Thanks in advance.
infabo
June 7, 2024, 12:52pm
2
Amm0
June 7, 2024, 1:50pm
3
I think patch should work. What may be the issue is the sh/bash/zsh/etc wildcard expansion.
Try some single quotes around the URL part. i.e.
curl -k -u 'api':'password' -X PATCH 'http://10.0.1.1/rest/ip/dhcp-server/lease/*85' --data '{"comment": "test"}' -H "content-type: application/json"
Thanks,
That github.io page wouldn’t load completely but I used one of the POST examples that would load and the schema and finally guessed this, which worked:
curl -k -u 'api':'password' -X POST http://10.0.1.1/rest/ip/dhcp-server/lease/make-static --data '{"numbers": "*86"}' -H "content-type: application/json"
Thanks again,