jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jai M <jaiganes...@gmail.com>
Subject Re: SoftLayer + Swift question
Date Sun, 19 Oct 2014 15:08:56 GMT
Hi Andrea,

   The below are my dependencies.


 <jcloudsVersion>1.8.0</jcloudsVersion>
.
.
.
        <dependency>
            <groupId>org.apache.jclouds</groupId>
            <artifactId>jclouds-all</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.driver</groupId>
            <artifactId>jclouds-enterprise</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.driver</groupId>
            <artifactId>jclouds-slf4j</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.driver</groupId>
            <artifactId>jclouds-sshj</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${jodaTimeVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.driver</groupId>
            <artifactId>jclouds-jsch</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.labs</groupId>
            <artifactId>openstack-swift</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.jclouds.labs</groupId>
            <artifactId>openstack-glance</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.labs</groupId>
            <artifactId>openstack-marconi</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jclouds.labs</groupId>
            <artifactId>openstack-neutron</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>



Also after your email , I checked and found another dependency
<dependency>
            <groupId>org.apache.jclouds.api</groupId>
            <artifactId>swift</artifactId>
            <version>${jcloudsVersion}</version>
        </dependency>

Even after adding this, I get the same error. Do I need to modify the code
for the above dependency. If yes, is there a snippet for the same ?

Thanks
Jai



On Sun, Oct 19, 2014 at 6:57 AM, Andrea Turli <andrea.turli@gmail.com>
wrote:

> Hi,
>
> I think you have not all the needed jclouds jars on your classpath. Could
> you share the dependencies section of your downstream project?
>
> Best,
> Andrea
> Il 17/ott/2014 23:26 "Jai M" <jaiganesh.m@gmail.com> ha scritto:
>
> Hi Andrea,
>>
>>      With "swift" as the provider, I am getting the below error. (I am on
>> 1.8.0).
>> com.google.inject.ConfigurationException: Guice configuration errors:
>>
>> 1) No implementation for org.jclouds.openstack.swift.v1.SwiftApi was
>> bound.
>>   while locating org.jclouds.openstack.swift.v1.SwiftApi
>>
>> 1 error
>>     at
>> com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
>>     at
>> com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1009)
>>     at org.jclouds.ContextBuilder.buildApi(ContextBuilder.java:655)
>>     at org.jclouds.ContextBuilder.buildApi(ContextBuilder.java:647)
>>
>> Rgds
>> Jai
>>
>> On Fri, Oct 17, 2014 at 2:04 PM, Andrea Turli <andrea.turli@gmail.com>
>> wrote:
>>
>>> Try with the following
>>>
>>> String provider = "swift";
>>>     SwiftApi swiftApi = ContextBuilder.newBuilder(provider)
>>>               .endpoint("
>>> https://dal05.objectstorage.softlayer.net/auth/v1.0")
>>>               .credentials("TENANT_NAME:USER_NAME", "API_KEY")
>>>               .modules(modules)
>>>               .buildApi(SwiftApi.class);
>>>     ContainerApi containerApi =
>>> swiftApi.getContainerApiForRegion("dal05");
>>>         Set<Container> containers = containerApi.list().toSet();
>>>
>>> On Fri, Oct 17, 2014 at 8:28 PM, Jai M <jaiganesh.m@gmail.com> wrote:
>>> > Hi Andrea,
>>> >
>>> >   I am using the following code snippet
>>> > String provider = "openstack-swift";
>>> >     SwiftApi swiftApi = ContextBuilder.newBuilder(provider)
>>> >
>>> > .endpoint("https://dal05.objectstorage.softlayer.net/auth/v1.0")
>>> >               .credentials("TENANT_NAME:USER_NAME", "API_KEY")
>>> >               .modules(modules)
>>> >               .buildApi(SwiftApi.class);
>>> >     ContainerApi containerApi =
>>> swiftApi.getContainerApiForRegion("dal05");
>>> >         Set<Container> containers = containerApi.list().toSet();
>>> >
>>> > When I try this, I get the below exception
>>> >
>>> >
>>> > 2014-10-17 09:59:19,302 [main] DEBUG SLF4JLogger Receiving response
>>> > -2004695267: HTTP/1.1 400 Bad Request
>>> > 2014-10-17 09:59:19,308 DEBUG [jclouds.wire] [main] << "<html><h1>Bad
>>> > Request</h1><p>The server could not comply with the request
since it is
>>> > either malformed or otherwise incorrect.</p></html>"
>>> > 2014-10-17 09:59:19,308 [main] DEBUG SLF4JLogger << "<html><h1>Bad
>>> > Request</h1><p>The server could not comply with the request
since it is
>>> > either malformed or otherwise incorrect.</p></html>"
>>> > org.jclouds.http.HttpResponseException: command: POST
>>> > https://dal05.objectstorage.softlayer.net/auth/v1.0/tokens HTTP/1.1
>>> failed
>>> > with response: HTTP/1.1 400 Bad Request; content: [<html><h1>Bad
>>> > Request</h1><p>The server could not comply with the request
since it is
>>> > either malformed or otherwise incorrect.</p></html>]
>>> >     at
>>> >
>>> org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler.handleError(SwiftErrorHandler.java:46)
>>> >     at
>>> >
>>> org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
>>> >     at
>>> >
>>> org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:135)
>>> >     at
>>> >
>>> org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:105)
>>> >     at
>>> >
>>> org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
>>> >     at
>>> >
>>> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
>>> >     at
>>> >
>>> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
>>> >     at
>>> >
>>> org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
>>> >     at
>>> >
>>> org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
>>> >     at
>>> >
>>> com.sun.proxy.$Proxy100.authenticateWithTenantNameAndCredentials(Unknown
>>> > Source)
>>> >     at
>>> >
>>> org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:43)
>>> >     at
>>> >
>>> org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:31)
>>> >     at
>>> >
>>> org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:79)
>>> >     at
>>> >
>>> org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:36)
>>> >
>>> >
>>> > In the wire logs, I see it is a POST request with the following payload
>>> > "{"auth":{"
>>> >
>>> passwordCredentials":{"username":"USERID","password":"API_KEY"},"tenantName":"ACC-278436-15"}}"
>>> >
>>> > However the actual api call should be a get with AUTH headers.
>>> >
>>> > Thanks
>>> > Jai
>>> >
>>> > On Fri, Oct 17, 2014 at 11:49 AM, Andrea Turli <andrea.turli@gmail.com
>>> >
>>> > wrote:
>>> >>
>>> >> Hi Jai,
>>> >>
>>> >> please try with
>>> >>
>>> >> identity=tenantname:user
>>> >> credential=api_key
>>> >>
>>> >> Notice, you'll probably need to point at something like
>>> >>
>>> >> https://<locationId>.objectstorage.softlayer.net/auth/v1.0
>>> >>
>>> >> where locationId is something like `ams01` or `dal01`
>>> >>
>>> >> Best,
>>> >> Andrea
>>> >>
>>> >> On Fri, Oct 17, 2014 at 4:30 PM, Jai M <jaiganesh.m@gmail.com>
wrote:
>>> >> > I am using the openstack-swift api to interact with SoftLayer Object
>>> >> > storage. However the authentication is failing.
>>> >> >
>>> >> > I see the payload for the POST request to get the token is in the
>>> below
>>> >> > format
>>> >> >
>>> >> >
>>> >> >
>>> "{"auth":{"passwordCredentials":{"username":"USERID","password":"API_KEY"},"tenantName":"ACC-278436-15"}}"
>>> >> >
>>> >> > This does not work for SL. The SL spec requires it to be a GET
with
>>> >> > headers
>>> >> >
>>> >> > "X-Auth-User: ACC-278436-15:USERID"
>>> >> > "X-Auth-Key: API_KEY"
>>> >> >
>>> >> > Is there a way I can switch/plugin a different authentication
>>> mechanism
>>> >> > for
>>> >> > SoftLayer or should I use the blobstore api directly instead of
>>> swift
>>> >> > api ?
>>> >> >
>>> >> > Let me know.
>>> >> >
>>> >> > Rgds
>>> >> > Jai
>>> >> >
>>> >> >
>>> >
>>> >
>>>
>>
>>

Mime
View raw message