Hello,
I think I found a bug in the API. When you call the start command in a container that doesn't exist, it returns "200 OK" and I guess it should return "500".
As you can see below, trying to stop the container return 500 but trying to start it, returns 200. The container with id 175 does not exist.
Here is the result:
# curl -s -D/dev/stderr -k -H "`cat csrf`" -b "`cat proxmox.cookie`" -X POST "" "https://192.168.1.73:8006/api2/json/nodes/pve3/lxc/175/status/stop"
HTTP/1.1 500 CT 175 not running
Cache-Control: max-age=0
Connection: close
Date: Fri, 15 Jul 2016 14:17:22 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0
Content-Length: 13
Content-Type: application/json;charset=UTF-8
Expires: Fri, 15 Jul 2016 14:17:22 GMT
{"data":null}
# curl -s -D/dev/stderr -k -H "`cat csrf`" -b "`cat proxmox.cookie`" -X POST "" "https://192.168.1.73:8006/api2/json/nodes/pve3/lxc/175/status/start"
HTTP/1.1 200 OK
Cache-Control: max-age=0
Connection: close
Connection: Keep-Alive
Date: Fri, 15 Jul 2016 14:17:26 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0
Content-Length: 69
Content-Type: application/json;charset=UTF-8
Expires: Fri, 15 Jul 2016 14:17:26 GMT
{"data":"UPIDve3:00001BDF:12E2E825:5788F076:vzstart:175:root@pam:"}
I think I found a bug in the API. When you call the start command in a container that doesn't exist, it returns "200 OK" and I guess it should return "500".
As you can see below, trying to stop the container return 500 but trying to start it, returns 200. The container with id 175 does not exist.
Here is the result:
# curl -s -D/dev/stderr -k -H "`cat csrf`" -b "`cat proxmox.cookie`" -X POST "" "https://192.168.1.73:8006/api2/json/nodes/pve3/lxc/175/status/stop"
HTTP/1.1 500 CT 175 not running
Cache-Control: max-age=0
Connection: close
Date: Fri, 15 Jul 2016 14:17:22 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0
Content-Length: 13
Content-Type: application/json;charset=UTF-8
Expires: Fri, 15 Jul 2016 14:17:22 GMT
{"data":null}
# curl -s -D/dev/stderr -k -H "`cat csrf`" -b "`cat proxmox.cookie`" -X POST "" "https://192.168.1.73:8006/api2/json/nodes/pve3/lxc/175/status/start"
HTTP/1.1 200 OK
Cache-Control: max-age=0
Connection: close
Connection: Keep-Alive
Date: Fri, 15 Jul 2016 14:17:26 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0
Content-Length: 69
Content-Type: application/json;charset=UTF-8
Expires: Fri, 15 Jul 2016 14:17:26 GMT
{"data":"UPIDve3:00001BDF:12E2E825:5788F076:vzstart:175:root@pam:"}