Hi Sumit and Kevin,

This is the command I'm using to access the demo REST app inside the
sandbox:
*curl 'http://localhost:8095/greeting <http://localhost:8095/greeting>'*
This returns a simple JSON response like *'{"id":1,"content":"Hello,
World!"}' . *BTW, it's the same app as described in a Spring Boot tutorial
here - https://spring.io/guides/gs/rest-service/

>From outside the sandbox I am using the following:
*curl -kv -u admin:admin-password
'https://127.0.0.1:8443/gateway/default/greeting/v1
<https://127.0.0.1:8443/gateway/default/greeting/v1>'*
Which is returning a 404. I have a version number in there as I was getting
null pointer exceptions when I left it out and assumed it was mandatory to
have some kind of versioning in the URL.

I can also run this WebHDFS command from outside the gateway:
'curl -k -u admin:admin-password*
'https://127.0.0.1:8443/gateway/default/webhdfs/v1?op=LISTSTATUS
<https://127.0.0.1:8443/gateway/default/webhdfs/v1?op=LISTSTATUS>'*
This gives the appropriate response.

Thanks for the quick follow-up, I also realise now this question may have
been better suited to the user mailing-list so apologies for that.

Best Regards,
Adam

On Mon, 16 Nov 2015 at 14:49 Sumit Gupta <[email protected]>
wrote:

> Hi Adam,
>
> Thanks for providing the the configuration and file contents. Can you also
> provide the exact URLs you are trying with the curl commands, both inside
> and outside the cluster?
>
> Thanks,
> Sumit
>
> On 11/16/15, 9:38 AM, "Adam Davidson"
> <[email protected]> wrote:
>
> >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
>
>

-- 
 

*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