[Openstack] Fwd: Question about cloudfiles API

Luis Gervaso luis at woorea.es
Wed May 30 22:02:32 UTC 2012


Hi Shawn,

I discovered in your code:

1)

properties.put("identity.endp
>
> oint.publicURL",
>        "http:/testb.REDACTED.com:8080/v2.0");


here you are using only one slash "http:/". So it's not valid URL.

2) actually "testb.REDACTED.com:8080/v2.0" is your identity endpoint?

Keystone usually listen on 5000 or 35357

At the end of this mail you have a complete log from OpenStack Java SDK
talking Swift running on Folsom. Actually it's tested on HPCloud (Diablo)
and DevStack (stable/essex) as well.

3) Thanks, you discovered a bug. The code was trying to authenticate with
duplicate credentials. It was working but I have fixed! Already pushed on
github

Cheers!

---- TEST LOGS

May 30, 2012 11:50:38 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 1 * LoggingFilter - Request received on thread main
1 > POST http://192.168.1.43:5000/v2.0/tokens
1 > Accept: application/json
1 > Content-Type: application/json
{"auth":{"tenantName":"admin","passwordCredentials":{"username":"admin","password":"secret0"}}}

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 2 * LoggingFilter - Response received on thread main
2 < 200
2 < Vary: X-Auth-Token
2 < Date: Wed, 30 May 2012 21:50:39 GMT
2 < Content-Length: 2541
2 < Content-Type: application/json
2 < Connection: keep-alive
{"access": {"token": {"expires": "2012-05-31T21:50:39Z", "id":
"cedec9abd4c249479181c2c6d9c0ad85", "tenant": {"enabled": true, "id":
"1e9c9a2fe2454950a900202b1e82b54f", "name": "admin", "description": null}},
"serviceCatalog": [{"endpoints": [{"adminURL": "
http://192.168.1.43:8774/v2/1e9c9a2fe2454950a900202b1e82b54f", "region":
"RegionOne", "publicURL": "
http://192.168.1.43:8774/v2/1e9c9a2fe2454950a900202b1e82b54f",
"internalURL": "http://192.168.1.43:8774/v2/1e9c9a2fe2454950a900202b1e82b54f"}],
"endpoints_links": [], "type": "compute", "name": "Compute Service"},
{"endpoints": [{"adminURL": "http://192.168.1.43:8080", "region":
"RegionOne", "publicURL": "http://192.168.1.43:8080", "internalURL": "
http://192.168.1.43:8080"}], "endpoints_links": [], "type": "s3", "name":
"S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.43:9292",
"region": "RegionOne", "publicURL": "http://192.168.1.43:9292",
"internalURL": "http://192.168.1.43:9292"}], "endpoints_links": [], "type":
"image", "name": "Image Service"}, {"endpoints": [{"adminURL": "
http://192.168.1.43:8776/v1/1e9c9a2fe2454950a900202b1e82b54f", "region":
"RegionOne", "publicURL": "
http://192.168.1.43:8776/v1/1e9c9a2fe2454950a900202b1e82b54f",
"internalURL": "http://192.168.1.43:8776/v1/1e9c9a2fe2454950a900202b1e82b54f"}],
"endpoints_links": [], "type": "volume", "name": "Volume Service"},
{"endpoints": [{"adminURL": "http://192.168.1.43:8773/services/Admin",
"region": "RegionOne", "publicURL": "http://192.168.1.43:8773/services/Cloud",
"internalURL": "http://192.168.1.43:8773/services/Cloud"}],
"endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints":
[{"adminURL": "http://192.168.1.43:8080/", "region": "RegionOne",
"publicURL": "
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f",
"internalURL": "
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f"}],
"endpoints_links": [], "type": "object-store", "name": "Swift Service"},
{"endpoints": [{"adminURL": "http://192.168.1.43:35357/v2.0", "region":
"RegionOne", "publicURL": "http://192.168.1.43:5000/v2.0", "internalURL": "
http://192.168.1.43:5000/v2.0"}], "endpoints_links": [], "type":
"identity", "name": "Identity Service"}], "user": {"username": "admin",
"roles_links": [], "id": "e357f1b90efb4196af7d375ff7af21c6", "roles":
[{"id": "5f9c2353722741c58bc3c09dfeb32759", "name": "KeystoneAdmin"},
{"id": "bf2e2b36928e42eb8ed977ba8b470e77", "name": "admin"}, {"id":
"b6b1b22f0fc640dab1958d8eb977625b", "name": "KeystoneServiceAdmin"}],
"name": "admin"}}}

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 1 * LoggingFilter - Request received on thread main
1 > PUT
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container
1 > Accept: application/json
1 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 2 * LoggingFilter - Response received on thread main
2 < 201
2 < Date: Wed, 30 May 2012 21:50:39 GMT
2 < Content-Length: 18
2 < Content-Type: text/html; charset=UTF-8
2 < Connection: keep-alive
201 Created





May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 3 * LoggingFilter - Request received on thread main
3 > GET http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f
3 > Accept: application/json
3 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 4 * LoggingFilter - Response received on thread main
4 < 200
4 < X-Account-Object-Count: 0
4 < X-Account-Container-Count: 1
4 < Date: Wed, 30 May 2012 21:50:39 GMT
4 < Content-Length: 47
4 < X-Timestamp: 1338414639.80726
4 < X-Account-Bytes-Used: 0
4 < Accept-Ranges: bytes
4 < Content-Type: application/json; charset=utf-8
4 < Connection: keep-alive
[{"name":"test-container","count":0,"bytes":0}]

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 5 * LoggingFilter - Request received on thread main
5 > HEAD
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container
5 > Accept: application/json
5 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 6 * LoggingFilter - Response received on thread main
6 < 204
6 < X-Container-Object-Count: 0
6 < Date: Wed, 30 May 2012 21:50:40 GMT
6 < X-Container-Bytes-Used: 0
6 < Content-Length: 0
6 < X-Timestamp: 1338414639.82109
6 < Accept-Ranges: bytes
6 < Connection: keep-alive

May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 7 * LoggingFilter - Request received on thread main
7 > PUT
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container/test-object
7 > Accept: application/json
7 > Content-Length: 1024
7 > Content-Type: application/octet-stream
7 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85


May 30, 2012 11:50:39 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 8 * LoggingFilter - Response received on thread main
8 < 201
8 < Date: Wed, 30 May 2012 21:50:40 GMT
8 < Content-Length: 18
8 < Last-Modified: Wed, 30 May 2012 21:50:40 GMT
8 < Etag: 0f343b0931126a20f133d67c2b018a3b
8 < Content-Type: text/html; charset=UTF-8
8 < Connection: keep-alive
201 Created





May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 9 * LoggingFilter - Request received on thread main
9 > GET
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container
9 > Accept: application/json
9 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 10 * LoggingFilter - Response received on thread main
10 < 200
10 < X-Container-Object-Count: 1
10 < Date: Wed, 30 May 2012 21:50:40 GMT
10 < X-Container-Bytes-Used: 1024
10 < Content-Length: 167
10 < X-Timestamp: 1338414639.82830
10 < Accept-Ranges: bytes
10 < Content-Type: application/json; charset=utf-8
10 < Connection: keep-alive
[{"name":"test-object","hash":"0f343b0931126a20f133d67c2b018a3b","bytes":1024,"content_type":"application/octet-stream",
"last_modified":"2012-05-30T21:50:40.152250"}]

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 11 * LoggingFilter - Request received on thread main
11 > HEAD
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container/test-object
11 > Accept: application/json
11 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 12 * LoggingFilter - Response received on thread main
12 < 200
12 < Date: Wed, 30 May 2012 21:50:40 GMT
12 < Content-Length: 1024
12 < Last-Modified: Wed, 30 May 2012 21:50:40 GMT
12 < Etag: 0f343b0931126a20f133d67c2b018a3b
12 < X-Timestamp: 1338414640.15225
12 < Accept-Ranges: bytes
12 < Content-Type: application/octet-stream
12 < Connection: keep-alive

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 13 * LoggingFilter - Request received on thread main
13 > DELETE
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container/test-object
13 > Accept: */*
13 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 14 * LoggingFilter - Response received on thread main
14 < 204
14 < Date: Wed, 30 May 2012 21:50:40 GMT
14 < Content-Length: 0
14 < Content-Type: text/html; charset=UTF-8
14 < Connection: keep-alive

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 15 * LoggingFilter - Request received on thread main
15 > DELETE
http://192.168.1.43:8080/v1/AUTH_1e9c9a2fe2454950a900202b1e82b54f/test-container
15 > X-Auth-Token: cedec9abd4c249479181c2c6d9c0ad85

May 30, 2012 11:50:40 PM org.glassfish.jersey.filter.LoggingFilter log
INFO: 16 * LoggingFilter - Response received on thread main
16 < 204
16 < Date: Wed, 30 May 2012 21:50:40 GMT
16 < Content-Length: 0
16 < Content-Type: text/html; charset=UTF-8
16 < Connection: keep-alive








On Wed, May 30, 2012 at 9:16 PM, Shawn Heisey <launchpad at elyograg.org>wrote:

> On 5/29/2012 5:51 PM, Luis Gervaso wrote:
>
>> Good point,
>>
>> I'll prepare a benchmark
>>
>> Until RC3 you can build from source (2 steps)
>>
>> #git clone
>> #mvn clean install
>>
>
> As I mentioned in my last email, I am getting an exception, see that email
> for full exception details.  This is the code in my little application
> that's failing.  Originally I had /auth/v1.0 (from the swift howto) instead
> of /v2.0, but I can see in the openstack api docs that /v2.0 is a correct
> API URL, and the openstack sdk examples have /v2.0.
>
>    String username = "system:root";
>    String password = "testpass";
>    Properties properties = System.getProperties();
>    properties.put("verbose", "true");
>    // properties.put("auth.**credentials", "passwordCredentials");
>    properties.put("auth.username"**, username);
>    properties.put("auth.password"**, password);
>    // properties.put("auth.**tenantName", "demo");
>    properties.put("identity.**endpoint.publicURL",
>        "http:/testb.REDACTED.com:**8080/v2.0<http://testb.REDACTED.com:8080/v2.0>
> ");
>
>    OpenStackClient openstack = OpenStackClient
>        .authenticate(properties);
>
> Here are the jarfiles that I have placed in the classpath.  Some of these
> I was able to download, some of them had to come from my .m2 maven
> directory:
>
> asm-all-repackaged-2.0.3.jar
> auto-depends-2.0.3.jar
> commons-cli-1.2.jar
> commons-codec-1.6.jar
> commons-io-2.2.jar
> commons-lang-2.6.jar
> commons-logging-1.1.1.jar
> guava-12.0.jar
> hk2-api-2.0.3.jar
> jackson-core-asl-1.9.2.jar
> jackson-jaxrs-1.9.2.jar
> jackson-mapper-asl-1.9.2.jar
> jackson-xc-1.9.2.jar
> javax.inject-2.0.3.jar
> javax.ws.rs-api-2.0-m05.jar
> jersey-client-2.0-m04.jar
> jersey-common-2.0-m04.jar
> jersey-media-json-2.0-m04.jar
> mailapi.jar
> openstack-java-sdk-1.0-RC2.jar
> osgi-resource-locator-1.0.1.**jar
>
>
> Thanks,
> Shawn
>
>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/%7Eopenstack>
> Post to     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/%7Eopenstack>
> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>



-- 
-------------------------------------------
Luis Alberto Gervaso Martin
Woorea Solutions, S.L
CEO & CTO
mobile: (+34) 627983344
luis@ <luis.gervaso at gmail.com>woorea.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120531/f7794b5e/attachment.html>


More information about the Openstack mailing list