Skip to content

[API] Internal DB IDs used as parameters #9684

Description

@nvazquez
ISSUE TYPE
  • Improvement Request
COMPONENT NAME
API
CLOUDSTACK VERSION
Any
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

The API accepts internal database IDs as well as UUIDs on the UUID parameters. For example:

(nvs) 🐱 > list accounts id=c3d932e5-488c-11ef-a188-3e7340e5df3c filter=id,name
{
  "account": [
    {
      "id": "c3d932e5-488c-11ef-a188-3e7340e5df3c",
      "name": "nicolas"
    }
  ],
  "count": 1
}
(nvs) 🐱 > list accounts id=2 filter=id,name
{
  "account": [
    {
      "id": "c3d932e5-488c-11ef-a188-3e7340e5df3c",
      "name": "nicolas"
    }
  ],
  "count": 1
}
(nvs) 🐱 > list accounts id=3 filter=id,name
{
  "account": [
    {
      "id": "eef0d0a3-8013-4c37-954d-eafb96716c95",
      "name": "baremetal-system-account"
    }
  ],
  "count": 1
}
EXPECTED RESULTS
ERROR - only UUIDs must be accepted
ACTUAL RESULTS
Successful API response

Activity

  1. DaanHoogland commented on Sep 16, 2024

    @DaanHoogland
    Contributor

    @nvazquez isn't this just very convenient for admins? they have to look at the db and it would be very usefull for them to be able to use the DB ID instead of the UUID, at times. I can understand if we disable this for other users but would really like to keep the behaviour in for admins.

  2. added this to the unplanned milestone on Nov 8, 2024
  3. added a commit that references this issue on Nov 4, 2025
    77edb37
  4. shwstppr commented on Nov 4, 2025

    @shwstppr
    Contributor

    @nvazquez @DaanHoogland how about a global config to control the behaviour? Only pre-3.x (or the ones missing since annotation) APIs would allow internal DB IDs. I created a PR to control this. Default behaviour would continue

  5. DaanHoogland commented on Nov 4, 2025

    @DaanHoogland
    Contributor

    yout PR looks good @shwstppr , I wonder though if we should only allow root admin to use the old behaviour?

  6. shwstppr commented on Nov 6, 2025

    @shwstppr
    Contributor

    @DaanHoogland Root admin filter makes sense. But since will add an additional DB call to check the caller for each API/param I would want something like to keep track of the caller, #11390

  7. modified the milestones: unplanned, 4.23.0 on Jan 30, 2026
  8. modified the milestones: 4.23.0, 4.24.0 on Jun 29, 2026
  9. nvazquez commented on Oct 29, 2026

    @nvazquez
    ContributorAuthor

    Hi @shwstppr - I see this PR #11976 has been closed, any plans to include it on 24.0?

  10. DaanHoogland commented on Oct 30, 2026

    @DaanHoogland
    Contributor

    19. Hi @shwstppr - I see this PR #11976 has been closed, any plans to include it on 24.0?

    @nvazquez , I rember @shwstppr closing this due to lack of involvement. you can reopen and test it. it still makes sense.

  11. shwstppr commented on Oct 30, 2026

    @shwstppr
    Contributor

    Thanks @DaanHoogland. @nvazquez what he said ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions