Bug 807977 - [Rest API] messages element for domain resource have a different architecture with other resource
[Rest API] messages element for domain resource have a different architecture...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
1.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Krishna Raman
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-29 05:25 EDT by Johnny Liu
Modified: 2014-06-18 03:24 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-27 16:46:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Johnny Liu 2012-03-29 05:25:23 EDT
Description of problem:
Create domain:
$ curl -k -X POST -H 'Accept: application/xml' -H 'Content-type: application/json' -d '{'\''namespace'\'':jialiu}' --user jialiu@redhat.com:214214 https://ec2-23-20-46-167.compute-1.amazonaws.com/broker/rest/domains
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <version>1.0</version>
  <type>domain</type>
  <data>
     <domain>
      .....
      .....
      .....
     </domain>
  </data>
  <messages/>
</response>

Create app:
$ curl -k -X POST -H 'Accept: application/xml' -d name=myapp -d cartridge=php-5.3 --user jialiu@redhat.com:214214 https://ec2-23-20-46-167.compute-1.amazonaws.com/broker/rest/domains/jialiu/applications
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <version>1.0</version>
  <type>application</type>
  <data>
    <application>
      .....
      .....
      .....
    </application>
  </data>
  <messages>
    <message>
      <text>Application myapp was created.</text>
      <severity>info</severity>
      <exit-code nil="true"></exit-code>
      <field nil="true"></field>
    </message>
  </messages>
</response>

Compare two xml response, found that:
when create domain, <data> element is children of <messages> element.
when create app, <data> element is sibling to <messages> element.

Having a consistent messages element across all types of responses makes the
parsing easier.

And message element is missing in the messages when creating domain.

Version-Release number of selected component (if applicable):
devenv_1679

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Johnny Liu 2012-03-29 05:42:44 EDT
And user resource also has the same issue.
Comment 2 Lili Nader 2012-04-20 19:46:50 EDT
Even in the example shown the data element is not a child of messages.  It is always a sibling.
Comment 3 Johnny Liu 2012-04-23 01:40:53 EDT
Verified this bug on devenv_1735, and PASS.

Note You need to log in before you can comment on or make changes to this bug.