ILXServer

new ILXServer([array], [options])

Since:
  • BIP-IP TMOS 12.1
ILXServer is the oringinal iRulesLX API that accepts RPC messages from iRules TCL.

Parameters:

Name Type Attributes Description
array
object <optional>

Array of objects of for each method in

{<name>': <c

allback_functio n>}

format

options
object <optional>

server options

Pro

perties
name:prope

rties

+—+—+—+– -+—+ | N | T | A | D

D |
a | y | t | e | e |
m | p | t | f | s |
e | e | r | a | c |
| | i | u | r |
| | b | l | i |
| | u | t | p |
| | t | | t |
| | e | | i |
| | s | | o |
| | | | n |

+===+===+===+== =+===+ | : | b | < | f

d |
: | o | o | a | e |
| o | p | l | b |
| l | t | s | u |
| e | i | e | g |
| a | o | | l |
d | n | n | | o |
e | | a | | g |
b | | l | | g |
u | | > | | i |
g | | | | n |
| | | | g |

+—+—+—+– -+—+ | : | i | < | 5

T |
: | n | o | 0 | C |
| t | p | 0 | P |
| e | t | 0 | s |
| g | i | | o |
| e | o | | c |
t | r | n | | k |
i | | a | | e |
m | | l | | t |
e | | > | | t |
o | | | | i |
u | | | | m |
t | | | | e |
| | | | o |
| | | | u |
| | | | t |
| | | | i |
| | | | n |
| | | | m |
| | | | i |
| | | | l |
| | | | l |
| | | | i |
| | | | s |
| | | | e |
| | | | c |
| | | | o |
| | | | n |
| | | | d |
| | | | s |

+—+—+—+– -+—+

Example:

 var f5 = require('f5-nodejs');
var ilx = new f5.ILXServer();

ilx.addMethod('<method_name>', function(req, res) {
  var arg = req.params()[0];

  <Your Node.js code here>

  res.reply('<RESPONSE>');
});

ilx.listen();

Methods

addMethod(name, callback)

Add a method handler.

Parameters:

Name Type Description
name
string method name
callback
ILXServer~methodCall back that handles the request

listen()

Listen to connections.

removeMethod(name)

Remove a method handler.

Parameters:

Name Type Description
name
string method name

setDefaultMethod(callback)

Set a default handler for when no other method is available.

Parameters:

Name Type Description
callback
ILXServer~methodCall back callback that handles the request

Type Definitions

methodCallback(request, response)

Callback function that handles an incoming request.

Parameters:

Name Type Description
request
object

request object

Propertie

s
name:properties-

1

Nam e Typ e Des cri pti on
par ams arr ay

Ret urn s arr ay of str ing s, one for eac h arg sen d in TCL

ILX ::c all

ILX ::n oti fy

com man ds.

response
object

response object (not available for notifications)

Propertie

s
name:properties-

2

Nam e Typ e Des cri pti on
rep ly str ing | arr ay

Str ing or arr ay of str ing s to sen d res ult of ILX ::c all RPC to sen d bac k to TCL . Typ e

str ing

ret urn s in TCL as typ e

str ing

, typ e arr ay ret urn s in TCL as typ e

lis t

.

Example:

 ilx.addMethod('<method_name>', function(req, res) {
// Function parameters can be found in req.params().
  var arg1 = req.params()[0];
  var arg2 = req.params()[1];

  res.reply('<RESPONSE>'); // Returns as single string arg
  res.reply(['<result1>', '<result2>']); // Returns as TCL list
});

<p>*The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.*</p>