-
-
Save codygreen/075d24fdb02a5de2a945d7ba4f094be2 to your computer and use it in GitHub Desktop.
AFM/APM Dynamic Firewall Rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* iRulesLX RPC for AFM/APM Dynmanic Address List | |
* | |
*/ | |
/* Import the f5-nodejs module. */ | |
var f5 = require('f5-nodejs'); | |
var afm = require('./f5_afm'); | |
/* Create a new rpc server for listening to TCL iRule calls. */ | |
var ilx = new f5.ILXServer(); | |
/** | |
* add address to AFM address list | |
* | |
* @params {String} address | |
* @return {Boolean} result | |
*/ | |
ilx.addMethod('addAddress', function(req, res) { | |
afm.addAddress(req.params()[0], function(result) { | |
if(typeof result !== undefined) { | |
res.reply(true); | |
} else { | |
res.reply(false); | |
} | |
}); | |
}); | |
/** | |
* remove address from AFM address list | |
* | |
* @ params {String} address | |
* @ return {Boolean} result | |
*/ | |
ilx.addMethod('deleteAddress', function(req, res) { | |
afm.deleteAddress(req.params()[0], function(result) { | |
if(typeof result !== undefined) { | |
res.reply(true); | |
} else { | |
res.reply(false); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment