jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yao, Julie" <julie....@hpe.com>
Subject RE: Use JClouds to talk to non AWS cloud with S3 API
Date Sat, 30 Jan 2016 00:41:23 GMT
I tried S3Client and the result is still wrong.
Code:
	BlobStoreContext context = ContextBuilder.newBuilder(new S3ApiMetadata())
                .endpoint("http://myserver:8080/services/Walrus")
                .credentials(username, password)
                .overrides(overrides)
                .modules(modules)
                .buildView(BlobStoreContext.class);
       BlobStore blobStore = context.getBlobStore();
        String bucket="public";
        boolean exist = blobStore.containerExists(bucket);
        
        System.out.println("bucket "+ bucket + " exist  "+exist);
 
         bucket="julie";
         blobStore.createContainerInLocation(null, bucket);
         exist = blobStore.containerExists(bucket);

I attach log here.
Thanks!
-----Original Message-----
From: Andrew Phillips [mailto:andrewp@apache.org] 
Sent: Friday, January 29, 2016 3:23 PM
To: user@jclouds.apache.org
Cc: Yao, Julie
Subject: RE: Use JClouds to talk to non AWS cloud with S3 API

> but the result is wrong.

Ah, pity :-( Caught celebrating too soon ;-) One of the things that may be worth trying here
is to move away from the portably blobstore abstraction and try the API directly - that's
more comparable to the boto calls.

...
S3Client client = ContextBuilder.newBuilder(new S3ApiMetadata())
                     .endpoint("http://myserver:8080/services/Walrus")
                     .credentials(username, password)
                     .overrides(overrides)
                     .buildApi(S3Client.class);

client.putObject(...)

See
https://jclouds.apache.org/reference/javadoc/1.9.x/index.html?org/jclouds/s3/S3Client.html.

If that works, then we can hopefully more easily get back to the blobstore abstraction to
see why that is not working.

Also, please record the wire and header logs so we can see what HTTP calls exactly are being
made [1].

Regards

ap

[1] https://jclouds.apache.org/reference/logging/

Mime
View raw message