Hello,
I followed the instructions here to use the API:
https://pve.proxmox.com/wiki/Proxmox_VE_API
When I request information it works great but when I try to deploy a container it returns a 501 error.
This is the command I'm launching:
csrf="CSRFPreventionToken: 5746EF2E:AofYoEWNFDofTkzBfLX7YRcgepE";
curl -k -b `cat proxmox.cookie` -H "$csrf" -X PUT "https://192.168.x.x:8006/api2/json/nodes/pve3/lxc -vmid ${vmid} -hostname $hostname -storage nfs-ssd -password ${pass} -ostemplate nfs-usb:vztmpl/$template -memory 512 -swap 0 -disk 2 -cpus 1 -net0 name=eth0,bridge=vmbr0,ip=192.168.x.${vmid}/24,gw=192.168.x.x"
Here is the error:
192.168.x.x - - [26/May/2016:15:36:18 +0200] "PUT /api2/json/nodes/pve3/lxc -vmid 119 -hostname host.name -storage nfs-ssd -password password -ostemplate nfs-usb:vztmpl/ubuntu-14.04-x86_64-minimal.tar.gz -memory 512 -swap 0 -disk 2 -cpus 1 -net0 name=eth0,bridge=vmbr0,ip=192.168.x.x/24,gw=192.168.x.x HTTP/1.1" 501 -
I tried both with PUT and with PUSH and both return error 501. What is weird is that when I launch GET and I check the log, I can see the username with this is not shown in the log for PUT and PUSH. See here:
192.168.x.x - root@pam [26/May/2016:15:27:05 +0200] "GET /api2/json/cluster/nextid HTTP/1.1" 200 14
To get the cookie I launched a request to https://192.168.x.x:8006/api2/json/access/ticket and then from the response, I got both the cookie and the CSRF. Is this correct or do I have to get the CSRF in a different way ?
Thanks for your help.
I followed the instructions here to use the API:
https://pve.proxmox.com/wiki/Proxmox_VE_API
When I request information it works great but when I try to deploy a container it returns a 501 error.
This is the command I'm launching:
csrf="CSRFPreventionToken: 5746EF2E:AofYoEWNFDofTkzBfLX7YRcgepE";
curl -k -b `cat proxmox.cookie` -H "$csrf" -X PUT "https://192.168.x.x:8006/api2/json/nodes/pve3/lxc -vmid ${vmid} -hostname $hostname -storage nfs-ssd -password ${pass} -ostemplate nfs-usb:vztmpl/$template -memory 512 -swap 0 -disk 2 -cpus 1 -net0 name=eth0,bridge=vmbr0,ip=192.168.x.${vmid}/24,gw=192.168.x.x"
Here is the error:
192.168.x.x - - [26/May/2016:15:36:18 +0200] "PUT /api2/json/nodes/pve3/lxc -vmid 119 -hostname host.name -storage nfs-ssd -password password -ostemplate nfs-usb:vztmpl/ubuntu-14.04-x86_64-minimal.tar.gz -memory 512 -swap 0 -disk 2 -cpus 1 -net0 name=eth0,bridge=vmbr0,ip=192.168.x.x/24,gw=192.168.x.x HTTP/1.1" 501 -
I tried both with PUT and with PUSH and both return error 501. What is weird is that when I launch GET and I check the log, I can see the username with this is not shown in the log for PUT and PUSH. See here:
192.168.x.x - root@pam [26/May/2016:15:27:05 +0200] "GET /api2/json/cluster/nextid HTTP/1.1" 200 14
To get the cookie I launched a request to https://192.168.x.x:8006/api2/json/access/ticket and then from the response, I got both the cookie and the CSRF. Is this correct or do I have to get the CSRF in a different way ?
Thanks for your help.