Hi,

As part of some client work I'm trying to add a service to a Knox topology
in the Hortonworks HDP 2.3.1 sandbox; this includes Knox 0.6.0. My
understanding is that I simply need to add the <service> to the topology
XML and then create directories under <knox home>/data/services with new
service and rewrite XML files.

In this test case the REST service is a similar demo app running on port
8095. I've created the service and rewrite XMLs as before yet the gateway
is throwing a 404 when I try and access the API from outside the sandbox.
The usual calls to WebHDFS through the gateway still work.  My demo REST
service is running and can be accessed through curl on the inside of the
gateway.

I've added the following to the default.xml topology (and also
knox-sample.xml, another topology in the HDP sandbox)
<service>
        <role>HELLO</role>
        <url>http://sandbox.hortonworks.com:8095/greeting</url>
</service>

This is my service.xml in data/services/hello/0.0.1
<service role="HELLO" name="hello" version="0.0.1">
    <routes>
        <route path="/greeting/v1/?**">
            <rewrite apply="HELLO/greeting/inbound/root" to="request.url"/>
        </route>
    </routes>
</service>

And finally this is my rewrite.xml
<rules>
    <rule dir="IN" name="HELLO/greeting/inbound/root"
pattern="*://*:*/**/greeting/v1/?{**}">
        <rewrite template="{$serviceUrl[HELLO]}?/v1/{**}"/>
    </rule>
</rules>

Am I missing anything in terms of configuration? I must confess I'm not
sure what's going on in rewrite.xml and struggle to get much out of the
documentation.

Best Regards,
Adam

-- 
 

*NOTICE AND DISCLAIMER*

This email (including attachments) is confidential. If you are not the 
intended recipient, notify the sender immediately, delete this email from 
your system and do not disclose or use for any purpose.

Business Address: Eagle House, 163 City Road, London, EC1V 1NR. United 
Kingdom
Registered Office: Finsgate, 5-7 Cranwood Street, London, EC1V 9EE. United 
Kingdom
Big Data Partnership Limited is a company registered in England & Wales 
with Company No 7904824

Reply via email to