[SOLVED] api LXC features

pedro.toledo

New Member
Oct 10, 2019
3
0
1
38
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 !
 

Moayad

Proxmox Staff Member
Staff member
Jan 2, 2020
862
68
28
27
Vieena
shop.maurer-it.com
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'
 

pedro.toledo

New Member
Oct 10, 2019
3
0
1
38
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.
 

Moayad

Proxmox Staff Member
Staff member
Jan 2, 2020
862
68
28
27
Vieena
shop.maurer-it.com
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

pedro.toledo

New Member
Oct 10, 2019
3
0
1
38
Great thats working now.

I had use with root@pam not worked with user@pve but not problem.

Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!