Bug 805980 - [REST API] Inadequate response when creating/querying an existing application
[REST API] Inadequate response when creating/querying an existing application
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lili Nader
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-22 11:52 EDT by Xavier Coulon
Modified: 2015-05-14 21:48 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-13 14:30:34 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 Xavier Coulon 2012-03-22 11:52:53 EDT
The response misses the 'data' element (the 'data' element is available when querying for all domains):


<?xml version="1.0" encoding="UTF-8"?>
<response>
  <application>
    <name>sample</name>
    <uuid>5229a2c0f1424aed90d4ca8f20c0f9a2</uuid>
    <domain-id>foobar</domain-id>
    <creation-time>2012-03-19T10:48:26-04:00</creation-time>
    <links>
      <link>
        <rel>Get application gears</rel>
        <href>/domains/foobar/applications/sample/gears</href>
        <optional-params/>
        <method>GET</method>
        <required-params/>
      </link>
      <link>
        <rel>Stop application</rel>
        <href>/domains/foobar/applications/sample/events</href>
        <optional-params/>
        <method>POST</method>
        <required-params>
          <param>
            <name>event</name>
            <description>event</description>
            <valid-options>stop</valid-options>
            <type>string</type>
          </param>
        </required-params>
      </link>
      <link>
        <rel>Restart application</rel>
        <href>/domains/foobar/applications/sample/events</href>
        <optional-params/>
        <method>POST</method>
        <required-params>
          <param>
            <name>event</name>
            <description>event</description>
            <valid-options>restart</valid-options>
            <type>string</type>
          </param>
        </required-params>
      </link>
      <link>
        <rel>Add embedded cartridge</rel>
        <href>/domains/foobar/applications/sample/cartridges</href>
        <optional-params/>
        <method>POST</method>
        <required-params>
          <param>
            <name>cartridge</name>
            <description>framework-type, e.g.: mysql-5.1</description>
            <valid-options>
              <valid-option>postgresql-8.4</valid-option>
              <valid-option>metrics-0.1</valid-option>
              <valid-option>mysql-5.1</valid-option>
              <valid-option>jenkins-client-1.4</valid-option>
              <valid-option>10gen-mms-agent-0.1</valid-option>
              <valid-option>phpmyadmin-3.4</valid-option>
              <valid-option>rockmongo-1.1</valid-option>
              <valid-option>cron-1.4</valid-option>
              <valid-option>mongodb-2.0</valid-option>
            </valid-options>
            <type>string</type>
          </param>
        </required-params>
      </link>
      <link>
        <rel>Delete application</rel>
        <href>/domains/foobar/applications/sample</href>
        <optional-params/>
        <method>DELETE</method>
        <required-params/>
      </link>
      <link>
        <rel>Start application</rel>
        <href>/domains/foobar/applications/sample/events</href>
        <optional-params/>
        <method>POST</method>
        <required-params>
          <param>
            <name>event</name>
            <description>event</description>
            <valid-options>start</valid-options>
            <type>string</type>
          </param>
        </required-params>
      </link>
      <link>
        <rel>List embedded cartridges</rel>
        <href>/domains/foobar/applications/sample/cartridges</href>
        <optional-params/>
        <method>GET</method>
        <required-params/>
      </link>
      <link>
        <rel>Force stop application</rel>
        <href>/domains/foobar/applications/sample/events</href>
        <optional-params/>
        <method>POST</method>
        <required-params>
          <param>
            <name>event</name>
            <description>event</description>
            <valid-options>force-stop</valid-options>
            <type>string</type>
          </param>
        </required-params>
      </link>
    </links>
    <aliases/>
    <framework>jbossas-7</framework>
    <embedded>
    </embedded>
  </application>
  <version>1.0</version>
  <type>application</type>
  <status>created</status>
  <messages>
    <message>
      <field nil="true"></field>
      <exit-code nil="true"></exit-code>
      <text>Application sample was created.</text>
      <severity>info</severity>
    </message>
  </messages>
</response>
Comment 1 Xiaoli Tian 2012-03-30 06:55:09 EDT
Tested on devenv-stage_154, <data> element is provided.

curl -k -H 'Accept: application/xml' --user 'xtian+t64@redhat.com:1' https://ec2-23-20-192-146.compute-1.amazonaws.com/broker/rest/domains/domx64/applications/phpjenkins  -X GET
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <data>
    <application>
      <creation-time>2012-03-30T06:36:33-04:00</creation-time>
      <framework>php-5.3</framework>
      <aliases/>
      <embedded>
        <jenkins-client-1.4>
          <info>Job URL: https://jenkins-domx64.dev.rhcloud.com/job/phpjenkins-build/
</info>
        </jenkins-client-1.4>
      </embedded>
      <git-url>ssh://1cef51c1220443db82f283cea0d3b9dd@phpjenkins-domx64.dev.rhcloud.com/~/git/phpjenkins.git/</git-url>
      <domain-id>domx64</domain-id>
      <links>
        <link>
          <method>GET</method>
          <href>/domains/domx64/applications/phpjenkins/cartridges</href>
          <required-params/>
          <rel>List embedded cartridges</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>remove-alias</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
            <param>
              <valid-options/>
              <description>The application alias to be removed</description>
              <type>string</type>
              <name>alias</name>
            </param>
          </required-params>
          <rel>Remove application alias</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>start</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Start application</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>force-stop</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Force stop application</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/cartridges</href>
          <required-params>
            <param>
              <valid-options>
                <valid-option>mongodb-2.0</valid-option>
                <valid-option>cron-1.4</valid-option>
                <valid-option>mysql-5.1</valid-option>
                <valid-option>postgresql-8.4</valid-option>
                <valid-option>haproxy-1.4</valid-option>
                <valid-option>10gen-mms-agent-0.1</valid-option>
                <valid-option>phpmyadmin-3.4</valid-option>
                <valid-option>metrics-0.1</valid-option>
                <valid-option>phpmoadmin-1.0</valid-option>
                <valid-option>rockmongo-1.1</valid-option>
                <valid-option>jenkins-client-1.4</valid-option>
              </valid-options>
              <description>framework-type, e.g.: mysql-5.1</description>
              <type>string</type>
              <name>cartridge</name>
            </param>
          </required-params>
          <rel>Add embedded cartridge</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>expose-port</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Expose port</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>stop</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Stop application</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>scale-down</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Scale down application</rel>
          <optional-params/>
        </link>
        <link>
          <method>GET</method>
          <href>/domains/domx64/applications/phpjenkins</href>
          <required-params/>
          <rel>Get application</rel>
          <optional-params/>
        </link>
        <link>
          <method>DELETE</method>
          <href>/domains/domx64/applications/phpjenkins</href>
          <required-params/>
          <rel>Delete application</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>add-alias</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
            <param>
              <valid-options/>
              <description>The server alias for the application</description>
              <type>string</type>
              <name>alias</name>
            </param>
          </required-params>
          <rel>Add application alias</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>scale-up</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Scale up application</rel>
          <optional-params/>
        </link>
        <link>
          <method>GET</method>
          <href>/domains/domx64/applications/phpjenkins/gears</href>
          <required-params/>
          <rel>Get application gears</rel>
          <optional-params/>
        </link>
        <link>
          <method>GET</method>
          <href>/domains/domx64/applications/phpjenkins/descriptor</href>
          <required-params/>
          <rel>Get application descriptor</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>show-port</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Show port</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>conceal-port</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Conceal port</rel>
          <optional-params/>
        </link>
        <link>
          <method>POST</method>
          <href>/domains/domx64/applications/phpjenkins/events</href>
          <required-params>
            <param>
              <valid-options>restart</valid-options>
              <description>event</description>
              <type>string</type>
              <name>event</name>
            </param>
          </required-params>
          <rel>Restart application</rel>
          <optional-params/>
        </link>
      </links>
      <uuid>1cef51c1220443db82f283cea0d3b9dd</uuid>
      <app-url>http://phpjenkins-domx64.dev.rhcloud.com/</app-url>
      <name>phpjenkins</name>
    </application>
  </data>
  <type>application</type>
  <version>1.0</version>
  <messages/>
</response>

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