GET /api2/json/nodes/{node}/qemu/{vmid}/config

immo

Renowned Member
Nov 20, 2014
92
0
71
I tried to use the api function to get the CURRENT config.

there is the optional parameter current existing
so the url is
https://prox:8006/api2/json/nodes/{node}/qemu/{vmid}/config?current=<boolean>

but neither True nor true works. just 0 and 1.
But which is default ? and which is true ?
and why the type is defined as boolean but encoded as integer ?
would not be
.../qemu/{vmid}/config?current=True
also correct ?
 
yLjqLzq.jpg
says boolean. Default is 0 which isnt a boolean from the programming point of view like python does.

May be it would be possible to play around (which i did) and the 1 means True but wouldnt it be better to accept both? 0&False and 1&True ?
 
Last edited:
Default is 0 which isnt a boolean from the programming point of view like python does.

We use mostly perl, so 0 and 1 (or any non-zero number for that matter) are seen as valid booleans.

May be it would be possible to play around (which i did) and the 1 means True but wouldnt it be better to accept both? 0&False and 1&True ?

Possible, but we already use 0 & 1 for all our boolean variables in the API calls, so it would have to be changed everywhere.
 
Ok understood... May be the API documentation should be more clearly or have some links to examples or discussions or comments...
I would comment that 0 and 1 the only understood booleans.
 
May be the API documentation should be more clearly or have some links to examples or discussions or comments...

Thanks for the feedback, I'll look into adding some examples to the API docs soon.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!