Updating presets with curl

hi all

I am able to download all presets with a single command:

curl -s 'http://acstest:7557/presets' -X GET | python -m json.tool > ../provision/testing/presets.json 

my goal is to be able to edit them from NetBeans and upload them on every change, but I get 405 Method Not Allowed.

rudy@rudy:~/37sur/TR069_/testing$ curl -X PUT -i 'http://acstest:7557/presets' --data-binary "@/home/rudy/37sur/TR069_/provision/testing/presets.json" ; echo
HTTP/1.1 405 Method Not Allowed
GenieACS-Version: 1.2.4+20210304173832
Allow: GET, HEAD
Date: Fri, 14 May 2021 15:42:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked

405 Method Not Allowed
rudy@rudy:~/37sur/TR069_/testing$

Is there any “standard” way to update them all at once ? I’m guessing there’s a security concern about this.

ty.

To the best of my knowledge there is no way to mass create/update presets. You have to specify the name of the preset to create/update.

I wrote code to pull down the presets, break them up into individual files based on the _id into separate .json files and then I can run the script again with a different argument and it will update the ACS with the values in each .json file.

This code is written as a Symfony command and is tied to how I do things (and thus not generic enough for those that aren’t programmers to use/modify) otherwise I would release it.

1 Like