Need clarification on XML request and response for Domain V3 Keystone API

asked 2013-07-03 09:46:15 -0500

harika-vakadi gravatar image

While trying to create domain using XML interface as below

1) curl -i http://host:35357/v3/domains -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: " -d'' HTTP/1.1 201 Created Vary: X-Auth-Token Content-Type: application/xml Content-Length: 382 Date: Wed, 03 Jul 2013 09:22:20 GMT

<domain xmlns="http://docs.openstack.org/identity/api/v2.0" id="513d54745dea40e3a9d304e08d6b79d6" enabled="true" name="domain-11dkfj2798031kajdsdjjkfhdddddddddsgh3">

I could observe that the value for parameter enabled is accepted as string("true") and returning the response also as string value.

2) curl -i http://host:35357/v3/domains -X POST -H "Content-Type: application/xml" -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: " -d''HTTP/1.1 201 Created Vary: X-Auth-Token Content-Type: application/json Content-Length: 247 Date: Wed, 03 Jul 2013 09:24:35 GMT

{"domain": {"links": {"self": "http://localhost:5000/v3/domains/8a7f234f002d45cbbf4dca3c2f22e529"}, "enabled": true, "description": "domain-desc-82027371", "name": "domain-11dkfj2798031kajdsdjjkfhgh3dfg", "id": "8a7f234f002d45cbbf4dca3c2f22e529"}}

But in case of json response as above it is returning value of enabled in boolean type as expected.

Can anyone clarify on this scenario? Actually this is effecting my tempest test case where in I have to verify the response of JSON/ XML with the same assertion code

test case ref : https://review.openstack.org/#/c/33618/2/tempest/api/identity/admin/v3/test_domains.py (https://review.openstack.org/#/c/3361...)

And also according to the below doc, it is returning string in case of XML response http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_updateTenant_v2.0_tenants__tenantId__.html (http://docs.openstack.org/api/opensta...)

Please let me know what is the exact expected response.

Thanks in advance, Harika

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2013-07-09 06:43:19 -0500

harika-vakadi gravatar image

Thanks for your response Haneef. Accordingly I have changed my assertion code which checks for interface(JSON/XML) and does it.

edit flag offensive delete link more
0

answered 2013-07-09 06:43:26 -0500

harika-vakadi gravatar image

Thanks Haneef Ali, that solved my question.

edit flag offensive delete link more
0

answered 2013-07-07 18:43:59 -0500

haneef gravatar image

The response is correct. In xml attributes are always quoted. "enabled" is returned as an attribute, that's why you see quote.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-07-03 09:46:15 -0500

Seen: 157 times

Last updated: Jul 09 '13