Frequently Asked Question
Proxmox API - Status
Last Updated 1 days ago
To obtain cluster status information from your Proxmox VE node (pve91-lab1.gen) using an API token, you must construct a curl command that authenticates via the Authorization header and targets the correct API endpoint.
Please follow these steps:
- Identify your API Token: Ensure you have the full API token string (e.g.,
root@pam!token-name=uuid...). If you only have a username and password, you must first generate a token via the Proxmox Web UI under Datacenter -> Permissions -> API Tokens. - Construct the Command: Use the following structure. Replace
YOURAPITOKENwith your actual token string.
curl -k -H "Authorization: PVEAPIToken=root@pam!token-name=uuid..." https://pve91-lab1.gen:8006/api2/json/cluster/status
Key Details:
-k: This flag allowscurlto proceed with insecure connections (ignoring SSL certificate verification). This is often necessary for lab environments or if using self-signed certificates, which are common in Proxmox setups. If your certificate is trusted, you can remove-k.-H "Authorization: PVEAPIToken=...": This header provides the authentication credentials. The format isPVEAPIToken=<user>@<realm>!<token-name>=<uuid>.https://pve91-lab1.gen:8006/api2/json/cluster/status: This is the specific endpoint for retrieving cluster status.
Expected Output: The command will return a JSON response containing the current health status, node information, and any warnings or errors within the cluster. If successful, the response will include a data object with status details (e.g., status: "OK").
Troubleshooting:
- 401 Unauthorized: Verify that the API token is correct and has not expired. Ensure the token has the necessary privileges (usually
Datacenter.AlarmorSysmodfor cluster status). - Connection Refused: Check that the Proxmox node is online and that port 8006 is accessible from your machine.
- SSL Errors: If you do not use
-kand receive certificate errors, ensure your system trusts the Proxmox node's SSL certificate or use the IP address if the hostname does not resolve correctly in your DNS.
