[
https://issues.apache.org/jira/browse/DTACLOUD-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13576528#comment-13576528
]
Marios Andreou commented on DTACLOUD-357:
-----------------------------------------
patches were pushed with commit # c67978132376ecd24044a025136b1e7c94520898
b21a51346b2d9b5fb8c7a5367d04321331ec962c
5ed529a7ad4485626a0c8c06e710901fd1ce1094
the original patchset (116) was replaced with
http://tracker.deltacloud.org/set/117
closing ticket.
> 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
> Assignee: Marios Andreou
> Attachments:
> 0001-CIMI-replace-json-and-xml-for-expected-content-types.patch,
> 0002-CIMI-fix-json-parsing-for-create-Machine.patch,
> 0003-CIMI-default-to-a-content-type-for-response-when-cim.patch
>
>
> 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