API issues. Again.

Started by xupetas, December 11, 2024, 07:02:26 PM

Previous topic - Next topic
Hello,

I got around the issue of the api URI.
Now its a new one. I can't get to set an alias via API:

# curl -s --insecure -u megakey:megapass -X POST https://172.16.0.254:8443/api/firewall/alias/setItem/896eaff6-edfb-4b03-9dca-c2e240681dc0 -H 'Content-Type: application/json' -d '{
  "name": "TESTEALIAS",
  "type": "host",
  "content": "172.16.9.9",
  "descr": ""
}'


I get as a response an {"result":"failed"} message and no alias update.
Note that the UUID for that alias is correct and is visible if i do a get of it.

The httpd daemon log states:

Dec 11 17:58:44 blabla lighttpd[26287]: 172.16.0.30 172.16.0.254:8443 - [11/Dec/2024:17:58:44 +0000] "POST /api/firewall/alias/setItem/896eaff6-edfb-4b03-9dca-c2e240681dc0 HTTP/2.0" 200 19 "-" "curl/7.61.1"
Dec 11 17:58:44 blabla lighttpd[26287]: 172.16.0.30 172.16.0.254:8443 - [11/Dec/2024:17:58:44 +0000] "POST /api/firewall/alias/setItem/896eaff6-edfb-4b03-9dca-c2e240681dc0 HTTP/2.0" 200 19 "-" "curl/7.61.1"



If i set the url to set instead of setItem i get an success message but there is no change of the alias itself.

The http log for that operation is:

Dec 11 17:56:03 blabla lighttpd[26287]: 172.16.0.30 172.16.0.254:8443 - [11/Dec/2024:17:56:03 +0000] "POST /api/firewall/alias/set/896eaff6-edfb-4b03?9dca-c2e240681dc0 HTTP/2.0" 200 18 "-" "curl/7.61.1"
Dec 11 17:56:03 blabla lighttpd[26287]: 172.16.0.30 172.16.0.254:8443 - [11/Dec/2024:17:56:03 +0000] "POST /api/firewall/alias/set/896eaff6-edfb-4b03?9dca-c2e240681dc0 HTTP/2.0" 200 18 "-" "curl/7.61.1"


What am i missing? Thanks so much for your help