[pve-devel] Json reply format

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Mar 22 09:06:50 CET 2018


On Wed, Mar 21, 2018 at 03:17:37PM +0100, Thomas Lamprecht wrote:
> Hi,
> 
> On 3/21/18 2:46 PM, Maxim Voronov wrote:
> > Hello again,
> > 
> > I'm working on PVE rest api client and using this documentation: https://pve.proxmox.com/pve-docs/api-viewer/index.html
> > 
> > According to this documentation calling GET /api2/json/access/domains will return me an array,
> > 
> > but I did not found description of what objects are in the array. To get the format of objects I call endpoints of our production PVE server :-D
> > 
> > The question is - where can I have a look at json reply formats for all of endpoint ?
> > 
> 
> There are two problems for easy viewing this info
> through the API viewer.
> 
> 1) we only show the top level type
> 
> 2) Unfortunately we have not all return types fully annotated.
> With new API call we try to be more thorough with that, but
> for older ones you may often not come around of reading the
> code or simply testing it by doing the call, I'm afraid.
> 
> E.g., for the domains and other /access related stuff you can
> find the API code in the pve-access-control git repository,
> a web view for the domain API call would be:
> 
> https://git.proxmox.com/?p=pve-access-control.git;a=blob;f=PVE/API2/Domains.pm;h=b5fa65efc9253847ee49e73bef577c0ab9cf2bf9;hb=HEAD#l52
> 
> (this one is already annotated about what it returns)

just a minor point - in case you don't want to clone all the git repos,
you can also just look into /usr/share/perl5/PVE/API2/ on any PVE
system. makes for easy grepping to have them all in one folder ;)

just be careful to not modify anything by accident - those are the perl
files as used by the API!




More information about the pve-devel mailing list