[SOLVED] api LXC features

pedro.toledo

Member
Oct 10, 2019
6
0
21
42
Hello,

I'm trying use the api for change fuse to enable, in pvesh ok this working but in curl api not.

can someone help me ?

curl --silent --insecure --cookie "$(<$dir/cookie)" --header "$(<$dir/token)" -X PUT\
--data-urlencode features=fuse=1 \
https://$ip:8006/api2/json/nodes/$node/lxc/$vmid/config

Thanks !
 
Hi,

try to change --data-urlencode to --data-binary as the following command

Bash:
curl -i -s -k -X $'PUT' \
    -H $'Host: 127.0.0.1:8006' \
    --data-binary $'features=fuse%3D1' \
    $'https://127.0.0.1:8006/api2/extjs/nodes/<NODE>/lxc/<VMID>/config'
 
Hello Moayad,

Thanks for help.

in this format only work in localhost, right ?

but I need that works this in other host, in my erp.

Thanks again.
 
in this format only work in localhost, right ?
No, I tried remote as well and works fine

With this command:
Bash:
curl -i -s -k -X $'PUT' \
    -H $'Host: RHOST:8006' -H $'CSRFPreventionToken: #YourCSRFToken' -H $'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H $'X-Requested-With: XMLHttpRequest' -H $'Origin: https://RHOST:8006' -H $'Cookie: PVEAuthCookie=#YourCookie' \
    -b $'PVEAuthCookie=#YourCookie' \
    --data-binary $'features=fuse%3D1' \
    $'https://RHOST.com:8006/api2/extjs/nodes/<NODE>/lxc/100/config'
 
  • Like
Reactions: pedro.toledo
Great!

Please mark the thread as [SOLVED] to help other people who have the same issue Thanks!