[ 
https://issues.apache.org/jira/browse/YARN-4224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15052865#comment-15052865
 ] 

Varun Saxena commented on YARN-4224:
------------------------------------

Regarding user, when I had written the comment, we were getting user from 
caller UGI(if not provided by an optional query param) so at that time user was 
not part of URL's path param. Hence its not seen in the REST URL examples given 
above.
User exists wherever required in the patch though because an interim patch had 
dropped getting user from UGI and moved it to path param.

For the sake of discussion, I will write down the two approaches again.
* The first approach is same as what I had mentioned above.
{panel}
* *Query flows*
*/ws/v2/timeline/\{clusterid}/flows*
_Eg :_ /ws/v2/timeline/yarn_cluster/flows

* *Query flowrun*
*/ws/v2/timeline/\{userid}/\{clusterid}/\{flowid}/run/\{flowrunid}*
_Eg :_ /ws/v2/timeline/admin/yarn_cluster/hive_flow/run/123

* *Query flowruns*
*/ws/v2/timeline/\{userid}/\{clusterid}/\{flowid}/runs*
_Eg :_ /ws/v2/timeline/admin/yarn_cluster/hive_flow/runs

* *Query app*
*/ws/v2/timeline/\{clusterid}/app/\{appid}*
_Eg :_ /ws/v2/timeline/yarn_cluster/app/application_1111111111_1345

* *Query apps for a flow*
*/ws/v2/timeline/\{userid}/\{clusterid}/\{flowid}/apps*
_Eg :_ /ws/v2/timeline/admin/yarn_cluster/hive_flow/apps

* *Query apps for a flowrun*
*/ws/v2/timeline/\{userid}/\{clusterid}/\{flowid}/\{flowrunid}/apps*
_Eg :_ /ws/v2/timeline/admin/yarn_cluster/hive_flow/123/apps

* *Query entity*
*/ws/v2/timeline/\{userid}/\{clusterid}/\{appid}/\{entitytype}/entity/\{entityid}*
_Eg :_ 
/ws/v2/timeline/admin/yarn_cluster/application_1444034548255_0001/YARN_CONTAINER/entity/container_1444034548255_0001_01_000001

* *Query entities*
*/ws/v2/timeline/\{userid}/\{clusterid}/\{appid}/\{entitytype}/entities*
_Eg :_ 
/ws/v2/timeline/admin/yarn_cluster/application_1444034548255_0001/YARN_CONTAINER/entities
{panel}

* As Li said above, in AHS we have URLs' of the form as under. We can adopt 
this approach too.
These URLs' would be longer though.
{panel}
* *Query flows*
*/ws/v2/timeline/clusters/\{clusterid}/flows*
_Eg :_ /ws/v2/timeline/clusters/yarn_cluster/flows

* *Query flowrun*
*/ws/v2/timeline/users/\{userid}/clusters/\{clusterid}/flows/\{flowid}/runs/\{flowrunid}*
_Eg :_ 
/ws/v2/timeline/users/admin/clusters/yarn_cluster/flows/hive_flow/runs/123

* *Query flowruns*
*/ws/v2/timeline/users/\{userid}/clusters/\{clusterid}/flows/\{flowid}/runs*
_Eg :_ /ws/v2/timeline/users/admin/clusters/yarn_cluster/flows/hive_flow/runs

* *Query app*
*/ws/v2/timeline/clusters/\{clusterid}/apps/\{appid}*
_Eg :_ /ws/v2/timeline/clusters/yarn_cluster/apps/application_1111111111_1345

* *Query apps for a flow*
*/ws/v2/timeline/users/\{userid}/clusters/\{clusterid}/flows/\{flowid}/apps*
_Eg :_ /ws/v2/timeline/users/admin/clusters/yarn_cluster/flows/hive_flow/apps

* *Query apps for a flowrun*
*/ws/v2/timeline/users/\{userid}/clusters/\{clusterid}/flows/\{flowid}/runs/\{flowrunid}/apps*
_Eg :_ 
/ws/v2/timeline/users/admin/clusters/yarn_cluster/flows/hive_flow/runs/123/apps

* *Query entity*
*/ws/v2/timeline/users/\{userid}/clusters/\{clusterid}/apps/\{appid}/entities/\{entitytype}/\{entityid}*
_Eg :_ 
/ws/v2/timeline/users/admin/clusters/yarn_cluster/apps/application_1444034548255_0001/entities/YARN_CONTAINER/container_1444034548255_0001_01_000001

* *Query entities*
*/ws/v2/timeline/users/\{userid}/clusters/\{clusterid}/apps/\{appid}/entities/\{entitytype}*
_Eg :_ 
/ws/v2/timeline/users/admin/clusters/yarn_cluster/apps/application_1444034548255_0001/entities/YARN_CONTAINER
{panel}

So if we want brevity we can go with first approach. 
If we want to have it same way as it already exists in AHS, we can go with 
second approach. This would mean URLs' will be similar to what users are 
currently using.
Everyone can give their opinion on this one.

Also I think we should put cluster before user in REST URL(currently user comes 
before cluster). 

> Change the ATSv2 reader side REST interface to conform to current REST APIs' 
> in YARN
> ------------------------------------------------------------------------------------
>
>                 Key: YARN-4224
>                 URL: https://issues.apache.org/jira/browse/YARN-4224
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>         Attachments: YARN-4224-YARN-2928.01.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to