deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dies Koper (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DTACLOUD-357) can't create machine using CIMI front-end with json POST
Date Wed, 07 Nov 2012 05:54:12 GMT
Dies Koper created DTACLOUD-357:
-----------------------------------

             Summary: can't create machine using CIMI front-end with json POST
                 Key: DTACLOUD-357
                 URL: https://issues.apache.org/jira/browse/DTACLOUD-357
             Project: DeltaCloud
          Issue Type: Bug
          Components: CIMI/Frontend
            Reporter: Dies Koper


curl --user "user:pwd" -X POST http://localhost:3001/cimi/machines -H "Content-Type: application/json"
-d POST.json

with

{ "resourceURI": "http://schemas.dmtf.org/cimi/1/MachineCreate", "name": "myMachine1", "description":
"My very first machine", "machineTemplate": { "machineConfig": { "href": "http://localhost:3001/cimi/machine_configurations/economy"
}, "machineImage": { "href": "http://localhost:3001/cimi/machine_images/IMG_3c9820_S24FWXU0Q9VH0JK"
} } } 

gives:

 500: [ArgumentError] File does not exist
 from gems/xml-simple-1.1.1/lib/xmlsimple.rb:990:in `find_xml_file'
 from deltacloud/server/lib/cimi/models/machine.rb:59:in `create_from_xml'

I'm posting json data!

DC code has if request.content_type.end_with?("+json")
else xml

which is suspicious.
When I change my content type to +json, I get [NameError] undefined local variable or method
`xml' for CIMI::Model::Machine:Class
 in
     hardware_profile_id = xml['machineTemplate']['machineConfig']["href"].split('/').last

Looks like the json method has been copied & pasted from the xml one?


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message