Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.getAccount = function getAccount(name, callback) {
// Check for options
if (typeof name === 'function') {
return errs.handle(errs.create({
message: 'Name required for view an account.'
}), name);
}
this._request({ path: 'accounts/' + name }, function (err, body) {
return err
? callback(err)
: callback(null, body.adminUser);
});
};
exports.getDatabases = function getDatabases(owner, callback) {
// Check for options
if (typeof owner === 'function') {
return errs.handle(errs.create({
message: 'Name required for delete an account.'
}), owner);
}
this._request({ path: 'accounts/' + owner + '/databases' }, function (err, body) {
return err
? callback(err)
: callback(null, body);
});
};
exports.getDatabases = function getDatabases(options, callback) {
var self = this,
completeUrl = {},
requestOptions = {};
if (typeof options === 'function') {
return errs.handle(errs.create({
message: 'An instance is required for get all databases.'
}), Array.prototype.slice.call(arguments).pop());
}
// Check for instance
if (!options['instance']) {
return errs.handle(errs.create({
message: 'An instance is required for get all databases.'
}), Array.prototype.slice.call(arguments).pop());
}
// The limit parameter for truncate results
if (options && options.limit) {
completeUrl.limit = options.limit;
}
// The offset
if (options && options.offset) {
completeUrl.marker = options.offset;
exports.createAccount = function createAccount(options, callback) {
// Check for options
if (typeof options === 'function') {
return errs.handle(errs.create({
message: 'Options required for create an account.'
}), options);
}
if (!options['name']) {
return errs.handle(errs.create({
message: 'options. Name is a required argument'
}), callback);
}
if (!options['email']) {
return errs.handle(errs.create({
message: 'options. Email is a required argument'
}), callback);
}
exports.createInstance = function createInstance(options, callback) {
var self = this,
flavorRef,
size;
// Check for options
if (!options || typeof options === 'function') {
return errs.handle(errs.create({
message: 'Options required for create an instance.'
}), options);
}
if (!options['name']) {
return errs.handle(errs.create({
message: 'options. name is a required argument'
}), callback);
}
if (!options['flavor']) {
return errs.handle(errs.create({
message: 'options. flavor is a required argument'
}), callback);
}
exports.getLimits = function getLimits(callback) {
return errs.handle(
errs.create({ message: "Azure's API is not rate limited" }),
callback
);
};
exports.getLimits = function getLimits(callback) {
return errs.handle(
errs.create({ message: "Azure's API is not rate limited" }),
callback
);
};
exports.getLimits = function getLimits(callback) {
return errs.handle(
errs.create({ message: 'DigitalOcean\'s API is not rate limited' }),
callback
);
};
exports.getLimits = function getLimits(callback) {
return errs.handle(
errs.create({ message: 'AWS\'s API is not rate limited' }),
callback
);
};
exports.getLimits = function getLimits(callback) {
return errs.handle(
errs.create({message: 'Joyent\'s API is not rate limited'}), callback);
};