API access problem

Marsupilani

Member
Sep 12, 2022
6
0
6
Hopeful someone can help for debugging...
PVE version 8.2.7 Cluster with 6 nodes

I try to implement a spice access for VM-ID 111 with API-token. Based on this script:
https://gitlab.com/pawlakm/pve-spice-connect/-/tree/main?ref_type=heads

The spice access by webGUI to the VM works-

I created a User/Group/Role and a API Token....
1731582602846.png
1731582638878.png1731582698002.png1731582812615.png
Then I set the Permission to the vms
1731582776897.png

So I try to read the informations by curl....
curl -k -H 'Authorization: PVEAPIToken=SpiceUser@pve!SpiceUserAPIToken=<SECRET>' --url 'https://<PVE-IP>:8006/api2/json/nodes/pve-i5-12th-1' | jq

... I got HTTP/1.1 200 OK and a data array...then I try

curl -k -H 'Authorization: PVEAPIToken=SpiceUser@pve!SpiceUserAPIToken=<SECRET>' --url 'https://<PVE-IP>:8006/api2/json/nodes/pve-i5-12th-1/vms'

... I got ... HTTP/1.1 501 Method 'GET /nodes/pve-i5-12th-1/vms' not implemented...then I try

curl -k -H 'Authorization: PVEAPIToken=SpiceUser@pve!SpiceUserAPIToken=<SECRET>' --url 'https://<PVE-IP>:8006/api2/json/nodes/pve-i5-12th-1/qemu'

... I got HTTP/1.1 200 OK and an empty data array...then I try

curl -k -H 'Authorization: PVEAPIToken=SpiceUser@pve!SpiceUserAPIToken=<SECRET>' --url 'https://<PVE-IP>:8006/api2/json/nodes/pve-i5-12th-1/qemu/111'

... I got HTTP/1.1 200 OK and a data array

I'm not able to find the cause, why I'm not able to get an array of the VMs with this token?

Is there any log at PVE where I can get more information of the API permissions,requests and problems?
Regards 'https://<PVE-IP>:8006/pve-docs/api-viewer/index.html#/nodes/{node}/qemu
' VM.Audit should be enough...
 

Attachments

  • 1731582627867.png
    1731582627867.png
    14.7 KB · Views: 3
  • 1731582688474.png
    1731582688474.png
    8.1 KB · Views: 3
  • 1731582728073.png
    1731582728073.png
    3 KB · Views: 3
  • 1731582734888.png
    1731582734888.png
    15.5 KB · Views: 2

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!