jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken <run2obt...@gmail.com>
Subject Re: Fwd: Delivery Status Notification (Failure)
Date Sat, 05 Nov 2016 16:47:13 GMT
Hi Andrew,

Thanks, sorry for the longer message before.
Here is a short code example, directly taken from the examples here.
<https://jclouds.apache.org/guides/openstack/>

.....
>
>    public Swifter() {
>       Iterable<Module> modules = ImmutableSet.<Module>of(
>             new SLF4JLoggingModule());
>
>       String provider = "openstack-swift";
>       String identity = "xx:xx";
>       String credential = "xxxx";
>
>       swiftApi = ContextBuilder.newBuilder(provider)
>             .endpoint("http://xx.xx.xx:50034/v2.0")
>             .credentials(identity, credential)
>             .modules(modules)
>             .buildApi(SwiftApi.class);
>    }
>
>    private void createContainer() {
>       System.out.println("Create Container");
>
>       ContainerApi containerApi = swiftApi.getContainerApi("RegionOne");
>       CreateContainerOptions options = CreateContainerOptions.Builder
>             .metadata(ImmutableMap.of(
>                   "key1", "value1",
>                   "key2", "value2"));
>
>       containerApi.create(CONTAINER_NAME, options);
>
>       System.out.println("  " + CONTAINER_NAME);
>    }
>
>    private void uploadObjectFromString() {
>       System.out.println("Upload Object From String");
>
>       ObjectApi objectApi = swiftApi.getObjectApi("RegionOne",
> CONTAINER_NAME);
>       Payload payload = newByteSourcePayload(wrap("Hello
> World".getBytes()));
>
>       objectApi.put(OBJECT_NAME, payload,
> PutOptions.Builder.metadata(ImmutableMap.of("key1", "value1")));
>
>       System.out.println("  " + OBJECT_NAME);
>    }
>
>
> }
>

On Sat, Nov 5, 2016 at 5:39 PM, Andrew Phillips <aphillips@qrmedia.com>
wrote:

> Hi Ken
>
> I want to use Jcloud swift and nova, the connection always time outs
>> after
>> successfully authenticating...
>>
>
> Could you provide a short code sample (with passwords etc. obfuscated) to
> help us understand how the connection is configured?
>
> Regards
>
> ap
>

Mime
View raw message