[SOLVED] Api path /cluster/ha/ressources difference between http and cli

Roumano

New Member
Feb 24, 2023
2
0
1
Dear Proxmox user,

I'm trying to use the api, i get a difference if i use it on http or in cli
- on cli, like with `pvesh get /cluster/ha/resources`, i'm getting ct AND VM
- on http, like curl {{ api_url }}cluster/ha/resources, i'm getting only type=vm,

This http is strange as the api documentation say it's optional
and the consequance it's not possible to get type=ct and type=vm in one command with the http ressource

PS : i can use the http with `curl {{ api_url }}cluster/ha/resources?type=ct` or with `curl {{ api_url }}cluster/ha/resources?type=vm`

The official documentation : https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/ha/resources
 
It works fine for me:
Code:
root@pve7demo1:~# pvesh get /cluster/ha/resources
┌────────┐
│ sid    │
╞════════╡
│ ct:102 │
├────────┤
│ vm:100 │
└────────┘
# curl --insecure  --cookie "$(<cookie)" --header "$(<csrftoken)" -X GET https://127.0.0.1:8006/api2/json/cluster/ha/resources |jq
{
  "data": [
    {
      "type": "ct",
      "digest": "a78e32891fe52eed52631b79a26dfe30740f8170",
      "state": "started",
      "sid": "ct:102"
    },
    {
      "max_relocate": 10,
      "max_restart": 10,
      "group": "test",
      "sid": "vm:100",
      "digest": "a78e32891fe52eed52631b79a26dfe30740f8170",
      "type": "vm",
      "state": "started"
    }
  ]
}

Double check that you are on the latest code, querying the same cluster, looking at right resources. Then if everything checks out - provide more details/output about your configuration/results.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: Roumano

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!