Transformer Pipeline Module API Reference (JavaScript)
8.0.2.290852-a608fcd3
|
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 ( if Discovery mode if off ) Return the highest peer index ( if Discovery mode if on ) 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... | |
system.deletePipeline | ( | var | scriptid | ) |
Delete the specified pipeline.
scriptid | - The scriptid of the pipeline which will be deleted |
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.
time0 | - First time |
time1 | - Second time |
system.expandFileName | ( | var | pattern | ) |
Perform substitutions on a string.
pattern | - The string to perform substituions on |
This function will expand the following tokens in the supplied argument:
application-name
)application-name
)application-root
)system.getCurrentMillis | ( | ) |
Return the number of milliseconds since the Epoch.
number | of milliseconds since the Epoch |
system.getHostname | ( | ) |
Returns the hostname.
system.getLogLevel | ( | ) |
Get the current logging level for the pipeline log.
system.getNumberPeers | ( | ) |
Return the number of configured peers in the system ( if Discovery mode if off ) Return the highest peer index ( if Discovery mode if on )
system.getPeerEnabledByLabel | ( | var | label | ) |
Returns whether a peer is enabled or not.
label | - Peer label to return the state for |
0 | - Peer is disabled |
1 | - Peer is enabled |
system.getPeerIndexByLabel | ( | var | label | ) |
Returns the peer index corresponding to a peer label.
label | - Peer label to return the index for |
Peer<index> | - If peer index is not defined |
system.getPeerLabelByIndex | ( | var | index | ) |
Return the peer label corresponding to a peer index.
index | - Peer index to return the label for |
nil | - Peer index is not defined |
system.getPeerStatusByLabel | ( | var | label | ) |
Returns the peer status for a given peer label.
label | - Peer label to return the status for |
0 | - Peer is down |
1 | - Peer is up |
system.getPipeline | ( | var | scriptid | ) |
Return configuration information for the specified pipeline.
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.
name | - Name of symbol |
nil | - No matching pipleines found |
system.getScriptIdentifier | ( | ) |
Retrieve the id of the currently running pipeline script.
The id that is returned is that configured in add-pipeline configuration group
system.getThreadIndex | ( | var | pattern | ) |
Return the current thread number.
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.
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.
msg | - The message to send in the form "COMMAND ARG1 ARG2 ..." |
None |
system.setStatusDown | ( | var | peerLabel | ) |
Set peer status down.
peerLabel | - Label of peer to send status to - if not present then status sent to all peers |
0 | - Success |
-1 | - peerLabel did not match any peers |
system.setStatusUp | ( | var | peerLabel | ) |
Set peer status up.
peerLabel | - Label of peer to send status to - if not present then status sent to all peers |
0 | - Success |
-1 | - peerLabel did not match any peers |
system.strptime | ( | var | timestamp, |
var | format | ||
) |
Parse a timestamp according the give timestamp format.
timestamp | - Time stamp to parse |
format | - The format to apply |
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.
number | of seconds since the Epoch |
system.udpSendTo | ( | var | addr, |
var | port, | ||
var | message | ||
) |
Send data to a UDP address.
addr | - The host name or IP address for the UDP port |
port | - The UDP port number |
message | - The data to send |
Number | of bytes sent |
-1 | - Error sending message |