Bug 806395 - [REST API] Provide a link within <alias> to remove the alias
[REST API] Provide a link within <alias> to remove the alias
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Abhishek Gupta
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-23 11:54 EDT by Xavier Coulon
Modified: 2015-05-14 20:51 EDT (History)
5 users (show)

See Also:
Fixed In Version: devenv_2781
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-13 19:53:57 EST
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-23 11:54:47 EDT
To remain consistent with the other URLs, "alias" could be considered as a resource, and thus, we could have a response with the following structure:

<application>
      <framework>jbossas-7</framework>
      <domain-id>xcoulon</domain-id>
      <aliases>
      <alias>
       <name>test21</name>
       <link><rel>Remove alias</rel>... </link>
      </alias>
    </aliases>
   ...
</application>

and not have alias management via 'events' which could be used only to stop/start/restart the application

instead of :

<application>
      <framework>jbossas-7</framework>
      <domain-id>xcoulon</domain-id>
      <aliases>
      <alias>test21</alias>
    </aliases>
   ...
</application>
Comment 1 Xavier Coulon 2012-03-23 11:59:57 EDT
as a complement, it is hard to understand why aliases are not seen as subresources of an application, rather than 'events'.

Also, to keep consistency, the link to create an alias could be located inside of the <aliases> element.
Comment 2 Mrunal Patel 2012-03-26 18:43:15 EDT
Lowering priority since this could be addressed in a US.
Comment 3 Abhishek Gupta 2012-06-19 18:35:40 EDT
Short of a new user story, for now, maybe we could just list the current application aliases as the valid options for the remove alias link.

Thoughts???
Comment 4 Abhishek Gupta 2012-07-16 16:28:33 EDT
Can I get feedback on the proposed solution in Comment 3? Changing the response structure would require us to bump up the REST API version.
Comment 5 Andre Dietisheim 2012-07-30 05:56:26 EDT
I'd love to comment but I dont fully get how the new response structure would look like. Could you please provide some example xml/json?
Comment 6 Abhishek Gupta 2013-01-30 15:28:48 EST
Sorry for the delay. As per my comment #3 above, the remove alias link could include the current list of application aliases as "valid-options". An example link structure is shown below.


        <link>
          <rel>Remove application alias</rel>
          <method>POST</method>
          <href>https://localhost/broker/rest/domains/agupta1/applications/app1/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>remove-alias</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
            <param>
              <name>alias</name>
              <type>string</type>
              <description>The application alias to be removed</description>
              <valid-options/>
              <invalid-options>
                <valid-option>app-alias-1</valid-option>
                <valid-option>app-alias-2</valid-option>
              </invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
Comment 7 Abhishek Gupta 2013-01-30 15:31:40 EST
Added the alias list in teh wrong place in the example link structure above. It should be in "valid-options" instead.

        <link>
          <rel>Remove application alias</rel>
          <method>POST</method>
          <href>https://localhost/broker/rest/domains/agupta1/applications/app1/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>remove-alias</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
            <param>
              <name>alias</name>
              <type>string</type>
              <description>The application alias to be removed</description>
              <valid-options>
                <valid-option>app-alias-1</valid-option>
                <valid-option>app-alias-2</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
Comment 8 Xavier Coulon 2013-01-31 05:52:22 EST
Abhishek, that solution looks fine to me.
Comment 9 Abhishek Gupta 2013-02-06 01:53:22 EST
Added the list of alias as valid options in this pull request --> https://github.com/openshift/origin-server/pull/1321
Comment 10 openshift-github-bot 2013-02-06 03:21:09 EST
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/0ef35838175841aee4a050891e4adcaa550f0da6
Fix for bug 806395 - added list of alias as valid options in remove alias link for application in rest response
Comment 11 Abhishek Gupta 2013-02-06 12:58:35 EST
Fixed in devenv_2781
Comment 12 Wei Sun 2013-02-07 02:02:50 EST
Verified on devnev-stg_282

Result:

 <rel>Remove application alias</rel>
          <method>POST</method>
          <href>https://ec2-50-17-140-66.compute-1.amazonaws.com/broker/rest/domains/wsunoldstg282/applications/nds/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>remove-alias</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
            <param>
              <name>alias</name>
              <type>string</type>
              <description>The application alias to be removed</description>
              <valid-options>
                <valid-option>nds.test.com</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>

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