Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Inconsistent behaviour in handling projectid param for different list APIs #11517

Copy link
Copy link
@shwstppr

Description

@shwstppr
Issue body actions

problem

Many list APIs support the projectid parameter to filter resources for a specific project. However, when projectid = -1 is passed with listall=true, the behavior is inconsistent: some APIs return all resources accessible to the caller (typically for admins), while others only return resources explicitly associated with a project. This inconsistency creates confusion, and we should explore options to normalize the behavior across APIs.

Related:

versions

4.21-Snapshot, earlier

Different API behaviour for listVirtualMachines and listNetworks

(localcloud) 🐱 > list networks listall=true filter=id,name,project
{
  "count": 1,
  "network": [
    {
      "id": "8d7f5b0f-f215-48ee-92f5-8cbd1d0259d9",
      "name": "demonet"
    }
  ]
}
(localcloud) 🐱 > list virtualmachines projectid=-1 listall=true filter=id,name,project
{
  "count": 3,
  "virtualmachine": [
    {
      "id": "e34775ec-720b-42b4-a7ee-726e399e429d",
      "name": "kvm-vm"
    },
    {
      "id": "76108354-30fe-4ced-a18d-0db35afca135",
      "name": "proxmox-vm"
    },
    {
      "id": "0a652b81-c2b2-45b4-a747-0de511fcdcc7",
      "name": "project-vm",
      "project": "demo"
    }
  ]
}
(localcloud) 🐱 > list virtualmachines listall=true filter=id,name,project
{
  "count": 2,
  "virtualmachine": [
    {
      "id": "e34775ec-720b-42b4-a7ee-726e399e429d",
      "name": "kvm-vm"
    },
    {
      "id": "76108354-30fe-4ced-a18d-0db35afca135",
      "name": "proxmox-vm"
    }
  ]
}
(localcloud) 🐱 > list networks projectid=-1 listall=true filter=id,name,project
{
  "count": 1,
  "network": [
    {
      "id": "2640fda5-2b5a-4f7f-8750-b2b898ea9e9a",
      "name": "project-l2",
      "project": "demo"
    }
  ]
}
(localcloud) 🐱 > list networks listall=true filter=id,name,project
{
  "count": 1,
  "network": [
    {
      "id": "8d7f5b0f-f215-48ee-92f5-8cbd1d0259d9",
      "name": "demonet"
    }
  ]
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.