Transformer Pipeline Module API Reference (JavaScript)  7.1.1.311110
System information

Detailed Description

The functions in this package provide access to information about the system.

Functions

 system.getScriptIdentifier ()
 Retrieve the id of the currently running pipeline script. More...
 
 system.getVersion ()
 Retrieve the version of the currently running pipeline module. More...
 
 system.expandFileName (var pattern)
 Perform substitutions on a string. More...
 
 system.getThreadIndex (var pattern)
 Return the current thread number. More...
 
 system.getPipeline (var scriptid)
 Return configuration information for the specified pipeline. More...
 
 system.deletePipeline (var scriptid)
 Delete the specified pipeline. More...
 
 system.getCurrentMillis ()
 Return the number of milliseconds since the Epoch. More...
 
 system.time ()
 Return the number of seconds since the Epoch. More...
 
 system.difftime (var time0, var time1)
 Calculate time difference. More...
 
 system.sendUdpMessage (var msg)
 Send a UDP message to this Transformer. More...
 
 system.udpSendTo (var addr, var port, var message)
 Send data to a UDP address. More...
 
 system.setStatusDown (var peerLabel)
 Set peer status down. More...
 
 system.setStatusUp (var peerLabel)
 Set peer status up. More...
 
 system.getPeerLabelByIndex (var index)
 Return the peer label corresponding to a peer index. More...
 
 system.getPeerIndexByLabel (var label)
 Returns the peer index corresponding to a peer label. More...
 
 system.getPeerStatusByLabel (var label)
 Returns the peer status for a given peer label. More...
 
 system.getNumberPeers ()
 Return the number of configured peers in the system. More...
 
 system.strptime (var timestamp, var format)
 Parse a timestamp according the give timestamp format. More...
 
 system.getPeerEnabledByLabel (var label)
 Returns whether a peer is enabled or not. More...
 
 system.getHostname ()
 Returns the hostname. More...
 
 system.getPipelinesForSubject (var name)
 Returns the pipeline id's for a given symbol. More...
 
 system.getLogLevel ()
 Get the current logging level for the pipeline log. More...
 

Function Documentation

system.deletePipeline ( var  scriptid)

Delete the specified pipeline.

Parameters
scriptid- The scriptid of the pipeline which will be deleted
Return values
0- Success
nil- Failure (pipeline does not exist)

This function will delete the in-memory configuration of the specified pipeline. No more events will be passed into the pipeline and its configuration cannot be retrieved after this call.

system.difftime ( var  time0,
var  time1 
)

Calculate time difference.

Parameters
time0- First time
time1- Second time
Returns
The number of seconds elapsed between time time1 and time time0
system.expandFileName ( var  pattern)

Perform substitutions on a string.

Parameters
pattern- The string to perform substituions on
Returns
An expanded string with all appropriate substitutions made

This function will expand the following tokens in the supplied argument:

  • %h The hostname
  • %a The application name (as set by the configuration option application-name)
  • %n The application name (as set by the configuration option application-name)
  • %r The application root (as set by the configuration option application-root)
  • %u The home directory of the process owner.
system.getCurrentMillis ( )

Return the number of milliseconds since the Epoch.

Return values
numberof milliseconds since the Epoch
system.getHostname ( )

Returns the hostname.

Returns
The hostname
system.getLogLevel ( )

Get the current logging level for the pipeline log.

Returns
- The logging level. See Logging routines for the possible values
system.getNumberPeers ( )

Return the number of configured peers in the system.

Returns
The number of configured peers
system.getPeerEnabledByLabel ( var  label)

Returns whether a peer is enabled or not.

Parameters
label- Peer label to return the state for
Return values
0- Peer is disabled
1- Peer is enabled
system.getPeerIndexByLabel ( var  label)

Returns the peer index corresponding to a peer label.

Parameters
label- Peer label to return the index for
Returns
The peer index
Return values
-1- Peer label not known
system.getPeerLabelByIndex ( var  index)

Return the peer label corresponding to a peer index.

Parameters
index- Peer index to return the label for
Returns
The peer label
Return values
nil- Peer index is not defined
system.getPeerStatusByLabel ( var  label)

Returns the peer status for a given peer label.

Parameters
label- Peer label to return the status for
Return values
0- Peer is down
1- Peer is up
system.getPipeline ( var  scriptid)

Return configuration information for the specified pipeline.

Parameters
scriptid- The scriptid of the pipeline whose configuration should be returned

This function will return an object of type Dynamic pipeline configuration that can be queried and set to adjust the configuration of the specified pipeline

system.getPipelinesForSubject ( var  name)

Returns the pipeline id's for a given symbol.

Parameters
name- Name of symbol
Returns
- A table containing the id's of the matching pipelines
Return values
nil- No matching pipleines found
system.getScriptIdentifier ( )

Retrieve the id of the currently running pipeline script.

Returns
The script id

The id that is returned is that configured in add-pipeline configuration group

system.getThreadIndex ( var  pattern)

Return the current thread number.

Returns
The currently executing thread index

This function will return the current thread number (from 0 to num-threads - 1). It is primarily of use for testing purposes

system.getVersion ( )

Retrieve the version of the currently running pipeline module.

Returns
Pipeline module version

The version returned is in the form X.Y.Z where X is the major, Y the minor and Z the patch version.

system.sendUdpMessage ( var  msg)

Send a UDP message to this Transformer.

Parameters
msg- The message to send in the form "COMMAND ARG1 ARG2 ..."
Return values
None
Note
The UDP command should be the first field of the message string.
system.setStatusDown ( var  peerLabel)

Set peer status down.

Parameters
peerLabel- Label of peer to send status to - if not present then status sent to all peers
Return values
0- Success
-1- peerLabel did not match any peers
system.setStatusUp ( var  peerLabel)

Set peer status up.

Parameters
peerLabel- Label of peer to send status to - if not present then status sent to all peers
Return values
0- Success
-1- peerLabel did not match any peers
system.strptime ( var  timestamp,
var  format 
)

Parse a timestamp according the give timestamp format.

Parameters
timestamp- Time stamp to parse
format- The format to apply
Returns
A table containing information regarding the date
Return values
nil- The timestamp could not be parsed

The table has the following fields: year (four digits), month (1–12), day (1–31), hour (0–23), min (0–59), sec (0–61), wday (weekday, Sunday is 1), yday (day of the year), and isdst (daylight saving flag, a boolean).

To obtain a value in unix timestamp format the returned table can be supplied to the standard os.time() function, and then operations such as difftime may be applied.

Should format not be supplied, then the format defaults to: "%Y-%m-%dT%H:%M:%SZ" as per timers

system.time ( )

Return the number of seconds since the Epoch.

Return values
numberof seconds since the Epoch
system.udpSendTo ( var  addr,
var  port,
var  message 
)

Send data to a UDP address.

Parameters
addr- The host name or IP address for the UDP port
port- The UDP port number
message- The data to send
Return values
Numberof bytes sent
-1- Error sending message

Generated on Fri Mar 23 2018 18:29:30 for Transformer Pipeline Module API Reference (JavaScript)