Description:
This script shows a way to handle lists of values inside variables.
List of used variables:
Add-in code:
exports.main = function (config, context) {
var serials = context.vars.REMOTE_SERIALS.split(",");
var names = context.vars.REMOTE_NAMES.split(",");
serials.forEach(function (serial, index) {
var ikeKeysTable = config.getTableByOid("1.2.19.5.3");
var ikeKeysTableRow = ikeKeysTable.createNewRow();
ikeKeysTableRow.setByOids({
1: names[index],
6: "9",
7: "VPN3",
5: "9",
2: "serialNumber=" + serial,
3: "",
4: ""
});
ikeKeysTable.addOrMerge(ikeKeysTableRow);
});
};
|
---|
Addin as JSON file:
variable_as_list.json