UNPKG

brightbox

Version:

A Node.JS module, which provides an object oriented wrapper for the Brightbox API.

43 lines (41 loc) 1.53 kB
"use strict"; function FirewallRules() { var Brightbox = this; return { // https://api.gb1.brightbox.com/1.0/#firewall_rule_create_firewall_rule create: function create(opt_opts, opt_callback) { Brightbox.request({ method: "POST", url: "/1.0/firewall_rules/", opts: opt_opts, form: opt_opts.data }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#firewall_rule_get_firewall_rule , get: function get(opt_opts, opt_callback) { Brightbox.request({ method: "GET", url: "/1.0/firewall_rules/" + opt_opts.id, opts: opt_opts }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#firewall_rule_update_firewall_rule , update: function update(opt_opts, opt_callback) { Brightbox.request({ method: "PUT", url: "/1.0/firewall_rules/" + opt_opts.id, opts: opt_opts, body: JSON.stringify(opt_opts.data) }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#firewall_rule_delete_firewall_rule , delete: function _delete(opt_opts, opt_callback) { Brightbox.request({ method: "DELETE", url: "/1.0/firewall_rules/" + opt_opts.id, opts: opt_opts }, opt_callback); } }; } module.exports = FirewallRules;