Bug 1017027

Summary: The returned links of "environment-variables/<env_name>" from RESTAPI are not accessible
Product: OpenShift Online Reporter: Qiushui Zhang <qiuzhang>
Component: MasterAssignee: Clayton Coleman <ccoleman>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 13:34:22 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 Qiushui Zhang 2013-10-09 07:37:26 UTC
Description of problem:
Visit the "app/environment-variables", it returns something like "environment-variables/varname", which does not work.

Version-Release number of selected component (if applicable):
devenv_3874
REST API 1.6

How reproducible:
always

Steps to Reproduce:
1. Create an app.
rhc app create ews1 jbossews-1.0
2. Add and visit environment-variable
rhc env-add aa=bb -a ews1
curl -k -H "Accept: application/xml" --user qiuzhang:redhat https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/domain/qiuzhang/application/ews1/environment-variables
3. It shows links like "https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/applications/5254f37c542a5c0258000007/environment-variables/aa".
Use this link to visit the variable "aa"

Actual results:
The link is not valid. We can not visit variable "aa" via this link.

Expected results:
It should return valid link, like "https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/applications/5254f37c542a5c0258000007/environment-variable/aa"

Additional info:
The output of environment-variables:
[openshift@dhcp-10-143 tmp]$ curl -k -H "Accept: application/xml" --user qiuzhang:redhat https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/domain/qiuzhang/application/ews1/environment-variables
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <type>environment-variables</type>
  <data>
    <environment-variable>
      <name>aa</name>
      <value>bb</value>
      <links>
        <link>
          <rel>Get environment variable</rel>
          <method>GET</method>
          <href>https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/applications/5254f37c542a5c0258000007/environment-variables/aa</href>
          <required-params/>
          <optional-params/>
        </link>
        <link>
          <rel>Update environment variable</rel>
          <method>PUT</method>
          <href>https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/applications/5254f37c542a5c0258000007/environment-variables/aa</href>
          <required-params>
            <param>
              <name>value</name>
              <type>string</type>
              <description>Value of the environment variable</description>
              <valid-options/>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
        <link>
          <rel>Delete environment variable</rel>
          <method>DELETE</method>
          <href>https://ec2-184-72-179-42.compute-1.amazonaws.com/broker/rest/applications/5254f37c542a5c0258000007/environment-variables/aa</href>
          <required-params/>
          <optional-params/>
        </link>
      </links>
    </environment-variable>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Listing environment variables for application ews1</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

Comment 1 Clayton Coleman 2013-10-11 18:45:16 UTC
Was fixed upstream

Comment 2 Qiushui Zhang 2013-10-12 02:10:53 UTC
Tested on devenv_3890.

The links are updated to valid ones.

Mark the bug as verified.