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

Asked by Harika Vakadi

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: <token>" -d'<?xml version="1.0" encoding="UTF-8"?><domain xmlns="http://docs.openstack.org/identity/api/v3" enabled="true" description="domain-desc-82027371" name="domain-11dkfj2798031kajdsdjjkfhdddddddddsgh3"/>'
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

<?xml version="1.0" encoding="UTF-8"?>
<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: <token>" -d'<?xml version="1.0" encoding="UTF-8"?><domain xmlns="http://docs.openstack.org/identity/api/v3" enabled="true" description="domain-desc-82027371" name="domain-11dkfj2798031kajdsdjjkfhgh3dfg"/>'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

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

Please let me know what is the exact expected response.

Thanks in advance,
Harika

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Identity (keystone) Edit question
Assignee:
No assignee Edit question
Solved by:
Haneef Ali
Solved:
Last query:
Last reply:
Revision history for this message
Best Haneef Ali (haneef) said :
#1

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

Revision history for this message
Harika Vakadi (harika-vakadi) said :
#2

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

Revision history for this message
Harika Vakadi (harika-vakadi) said :
#3

Thanks Haneef Ali, that solved my question.