使用 JClouds 通过 S3 API 与非 AWS 云对话
我正在尝试使用 JClouds 与仅公开 S3 API 的 OpenStack/swift 存储云安装进行通信(它不支持 swift/rackspace API)。
我尝试过:
Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_ENDPOINT, CLOUD_SERVIE_ENDPOINT);
// get a context with nova that offers the portable ComputeService api
BlobStoreContext context = new BlobStoreContextFactory().createContext("aws-s3", ident,
password, ImmutableSet.<Module> of(), overrides);
服务器回复身份验证错误403。使用标准AWS sdk或python boto工作正常,所以这不是服务器问题,但很可能是jclouds的错误使用。
I'm trying to use JClouds to talk to an OpenStack / swift storage cloud installation that only exposes a S3 API (it does not support the swift / rackspace API).
I tried:
Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_ENDPOINT, CLOUD_SERVIE_ENDPOINT);
// get a context with nova that offers the portable ComputeService api
BlobStoreContext context = new BlobStoreContextFactory().createContext("aws-s3", ident,
password, ImmutableSet.<Module> of(), overrides);
The server replies with an authentication error 403. Using the standard AWS sdk or python boto works fine, so it's not a server problem, but most likely incorrect use of jclouds.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jclouds 事实上支持swift,所以你不需要做任何特殊的事情。我建议使用 jclouds 1.3.1,并配置依赖项
org.jclouds.api/swift
然后,您只需输入端点、身份、凭证
jclouds in fact supports swift, so you don't need to do anything special. I'd recommend using jclouds 1.3.1, and configure the dependency
org.jclouds.api/swift
Then, you just need to enter you endpoint, identity, credential
以下内容应该适合您。例如,已知它可以在 vBlob 上运行。
如果您的克隆不接受根 URL 处的 s3 请求,则需要相应地设置另一个参数。
The following should work for you. It is known to work on vBlob, for example.
If your clone doesn't accept s3 requests at the root url, you'll need to set another parameter accordingly.