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>
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.
Lowering priority since this could be addressed in a US.
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???
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.
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?
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>
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>
Abhishek, that solution looks fine to me.
Added the list of alias as valid options in this pull request --> https://github.com/openshift/origin-server/pull/1321
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
Fixed in devenv_2781
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>