api view description vm

Kosh

Active Member
Dec 24, 2019
76
4
28
44
Hi
pvesh get /nodes/{node}/qemu/{vmid}/config
there is a description argument but it does not display the vm description

having completed pvesh get /nodes/{node}/qemu/{vmid}/config -description


I get an error
Code:
Unknown option: description
400 unable to parse option
pvesh get <api_path> [OPTIONS] [FORMAT_OPTIONS]
 
that API endpoint returns the config, including the "description". there is no way to query just the description via the API, you'd have to use the json format and parse that..
 
node=$(hostname); vmid=112; pvesh get /nodes/${node}/qemu/${vmid}/config --noborder 1 |grep desc


description 2024.feb win10 22H2 fresh install for BOINC
 
Hi
how to correctly compose api requests via curl (pvesh is not suitable) I read both the wiki and the api instruktion, but it didn’t become any clearer

I have a command which I get to display the vm description
curl -k -X GET \
'https://cloud-a001:8006/api2/json/nodes/cloud-a001/qemu/113/config' \
-H 'Authorization: PVEAPIToken=root@pam!monitoring=8d495e45-xxx-yyy-zzzz-fgdgdfgdfg160a0' \
| jq -r '.[].description'

What will the command to change/add a description look like?


PS figured it out myself :)

curl -k -X POST \
'https://cloud-a001:8006/api2/json/nodes/cloud-a001/qemu/113/config' \
-H 'Authorization: PVEAPIToken=root@pam!monitoring=8d495e45-xxx-yyy-zzzz-fgdgdfgdfg160a0' \
-H "Content-Type: application/json" \
-d '{"description":"TEST"}'
 
Last edited:
  • Like
Reactions: fabian
but you probably want to rotate that token secret now ;)
 
  • Like
Reactions: Kosh

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!