[ovirt-users] Help with REST api and json examples

Scott Miller smiller at bandwidth.com
Tue Jun 23 12:49:14 UTC 2015


I am unable to POST with json to the REST api. Every attempt is returned with:

{
  "message": "Request syntactically incorrect. See the description
below for the correct usage:",

>From what I can see the syntax should be ok however I am unable to
locate any json examples for the ovirt REST api on github, or in any
ovirt docs.

Can you help me?

Details:

RHEVM 3.5.3.1-1.4.el6ev

Testing app:
Postman


Example requests with only basic needed items to create a VM, both
fail with above syntax error:


POST /api/vms HTTP/1.1
Host: xxxxxxxxxxxxxxxx
Authorization: Basic xxxxxxxxxxxxxxx
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 8816bbe9-998e-02b6-1873-f4292657868e


{
    "vm": {
        "name": "scott_test",
        "cluster.name": "LabRDU",
        "template.name": "CentOS-6.6-RDU"
    }
}



POST /api/vms HTTP/1.1
Host: xxxxxxxxxxxxxxxxx
Authorization: Basic xxxxxxxxxxxxxxxx
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 8816bbe9-998e-02b6-1873-f4292657868e


{
    "vm.name": "scott_test",
    "vm.cluster.name": "LabRDU",
    "vm.template.name": "CentOS-6.6-RDU"
}



More information about the Users mailing list