XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. DevFlint
    D
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Groups 0

    DevFlint

    @DevFlint

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    DevFlint Unfollow Follow

    Latest posts made by DevFlint

    • RE: REST API create_vm returns task URL that doesn't exist?

      @MathieuRA I can’t find any documentation of /tasks/ in swagger, I am on the newest Version of XOA

      posted in REST API
      D
      DevFlint
    • REST API create_vm returns task URL that doesn't exist?

      Hi everyone,

      I'm currently creating VMs via the REST API endpoint:

      POST /rest/v0/pools/${poolId}/actions/create_vm

      Everything works great so far, but since I'm managing VMs externally via my own panel, I need the UUID of the newly created VM as part of the response.

      Right now, my workaround is to cache all existing VMs beforehand, use a very unique name (including a timestamp) when creating the VM, and then scan all VMs afterward to find the new one by matching the name — from which I can extract the UUID. This works, but it's far from efficient, especially since I have to query every single VM individually to get the name_label.

      However, I noticed that the API call returns something like this:

      XOA success response: "/rest/v0/tasks/0mcmb9kba"

      But as far as I can tell, there is no /rest/v0/tasks endpoint available in the REST API. So... why does create_vm return a reference to a resource that doesn't exist?

      I was quite excited at first, thinking this would let me track the task and maybe get the VM UUID without extra API calls — but it seems like a dead end.

      @devs – Is there any timeline on when this /tasks route will be available? And in the meantime, could you consider not returning references to non-existent endpoints? It's a bit misleading and made me waste some time debugging something that doesn't exist (yet?).

      Thanks in advance!

      posted in REST API
      D
      DevFlint