Pour cela, il suffit de fournir 3 informations de configuration, à savoir :
- Custom Authentification Server (https),
- Username,
- API Key,
- endpoint (Keystone via la release Diablo),
- l'identifiant du compte utilisateur de l'environnement OpenStack utilisé,
- l'authentifiant du compte utilisateur.
11-27 16:56:06.816 I/am crash( 93): [27427.com.rackspace.cloud.android,48708,java.lang.NullPointerException, An error occured while executing doInBackground(), Authentication.java,36] 11-27 16:56:06.816 I/am_finish_activity( 93):[1181044792,67,com.rackspace.cloud.android/,ListAccountsActivity,crashed] 11-27 16:56:06.816 I/am_on_pause_called( 93):[1181044792,67,com.rackspace.cloud.android/,ListAccountsActivity,crashed] |
Le code (file: Authentication.java) est le suivant :
/** * */ package com.rackspace.cloud.servers.api.client.http; import java.io.IOException; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import android.content.Context; import android.util.Log; import com.rackspace.cloud.files.api.client.CustomHttpClient; import com.rackspace.cloud.servers.api.client.Account; /** * @author Mike Mayo - mike.mayo@rackspace.com - twitter.com/greenisus * */ public class Authentication { public static boolean authenticate(Context context) { CustomHttpClient httpclient = new CustomHttpClient(context); HttpGet get = new HttpGet(Account.getAccount().getAuthServer()); get.addHeader("X-Auth-User", Account.getAccount().getUsername()); get.addHeader("X-Auth-Key", Account.getAccount().getApiKey()); try { HttpResponse resp = httpclient.execute(get); if (resp.getStatusLine().getStatusCode() == 204) { Account.getAccount().setAuthToken(resp.getFirstHeader("X-Auth-Token").getValue()); Account.getAccount().setServerUrl(resp.getFirstHeader("X-Server-Management-Url").getValue()); Account.getAccount().setStorageUrl(resp.getFirstHeader("X-Storage-Url").getValue()); // line 35&36 Account.getAccount().setStorageToken(resp.getFirstHeader("X-Storage-Token").getValue()); Account.getAccount().setCdnManagementUrl(resp.getFirstHeader("X-Cdn-Management-Url").getValue()); return true; } else { Log.d("status code", Integer.toString(resp.getStatusLine().getStatusCode())); return false; } } catch (ClientProtocolException cpe) { return false; } catch (IOException e) { Log.v("info", e.toString()); return false; } } } |
A la lecture du code autour de la ligne 36, il semble à premier abord qu'il y ait conformité avec KeyStone (Identity) par le retour d'un jeton de session et les endpoints des services OpenStack disponibles. Ceci étant, il parait bizarre qu'il y ait un token spécifique pour Swift. En conséquence, il semble que l'information retournée pour Swift pose problème. Voici le retour à l'aide du plugin ClientREST sous Firefox.
A suivre...
Après avoir envoyé un mail au support Rackspace, ce dernier m'a répondu sous 24h en me signalant de rentrer un ticket au support. Pour ce faire, il faut être enregistré chez Rackspace. Comme je dispose d'un compte chez eux, j'ai créé le Ticket #254713. A suivre...
RépondreSupprimerRetour, 03/12/2011 12:26
RépondreSupprimerHello Laurent,
We are very sorry to inform you but, we do not provide support for open stack in cloud servers and since it is not a product of cloud servers we cannot troubleshoot this and you would need to contact openstack for support in regards to this issue.
openstack.org
Again we apologise for the inconvenience and not responding to this sooner to inform you it is beyond our capability to resolve this as it is not our product.
Warmest Regards,
Joshua Warrick
Linux Sys Admin I
Cloud Servers
Avant d'avoir contacté le support RackSpace, j'avais envoyé un mail au développeur du code (Mike Mayo). Celui-ci vient de me répondre et cela confirme, ce que je pensais. Le code Android n'est pas actuellement en conformité avec la nouvelle API s'appuyant sur KeyStone de la release Diablo, mais cela devrait être OK (à vérifier) pour la release Cactus.
RépondreSupprimerHi!
I'm sorry I took so long to get back to you. I've been pretty buried in email these days. Right now the Android app only supports the 1.0 API authentication style, but there is work going on right now to support 1.1/Keystone. The next release of the app should solve your issues. If it doesn't, please let me know and I'll try to help out in any way I can.
Mike Mayo
Dans la foulée, le retour du support RackSpace (qui botte un peu en touche) est le suivant, mais confirme les propos de Mike.
RépondreSupprimerThe code is maintained here: https://github.com/rackspace/android-rackspacecloud
But as indicated, the application is designed solely for Rackspace Cloud and not Openstack. Rackspace Cloud Servers doesn't use Nova or Glance yet and nothing is running Keystone. So it's very unlikely to get with app working on OpenStack currently.
Feel free to reopen this ticket if you have any further questions.