Expose (temporarily) the session ids.

This commit is contained in:
Julien Fontanet 2013-07-26 15:04:31 +02:00
parent f619d3f9a7
commit 53af1f5fdd
2 changed files with 15 additions and 0 deletions

View File

@ -534,6 +534,18 @@ Api.fn.xo = {
};
});
},
'getSessionId': function (req) {
var p_pool_id = req.params.id;
if (undefined === p_pool_id)
{
throw Api.err.INVALID_PARAMS;
}
return this.xo.pools.first(p_pool_id).then(function (pool) {
return pool.get('sessionId');
});
},
};
Api.fn.host = {

View File

@ -353,6 +353,9 @@ Xo.prototype.start = function () {
pools = _.values(pools);
var pool_uuid = pools[0].id = pools[0].uuid;
// @todo Remove: security concerns.
pools[0].sessionId = xapi.sessionId;
var resolve = function (model, collection, props, include) {
/* jshint laxbreak: true */