For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Gouri's avatar
Gouri
Icon for Nimbostratus rankNimbostratus
May 10, 2018

Accessing DataGroup from iRulesLX

Is there a way to access a DataGroup from within iLX javascript? Thank you for helping out. Here is my sample code

 

"use strict"
var f5 = require("f5-nodejs");
var ilx = new f5.ILXServer();

console.log("Node.js process starting.");
var separator = "------------------------------------"

var plugin = new f5.ILXPlugin();
var dg = {};
plugin.on('initialized', function () {
    dg = plugin.getDataGroup('/Common/ilx-test-dg');
});
....

When I reload the workspace, the error I get in ltm logs is

 

var plugin = new f5.ILXPlugin();
            ^
TypeError: undefined is not a function
    at Object. (/var/sdm/plugin_store/plugins/:Common:twurl_114385_63/extensions/twurl-ext/index.js:8:14)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3