PVE: REST API vs cmdline commands vs web-GUI

johnnyutahh

Member
Sep 19, 2020
31
6
8
39
Does the web-gui (6.2-11) produce some sort of "command log" for the (presumed?) commands it runs upon receiving a command from the web-based user?

I'm a command-line oriented sysadmin, and I'd eventually like to be able to manage all things without the web gui, or at least using it minimally.
 
  • Like
Reactions: Not_Oles
no, because it's actually the other way round:
- there is a REST API
- the web GUI uses that REST API
- most CLI commands wrap that REST API 1:1, some commands are special and do more, some REST API endpoints are not exposed as commands

for some things the API endpoint logs the corresponding commands, but that is only for a few actions.
 
  • Like
Reactions: Not_Oles
Very helpful. Follow-on questions:

1. In PVE: is there any function/feature/operation that a command (from the "command line terminal") can do that the REST API (either via one REST method/call or many in combination) can not?

In other words: does the PVE REST API provide all primitive functionality to perform all PVE functions?

2. Does or will PBS (backup server) and PMG (mail gateway) function the same way (as above) re: REST-API capability? And if not currently, what does the speculative roadmap rough-calendar timing look like (to implement REST-API for PBS and PMBG) in terms of say quarterly projections moving forward?
 
Last edited:
  • Like
Reactions: Not_Oles
yes, there is some stuff that only the CLI can do (e.g., read files from STDIN, interactively ask for passwords/secrets). all the functionality you see on the GUI uses the plain REST API. the same is true for PMG/PBS.
 
  • Like
Reactions: Not_Oles
Thanks. I'll put this another way: if my team were to write some of our own PVE utilities/software (which we do quite often in these contexts) to supplant some part of the web GUI and/or the cmdline commands, would there be an PVE-specific functionality that is _not_ provided by the REST API?

(In such a case would be able to provide standard-"client" side functionality like asking for secrets, managing stdin/stdout/stderr, etc.)

yes, there is some stuff that only the CLI can do (e.g., read files from STDIN, interactively ask for passwords/secrets). all the functionality you see on the GUI uses the plain REST API. the same is true for PMG/PBS.
 
  • Like
Reactions: Not_Oles
yes. stuff like importing a VM disk or OVA (that is WIP to get onto the API though) or restoring a backup from STDIN is not possible, even if you wrap your own client around the REST API (unless you give that client SSH access, in which case they could put the data from STDIN onto the PVE server into a path according to the expected format, and then reference that in the API call). everything you see on the GUI is plain REST. if you see something on the CLI that is not available on the GUI anywhere, it's possible that it is not available via the API.
 

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!