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 499 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

          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