I can change them via Rest API
curl -k -u admin: -X PATCH https://1.1.1.1/rest/ip/address/*3 --data ‘{“comment”: “test”}’ -H “content-type: application/json” {“.id”:“*3”,“src-address-list”:“MyIPb”}
with no problem.
But how can I remove this attribute, (NOT set them to src-address-list=“”), like below.
/ip/firewall/filter
add action=accept chain=forward protocal=tcp
You show an “add” in CLI, but then use -X PATCH which is a CLI “set”.
You show using --data and then have more JSON at end of curl. Perhaps curl “figures it out” (or perhaps not), but ALL JSON should be part of ONE --data — the JSON should NOT be split into two parts.
Now I suspect an LLM may have led you astray… I’d recommend reading the help at MikroTik which does have good curl examples.
after I change that, configure exported is like......... (that works fine)
/ip/firewall/filter
add action=accept chain=forward dst-address=1.1.1.1 protocol=tcp src-address-list=bbb
but I would like to remove src-address-list= attribute.
after that, configure exported should like.........
/ip/firewall/filter
add action=accept chain=forward dst-address=1.1.1.1 protocol=tcp
The “null” should have worked - but you’re right even in 7.20, you get “” which is NOT empty. But in most cases, POST let to replicate anything the CLI can do, so that’s the trick needed here…
So if you use a POST with “unset” instead, including in JSON of .id and value-name keys (which is “src-address-list”) that should remove it: