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

    Laravel Xen Orchestra v1.0.0 — Open-source PHP/Laravel client for the XO REST API

    Scheduled Pinned Locked Moved REST API
    2 Posts 2 Posters 25 Views 2 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.
    • samuelolavoS Offline
      samuelolavo
      last edited by

      Laravel Xen Orchestra v1.0.0 — An open-source PHP/Laravel client for the XO REST API

      Hi everyone!

      I’d like to share a small contribution to the XCP-ng and Xen Orchestra community: Laravel Xen Orchestra, an open-source package for integrating the XO REST API into PHP/Laravel applications.

      The idea is to help other developers who use this ecosystem, make common integration tasks easier, and share something useful with the community. If you’re building an internal dashboard, an automation tool, or an application that interacts with Xen Orchestra, I hope this package can save you some time.

      Here’s a simple example:

      use SamuelOlavo\XenOrchestra\Laravel\Facades\Xo;
      
      // List running VMs with the fields you need.
      $vms = Xo::vms()
          ->fields(['id', 'name_label', 'power_state'])
          ->running()
          ->get();
      
      // Start a VM and wait for the operation to finish.
      Xo::vm($vmId)->start()->wait();
      

      Version 1.0.0 targets Xen Orchestra 6.8.0 / REST API 0.39.0 and includes:

      • VM, host, pool, storage and network management.
      • Backup repository administration, schedules and logs.
      • Users, groups and role-based permissions.
      • Asynchronous task handling.
      • VM and disk imports/exports.
      • Events and subscriptions.
      • IPMI and SDN helpers when the corresponding plugins are available.

      The package supports PHP 8.2+ and Laravel 12/13.

      For transparency, the automated suite currently has 332 passing tests, run locally with PHP 8.4 and Laravel 13 using simulated API responses. This does not replace testing against a live Xen Orchestra installation, so feedback from different environments would be especially valuable.

      Repository and documentation:
      https://github.com/samuel-olavo/laravel-xen-orchestra

      Version 1.0.0:
      https://github.com/samuel-olavo/laravel-xen-orchestra/releases/tag/v1.0.0

      This is an independent community project, released under the MIT license, and is not affiliated with Vates.

      Suggestions, bug reports, pull requests and examples of how you use it are all welcome. If something could be clearer or work better, please let me know!

      Thanks to the XCP-ng and Xen Orchestra teams, and to everyone contributing to this community. I hope this can be useful to others too.

      poddingueP 1 Reply Last reply Reply Quote 2
      • poddingueP Online
        poddingue Vates 🪐 @samuelolavo
        last edited by

        Nice work, and thank you for putting it out under MIT. 👍

        What happens to a client like this when the REST API moves under it? You have tagged 1.0.0 against 6.8.0 and 0.39.0, and I am curious whether you are planning to track versions or to fail loudly when something it expects has gone. 🤔

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post