You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Steve Kingsland <st...@opower.com> on 2014/08/12 02:19:56 UTC

How to configure Jclouds S3 API to put the container name *after* the hostname?

I'm trying to use jclouds' S3 API to connect to an internally-hosted Ceph
server, which exposes an S3-compliant API. Use other (ruby and perl)
clients, I've noticed that my requests work fine when I put the
container/bucket name *after* the hostname, like this:

https://opower.internal/*mybucket/*?acl

However, jclouds is putting the container name *in the hostname* (S3 calls
this a "virtual bucket"), like so:

https://*mybucket.*opower.internal/?acl

And that's failing with an "AccessDenied" error that I haven't figured out
yet, but am still working on. In the mean time, is there a way to configure
jclouds to put the container name *after* the host name, in the request?


*Steve Kingsland*

Senior Software Engineer

* Opower * <http://www.opower.com/>


* We’re hiring! See jobs here <http://www.opower.com/careers> *

Re: How to configure Jclouds S3 API to put the container name *after* the hostname?

Posted by Steve Kingsland <st...@opower.com>.
Unfortunately I'm stuck on 1.6.3.

1.7.x depends on Guava 15.0 and is incompatible with 14.0 (see
JCLOUDS-427), but I have to use Guava 14.0 because the version of HBase my
company uses (0.94.6) depends on a Guava class that was removed in 15.0.

And yes, I'm using the "s3" provider/API string. So far so good, my test of
writing to Ceph was successful!

Thanks for your help!



*Steve Kingsland*

Senior Software Engineer

*Opower * <http://www.opower.com/>


*We’re hiring! See jobs here <http://www.opower.com/careers> *


On Mon, Aug 11, 2014 at 8:26 PM, Andrew Gaul <ga...@apache.org> wrote:

> On Mon, Aug 11, 2014 at 08:19:56PM -0400, Steve Kingsland wrote:
> > I'm trying to use jclouds' S3 API to connect to an internally-hosted Ceph
> > server, which exposes an S3-compliant API. Use other (ruby and perl)
> > clients, I've noticed that my requests work fine when I put the
> > container/bucket name *after* the hostname, like this:
> >
> > https://opower.internal/*mybucket/*?acl
> >
> > However, jclouds is putting the container name *in the hostname* (S3
> calls
> > this a "virtual bucket"), like so:
> >
> > https://*mybucket.*opower.internal/?acl
> >
> > And that's failing with an "AccessDenied" error that I haven't figured
> out
> > yet, but am still working on. In the mean time, is there a way to
> configure
> > jclouds to put the container name *after* the host name, in the request?
>
> Which version of jclouds do you use?  jclouds 1.7.0 should have resolved
> this issue:
>
> https://issues.apache.org/jira/browse/JCLOUDS-305
>
> If you use 1.7.0 or newer, can you share the failing operations with
> wire logs?  Also make sure you use the generic "s3" provider and not the
> "aws-s3" specific provider.
>
> --
> Andrew Gaul
> http://gaul.org/
>

Re: How to configure Jclouds S3 API to put the container name *after* the hostname?

Posted by Andrew Gaul <ga...@apache.org>.
On Mon, Aug 11, 2014 at 08:19:56PM -0400, Steve Kingsland wrote:
> I'm trying to use jclouds' S3 API to connect to an internally-hosted Ceph
> server, which exposes an S3-compliant API. Use other (ruby and perl)
> clients, I've noticed that my requests work fine when I put the
> container/bucket name *after* the hostname, like this:
> 
> https://opower.internal/*mybucket/*?acl
> 
> However, jclouds is putting the container name *in the hostname* (S3 calls
> this a "virtual bucket"), like so:
> 
> https://*mybucket.*opower.internal/?acl
> 
> And that's failing with an "AccessDenied" error that I haven't figured out
> yet, but am still working on. In the mean time, is there a way to configure
> jclouds to put the container name *after* the host name, in the request?

Which version of jclouds do you use?  jclouds 1.7.0 should have resolved
this issue:

https://issues.apache.org/jira/browse/JCLOUDS-305

If you use 1.7.0 or newer, can you share the failing operations with
wire logs?  Also make sure you use the generic "s3" provider and not the
"aws-s3" specific provider.

-- 
Andrew Gaul
http://gaul.org/

Re: How to configure Jclouds S3 API to put the container name *after* the hostname?

Posted by Steve Kingsland <st...@opower.com>.
Thanks Niraj, this fixed my problem! I had looked in the
org.jclouds.Constants interface for this exact property, but it makes sense
that it would be in the S3Constants interface instead, since virtual host
buckets are an S3-specific thing.

Just out of curiosity, is this property documented anywhere online, that I
should have found in my search? (Even the interface doesn't have javadoc
comments on this property, explaining its purpose.)



*Steve Kingsland*

Senior Software Engineer

*Opower * <http://www.opower.com/>


*We’re hiring! See jobs here <http://www.opower.com/careers> *


On Mon, Aug 11, 2014 at 8:21 PM, Niraj Tolia <nt...@maginatics.com> wrote:

> The virtual hosts property is your friend here. Just use
> -Djclouds.s3.virtual-host-buckets=false on the command line or the
> equivalent in your code.
>
> Cheers,
> Niraj
>
> On Mon, Aug 11, 2014 at 5:19 PM, Steve Kingsland
> <st...@opower.com> wrote:
> > I'm trying to use jclouds' S3 API to connect to an internally-hosted Ceph
> > server, which exposes an S3-compliant API. Use other (ruby and perl)
> > clients, I've noticed that my requests work fine when I put the
> > container/bucket name after the hostname, like this:
> >
> > https://opower.internal/mybucket/?acl
> >
> > However, jclouds is putting the container name in the hostname (S3 calls
> > this a "virtual bucket"), like so:
> >
> > https://mybucket.opower.internal/?acl
> >
> > And that's failing with an "AccessDenied" error that I haven't figured
> out
> > yet, but am still working on. In the mean time, is there a way to
> configure
> > jclouds to put the container name *after* the host name, in the request?
> >
> >
> > Steve Kingsland
> >
> >
> > Senior Software Engineer
> >
> > Opower
> >
> >
> > We’re hiring! See jobs here
>

Re: How to configure Jclouds S3 API to put the container name *after* the hostname?

Posted by Niraj Tolia <nt...@maginatics.com>.
The virtual hosts property is your friend here. Just use
-Djclouds.s3.virtual-host-buckets=false on the command line or the
equivalent in your code.

Cheers,
Niraj

On Mon, Aug 11, 2014 at 5:19 PM, Steve Kingsland
<st...@opower.com> wrote:
> I'm trying to use jclouds' S3 API to connect to an internally-hosted Ceph
> server, which exposes an S3-compliant API. Use other (ruby and perl)
> clients, I've noticed that my requests work fine when I put the
> container/bucket name after the hostname, like this:
>
> https://opower.internal/mybucket/?acl
>
> However, jclouds is putting the container name in the hostname (S3 calls
> this a "virtual bucket"), like so:
>
> https://mybucket.opower.internal/?acl
>
> And that's failing with an "AccessDenied" error that I haven't figured out
> yet, but am still working on. In the mean time, is there a way to configure
> jclouds to put the container name *after* the host name, in the request?
>
>
> Steve Kingsland
>
>
> Senior Software Engineer
>
> Opower
>
>
> We’re hiring! See jobs here