brightbox
Version:
A Node.JS module, which provides an object oriented wrapper for the Brightbox API.
34 lines (32 loc) • 1.1 kB
JavaScript
;
function Users() {
var Brightbox = this;
return {
// https://api.gb1.brightbox.com/1.0/#database_server_list_users
list: function list(opt_opts, opt_callback) {
Brightbox.request({
method: "GET",
url: "/1.0/users",
opts: opt_opts
}, opt_callback);
}
// https://api.gb1.brightbox.com/1.0/#database_server_get_database_server
, get: function get(opt_opts, opt_callback) {
Brightbox.request({
method: "GET",
url: "/1.0/users/" + opt_opts.id,
opts: opt_opts
}, opt_callback);
}
// https://api.gb1.brightbox.com/1.0/#database_server_update_database_server
, update: function update(opt_opts, opt_callback) {
Brightbox.request({
method: "PUT",
url: "/1.0/users/" + opt_opts.id,
opts: opt_opts,
body: JSON.stringify(opt_opts.data)
}, opt_callback);
}
};
}
module.exports = Users;