@yawetse/pkgcloud
Version:
An infrastructure-as-a-service agnostic cloud library for node.js
36 lines (26 loc) • 885 B
JavaScript
/*
* client.js: Base client from which all Rackspace clients inherit from
*
* (C) 2011 Charlie Robbins, Ken Perkins, Ross Kukulinski & the Contributors.
*
*/
var util = require('util'),
identity = require('./identity'),
base = require('../openstack/client'),
_ = require('underscore');
var Client = exports.Client = function (options) {
options = options || {};
options.authUrl = options.authUrl || 'https://identity.api.rackspacecloud.com';
options.identity = identity.Identity;
if (typeof options.useServiceCatalog === 'undefined') {
options.useServiceCatalog = true;
}
base.Client.call(this, options);
this.provider = 'rackspace';
};
util.inherits(Client, base.Client);
Client.prototype._getIdentityOptions = function() {
return _.extend({
apiKey: this.config.apiKey
}, Client.super_.prototype._getIdentityOptions.call(this));
};