XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. slavavrn
    3. Posts
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 5
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: How to revert VM to snapshot

      @olivierlambert There is no information on this issue yet?

      posted in REST API
      S
      slavavrn
    • RE: How to revert VM to snapshot

      So, Swagger isn't 100% API compliant. That's what I was saying 🙂
      Can I see the API endpoints myself? Is the code open source?
      https://github.com/vatesfr/xen-orchestra/blob/master/packages/xo-server/src/api/vm.mjs#L1088
      Did I find the correct entry point?
      Maybe I should use xo-cli to perform the revert operation? Or does the cli also access the API and can't provide more functionality?

      posted in REST API
      S
      slavavrn
    • RE: How to revert VM to snapshot

      @olivierlambert
      But, for example, for VMS, there are the following actions:
      curl -k -X GET -H "Content-Type: application/json" -b authenticationToken=<my-token-from-user-authentication-tokens> 'https://<xen-local>/rest/v0/vms/<vm_id>/actions'
      [
      "/rest/v0/vms/<vm_id>/actions/clean_reboot",
      "/rest/v0/vms/<vm_id>/actions/clean_shutdown",
      "/rest/v0/vms/<vm_id>/actions/hard_reboot",
      "/rest/v0/vms/<vm_id>/actions/hard_shutdown",
      "/rest/v0/vms/<vm_id>/actions/snapshot",
      "/rest/v0/vms/<vm_id>/actions/start"
      ]
      but in swagger you can see only one action - start
      So, not everything available through the API is reflected in Swagger?Screenshot 2025-10-14 181918.png

      posted in REST API
      S
      slavavrn
    • RE: How to revert VM to snapshot

      Re: Automation script to revert and save snapshot

      Thanks.

      Can I be sure that all API capabilities are reflected in Swagger?

      So far, I've only found one method: creating a scheduled job, which can be launched via the API.
      curl -k -X POST -b 'authenticationToken=<my-token-from-user-authentication-tokens>' 'https://<xen-local>/rest/v0/schedules/<schedule-id>/actions/run'
      But that's a bit of a complicated process.

      posted in REST API
      S
      slavavrn
    • How to revert VM to snapshot

      Re: Automation script to revert and save snapshot

      I have the same question.
      I'm trying
      curl -k -X POST -b 'authenticationToken=<my-token-from-user-authentication-tokens>' 'https://<xen-local>/rest/v0/vm-snapshot/<snapshot-id>/actions'
      and i get
      []
      How do i revert to the snapshot?

      posted in REST API
      S
      slavavrn