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

    xo-cli and REST - show available fields

    Scheduled Pinned Locked Moved Solved REST API
    3 Posts 2 Posters 300 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.
    • K Offline
      KPS Top contributor
      last edited by

      Hi!

      I am just trying to use the XO-api.

      It is working fine to get e.g. the VM-list:

      xo-cli rest get vms fields=name_label,power_state
      

      What I did not find is an option to get the "available" fields. Is there any possibility to get a list or a "fields_all"-option?

      Thank you and best wishes
      KPS

      julien-fJ 1 Reply Last reply Reply Quote 0
      • julien-fJ Offline
        julien-f Vates 🪐 Co-Founder XO Team @KPS
        last edited by

        @KPS Hello, yes it's possible, you can specify fields=* to get all of them. It is not documented because it should not be used in production, users should specify exactly what fields they need when fetching a collection.

        An alternative way to discover the fields is to too look to a specific record:

        xo-cli rest get vms/123e4f2b-498e-d0af-15ae-f835a1e9f59f
        
        K 1 Reply Last reply Reply Quote 1
        • K Offline
          KPS Top contributor @julien-f
          last edited by

          @julien-f
          Thank you very much!!! GREAT!

          1 Reply Last reply Reply Quote 1
          • olivierlambertO olivierlambert marked this topic as a question on
          • olivierlambertO olivierlambert has marked this topic as solved on
          • olivierlambertO olivierlambert moved this topic from Xen Orchestra on
          • First post
            Last post