pvesh and how to list API endpoints

lifeboy

Renowned Member
I have seen a couple of blogs out there that claim one can simply use the pvesh command without any parameters and it will drop into an interactive mode where one can show the calls that can be done and a particular level. It doesn't work like that for me though and the documentation is really bad on the API imho.

Code:
NodeA:~# pvesh
ERROR: no command specified
USAGE: pvesh <COMMAND> [ARGS] [OPTIONS]


       pvesh create <api_path> [OPTIONS] [FORMAT_OPTIONS]
       pvesh delete <api_path> [OPTIONS] [FORMAT_OPTIONS]
       pvesh get <api_path> [OPTIONS] [FORMAT_OPTIONS]
       pvesh ls <api_path> [OPTIONS] [FORMAT_OPTIONS]
       pvesh set <api_path> [OPTIONS] [FORMAT_OPTIONS]
       pvesh usage <api_path> [OPTIONS]


       pvesh help [<extra-args>] [OPTIONS]

I can start with
Code:
pvesh get /cluster/
and then press <tab>, which will do an autocomplete listing and in that I can sort of figure out what the options are. Is that really the official way to figure out what the API can provide?
 
and then press <tab>, which will do an autocomplete listing and in that I can sort of figure out what the options are. Is that really the official way to figure out what the API can provide?
No, using documentation is much better way. There is also "ls" command that is better than tab, if you really couldnt use documentation.
and the documentation is really bad on the API imho.
I've never had an issue with it and think that its adequate. If, in your opinion, its really lacking - feel free to provide arguments and improvement suggestions to support your opinion. I've always been able to find what I needed there.


Blockbridge: Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
No, using documentation is much better way. There is also "ls" command that is better than tab, if you really couldnt use documentation.

I've never had an issue with it and think that its adequate. If, in your opinion, its really lacking - feel free to provide arguments and improvement suggestions to support your opinion. I've always been able to find what I needed there.

I had used https://pve.proxmox.com/wiki/Proxmox_VE_API#Using_.27pvesh.27_to_Access_the_API, which bascially just touches on the how to use pvesh.

However, I have now found https://pve.proxmox.com/pve-docs/api-viewer/, which actually documents the whole API. I think it would be a good idea to add section into the former page linking to the API documentation.
 

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!