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

Pierre Beauvois commented on KNOX-1031:
---------------------------------------

I did a first version of this service. I checked several requests and it was 
OK. More check would be nice.

Topology:
{code:html}
    <service>
        <role>TIMELINE</role> <!-- timeline -->
        <url>http://mapr-ha-node-01.bigdata.kvm:8188/ws</url>
    </service>
{code}

timeline rewrite.xml:
{code:html}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules>
    <rule dir="IN" name="TIMELINE/timeline/inbound/timeline/root" 
pattern="*://*:*/**/timeline/v1/timeline">
        <rewrite template="{$serviceMappedUrl[TIMELINE]}/v1/timeline"/>
    </rule>

    <rule dir="IN" name="TIMELINE/timeline/inbound/timeline/path" 
pattern="*://*:*/**/timeline/v1/timeline/{**}">
        <rewrite template="{$serviceMappedUrl[TIMELINE]}/v1/timeline/{**}"/>
    </rule>

    <rule dir="IN" name="TIMELINE/timeline/inbound/timeline/domain" 
pattern="*://*:*/**/timeline/v1/timeline/{**}?{**}">
        <rewrite 
template="{$serviceMappedUrl[TIMELINE]}/v1/timeline/{**}?{**}"/>
    </rule>

    <rule dir="IN" name="TIMELINE/timeline/inbound/applicationhistory/root" 
pattern="*://*:*/**/timeline/v1/applicationhistory">
        <rewrite 
template="{$serviceMappedUrl[TIMELINE]}/v1/applicationhistory"/>
    </rule>

    <rule dir="IN" name="TIMELINE/timeline/inbound/applicationhistory/path" 
pattern="*://*:*/**/timeline/v1/applicationhistory/{**}">
        <rewrite 
template="{$serviceMappedUrl[TIMELINE]}/v1/applicationhistory/{**}"/>
    </rule>

    <rule dir="IN" name="TIMELINE/timeline/inbound/applicationhistory/domain" 
pattern="*://*:*/**/timeline/v1/applicationhistory/{**}?{**}">
        <rewrite 
template="{$serviceMappedUrl[TIMELINE]}/v1/applicationhistory/{**}?{**}"/>
    </rule>

</rules>
{code}
 
timeline service.xml

{code:html}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<service role="TIMELINE" name="timeline" version="2.7.0">
    <routes>
       <route path="/timeline/v1/timeline/"/>
       <route path="/timeline/v1/timeline/**"/>
       <route path="/timeline/v1/timeline/**?**"/>
       <route path="/timeline/v1/applicationhistory/"/>
       <route path="/timeline/v1/applicationhistory/**"/>
       <route path="/timeline/v1/applicationhistory/**?**"/>
       <!--<route 
path="/timeline/v1/applicationhistory/apps/*/appattempts/**"/>-->
    </routes>
    <testURLs>
        <testURL>/timeline/v1/timeline</testURL>
    </testURLs>
</service>
{code}


> Apache Hadoop Timeline Server REST API support
> ----------------------------------------------
>
>                 Key: KNOX-1031
>                 URL: https://issues.apache.org/jira/browse/KNOX-1031
>             Project: Apache Knox
>          Issue Type: New Feature
>          Components: Server
>    Affects Versions: 0.13.0
>         Environment: Apache Hadoop clusters, HortonWorks clusters, Cloudera 
> clusters, MapR clusters
>            Reporter: Pierre Beauvois
>             Fix For: 0.14.0
>
>
> Timeline Server REST API as documented here: [Timeline Server REST 
> API|https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1]
> The TLS REST API provides a RESTful interface to a Timeline Server. It makes 
> it easy to produce and consume messages, view the state of the cluster, and 
> perform administrative actions
> This feature allow to call Timeline Server REST API through Knox. It could be 
> enabled in your topology by adding the following sample:
> {code:java}
>     <service>
>         <role>TIMELINESERVER</role>
>         <url>http://{timelineserver-host}:{timelineserver-port}</url>
>     </service>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to