Bug 811139

Summary: [REST API] namespace parameter should be replaced by id in the rest api doc
Product: OKD Reporter: Johnny Liu <jialiu>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 1.xCC: cgole, rmillner, rpenta, xtian
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-13 18:32:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Johnny Liu 2012-04-10 09:01:30 UTC
Description of problem:
$ curl -k -X GET -H 'Accept: application/xml' --user jialiu:214214 https://ec2-107-21-165-94.compute-1.amazonaws.com/broker/rest/api
...
    <link>
      <optional-params/>
      <required-params>
        <param>
          <valid-options/>
          <name>namespace</name>
          <description>Name of the domain</description>
          <type>string</type>
        </param>
      </required-params>
      <method>POST</method>
      <href>https://ec2-107-21-165-94.compute-1.amazonaws.com/broker/rest/domains</href>
      <rel>Create new domain</rel>
    </link>
...


The above instruction is not correct, parameter should be "id", not "namespace".
$ curl -k -X POST -H 'Accept: application/xml' -d namespace=jialiu --user jialiu:214214 https://ec2-107-21-165-94.compute-1.amazonaws.com/broker/rest/domains
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <data>
    <datum nil="true"></datum>
  </data>
  <type nil="true"></type>
  <version>1.0</version>
  <messages>
    <message>
      <exit-code>106</exit-code>
      <field>namespace</field>
      <text>Namespace is required and cannot be blank.</text>
      <severity>error</severity>
    </message>
  </messages>
  <status>unprocessable_entity</status>
</response>


BTW, alter domain parameter should be also be updated.
$ curl -k -X GET -H 'Accept: application/xml' --user jialiu:214214 https://ec2-107-21-165-94.compute-1.amazonaws.com/broker/rest/domains
...
        <link>
          <optional-params/>
          <required-params>
            <param>
              <valid-options/>
              <name>namespace</name>
              <description>Name of the domain</description>
              <type>string</type>
            </param>
          </required-params>
          <method>PUT</method>
          <href>https://ec2-107-21-165-94.compute-1.amazonaws.com/broker/rest/domains/newjialiu</href>
          <rel>Update domain</rel>
        </link>
...



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

How reproducible:
Always

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


Expected results:


Additional info:

Comment 1 Ravi Sankar 2012-04-11 01:15:48 UTC
Fixed in git rev 45fa437d090021343

Comment 2 Johnny Liu 2012-04-11 04:09:13 UTC
Verify this bug with devenv_1715, and PASS.