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

    Getting Error Creating VM Through REST

    Scheduled Pinned Locked Moved Solved REST API
    4 Posts 2 Posters 563 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.
    • S Offline
      StephenAOINS
      last edited by olivierlambert

      I am attempting to create a VM through REST with curl.

      I keep getting the following error:

      [
        {
          "instancePath": "",
          "schemaPath": "#/required",
          "keyword": "required",
          "params": {
            "missingProperty": "name_label"
          },
          "message": "must have required property 'name_label'"
        },
        {
          "instancePath": "",
          "schemaPath": "#/required",
          "keyword": "required",
          "params": {
            "missingProperty": "template"
          },
          "message": "must have required property 'template'"
        }
      ]
      

      So far as I can tell, the data I am sending to the XOA is correct:

      {
        "name_label": "AAATestVM001",
        "template": "903c3e42-47f9-189e-3ea7-623e91c0ccd5-905ab443-e415-4d52-bfef-e14b147eac4e",
        "auto_poweron": true,
        "memory": 4294967296,
        "vdis": [
        {
          "size": 85899345920,
          "name_label": "AAATestVM001_1",
          "sr": "839dea70-7c11-a143-bd4f-f2f8426bb469"
        }
        ],
        "vifs": [
        {
         "network": "8af13cf7-c290-0622-19f0-d16d43587ec0"
        }
        ]
      }
      

      Can anyone tell if there appears to be any errors in the data I am sending?
      Thanks.

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

        Ping @MathieuRA

        1 Reply Last reply Reply Quote 0
        • S Offline
          StephenAOINS
          last edited by

          Turned out I had a typo. applicaton/json vs application/json.

          Sigh....

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

            Haha, glad it works now, that's what matters anyway 🙂

            1 Reply Last reply Reply Quote 0
            • olivierlambertO olivierlambert marked this topic as a question on
            • olivierlambertO olivierlambert has marked this topic as solved 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