XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Webhooks in Xen Orchestra

    Scheduled Pinned Locked Moved Xen Orchestra
    18 Posts 7 Posters 2.4k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AnonabharA Offline
      Anonabhar @olivierlambert
      last edited by

      @olivierlambert LOL So its a case of RTFM for me then 8-)

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        A good way to play with it, is to use xo-cli. It exposes all the function/query you can make via the API, without having to write something yourself.

        Then if you need to call the API directly, you know what to call 🙂

        1 Reply Last reply Reply Quote 0
        • J Offline
          JCastang @pdonias
          last edited by JCastang

          @pdonias Oh great ! I haven't seen this documentation. Nice !
          The only thing I need now is a wrapper to format thing as an Nextcloud Talk API handler.

          I am wondering if this could be integrated as a module in XOA...
          Reading this https://github.com/nextcloud/spreed/issues/1879

          It seems that we could implement a quick script to post (dirty way anyway using login/password) message.
          Could be great if wrapper could be implemented directly in XOA 😄

          Anyway I would first implement a tiny PHP script to post messages in Nextcloud Talk as a first solution.

          fti7 created this issue in nextcloud/spreed

          closed Webhook Support / bot integration #1879

          pdoniasP 1 Reply Last reply Reply Quote 0
          • pdoniasP Offline
            pdonias Vates 🪐 XO Team @JCastang
            last edited by

            Could be great if wrapper could be implemented directly in XOA

            Like a generic configurable wrapper in XO for any webhook target? How do you imagine it?

            1 Reply Last reply Reply Quote 0
            • J Offline
              JCastang
              last edited by

              Hum...

              Maybe like other plugins "transport-XXXX".
              It may be a bit far from "webhooks" but a plugin to handle "notifications" on events.

              We can image that webhook plugin can expose "events" (such as vm.start) and associated actions: webhook call or a plugin call to handle event.

              Use case:
              "Someone trigger vm.start" -> Webhook plugin catches event -> Push this event to a plugin via a method call -> The plugin extracts and format data -> And then pushes it to the ending service (In my case Nextcloud API).

              As for now we can do it via a web call on a micro service that will translate data. (Few lines of code in the link of my previous post)
              But intergrate it as an integrate transport call could be great.
              In such way, a vm.start action can trigger an email too (for example)...

              1 Reply Last reply Reply Quote 0
              • J Offline
                JCastang
                last edited by

                Hello,

                Is that possible to add Frendly names in complement of UUID ? (Such as Job name or VM Name or SR Name) ?

                Thanks !

                pdoniasP 1 Reply Last reply Reply Quote 0
                • pdoniasP Offline
                  pdonias Vates 🪐 XO Team @JCastang
                  last edited by pdonias

                  For now, all you get in the webhook request are the API call parameters and result (and a few other things). This is a generic behaviour that doesn't depend on what the call does. If you need some more specific information, your webhook handler can, for example, make a call to XO's API to fetch that information.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    djingo
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • exeticoE Offline
                      exetico
                      last edited by exetico

                      I'm trying to make a webhook which only fires, if my backup has been made properly (success, without errors). Is that possible?

                      backupNg.runJob does fire, but at all actions. Are there a better method hook I can use? I'm not been able to track a more suitable method, yet.

                      Have I missed a detail, or is that not possible right now?

                      The backup-reports allows me to device the runId, but I'd like to have a webhook even every-time things go as planned (as I've like to integrate the reporting into the service from healthchecks.io).

                      Another workaround would be to have the backup job fire a postpone script or similar, allowing me to customize it (if the proper amount of data was available), or have a postpone script for both success and failure for each job.

                      Healthcheck does support filtering of the payload received, but only for emails, though. And I'd like to get it working with webhooks, if possible.

                      1 Reply Last reply Reply Quote 1
                      • D Offline
                        DustinB
                        last edited by

                        I'll be looking to setup webhooks to push backup logs to our SOC audit platform (tugboat), ideally on the weekly jobs.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post