Type Definitions
CheerioAPI
The Cheerio Library Loaded Document Interface.
Can be used to traverse and manipulate the loaded document.
Type:
- Object
CheerioOptions
The Cheerio Library Accepted Options
Type:
- Object
ColumnHeader
Custom Driver table Column Header
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
label |
string | The table column label. Max 30 Characters | |
unit |
string |
<optional> |
The Unit of measurement of the column values (eg %). Max 10 characters |
type |
ValueType |
<optional> |
The value of the column values (used for display purposes) |
DeviceCredentials
Custom Driver device credentials
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
username |
string | The device username |
password |
string | The device password |
DriverTableResult
Custom Driver table Result
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
label |
string | The table Label. Max 50 characters |
columnHeaders |
Array.<ColumnHeader> | The column headers list |
rows |
Array.<Array.<any>> | The table rows |
ErrorResult
Used when the result of a call towards a device is in an erroneous state
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
message |
string | The Error Message |
ErrorType
Known Domotz Context Error types
Properties:
Name | Type | Description |
---|---|---|
TOO_MANY_VARIABLES_ERROR |
string | Too many variables have been defined in this driver execution |
MISSING_DEVICE_ERROR |
string | No device was found for execution |
RESOURCE_UNAVAILABLE |
string | The Resource you are trying to access is not available |
AUTHENTICATION_ERROR |
string | Authentication with the device has failed |
PARSING_ERROR |
string | Failed to parse the response |
TIMEOUT_ERROR |
string | The remote call has resulted in a timeout |
IMPORT_NOT_ALLOWED |
string | Import statements are not allowed in the sandbox environment |
REQUIRE_NOT_ALLOWED |
string | Require statements are not allowed in the sandbox environment |
GENERIC_ERROR |
string | A Generic/Unknown error has occurred |
Example
D.errorType.TIMEOUT_ERROR
HttpCallback
The Http library callback
Type:
- callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
error |
string |
<optional> |
The HTTP response error |
response |
object | The HTTP response object | |
body |
string |
<optional> |
The HTTP response body |
HttpOptions
The Http Library Options
Type:
- object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
url |
string | The url suffix of the request target | ||
headers |
object |
<optional> |
The Request HTTP Headers defined as key value pairs. Eg {'Accept': 'text/html'} | |
body |
string |
<optional> |
The Request HTTP Body | |
port |
integer |
<optional> |
80 | The port to use for the request. If protocol is set to https the default is 443 |
auth |
string | object |
<optional> |
The authentication to use. Eg 'basic' / {'bearer': 'the token'} | |
username |
string |
<optional> |
The device username. If not set the custom driver management purpose one is used | |
password |
string |
<optional> |
The device password. If not set the custom driver management purpose one is used | |
jar |
boolean |
<optional> |
false | if true, remember cookies for future use |
protocol |
http | https |
<optional> |
http | The protocol to use in the request |
snmpCallback
The SNMP query callback
Type:
- callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
output |
Object.<string, string> | The output object from the snmp query execution as a key-value pair for each oid and it corresponding value | |
error |
ErrorResult |
<optional> |
Will be present if the snmp query resulted in an error. |
snmpSessionOptions
The SNMP Session Options
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
port |
integer |
<optional> |
161 | UDP port to send requests to |
timeout |
integer |
<optional> |
5000 | The time the snmp session queries will persist for (in milisenconds). |
maxRepetitions |
integer |
<optional> |
24 | How many rows of a table are to be retrieved in a single GetBulk operation. Used in SNMP Walk |
SshAlgorithms
The SSH authentication algorithm parameters
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
kex |
Array.<string> | A List of SSH key exchange methods to use |
cipher |
Array.<string> | A List of SSH ciphers to use |
Example
{
cipher: [
'aes128-gcm',
'aes128-gcm@openssh.com',
'aes256-gcm',
'aes256-gcm@openssh.com'
],
kex: [
'diffie-hellman-group-exchange-sha1',
'diffie-hellman-group-exchange-sha256',
'ecdh-sha2-nistp256',
'ecdh-sha2-nistp384',
'ecdh-sha2-nistp521'
]
}
SshCallback
The SSH Command Execution Result
Type:
- callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
output |
string | The stdout from the SSH Command execution | |
error |
ErrorResult |
<optional> |
Will be present if the execution resulted in an error |
SshOptions
The SSH Library Options
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | The ssh command to execute against the device | ||
timeout |
int |
<optional> |
The time to wait for the command execution | |
username |
string |
<optional> |
The device username. If not set the custom driver management purpose one is used | |
password |
string |
<optional> |
The device password. If not set the custom driver management purpose one is used | |
keyboard_interactive |
boolean |
<optional> |
false | Try keyboard-interactive user authentication if primary user authentication method fails |
port |
string |
<optional> |
22 | The SSH port |
algorithms |
SshAlgorithms |
<optional> |
The SSH Kex and Ciphers to use |
TCPCallback
The TCP library callback
Type:
- callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
output |
string | The Result from the tcp command execution | |
error |
ErrorResult |
<optional> |
Will be present if the execution resulted in an error |
TCPOptions
The TCP library Options
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | The tcp command to execute against the device | ||
port |
int |
<optional> |
23 | The tcp port to connect to |
timeout |
int |
<optional> |
500 | The time the tcp command will execute for at most (in milliseconds) |
keepAlive |
boolean |
<optional> |
false | Boolean flag to use if the TCP connection should persist until the timeout value runs out. Disabled by default |
encoding |
str |
<optional> |
utf8 | The tcp command response encoding. Default 'utf8' |
TelnetCallback
The Telnet library callback
Type:
- callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
output |
string | The Result from the telnet command execution | |
error |
ErrorResult |
<optional> |
Will be present if the execution resulted in an error |
TelnetOptions
The Telnet library Options
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | The telnet command to execute against the device | ||
port |
int |
<optional> |
23 | The telnet port to connect to |
timeout |
int |
<optional> |
500 | The time the telnet session will persist for (in milisenconds) |
negotiationMandatory |
boolean |
<optional> |
false | Set this to true if the telnet session requires authentication |
shellPrompt |
string |
<optional> |
/(?:\/ )?#\s/ | The expected shell prompt regular expression for the telnet session |
loginPrompt |
string |
<optional> |
/login[: ]*$/i | The expected username prompt regular expression for the telnet session |
passwordPrompt |
string |
<optional> |
/Password: /i | The expected password prompt regular expression for the telnet session |
ValueType
Domotz variable value types
Properties:
Name | Type | Description |
---|---|---|
STRING |
string | String value |
NUMBER |
string | Numerical value |
DATETIME |
string | Datetime value |
RATE |
string | A numeric value that changes over time in an increasing manner. Only the rate of change is calculated and stored |
MONOTONE_RATE |
string | A numeric value similar to the RATE type but ignoring values lower than the previous collected value in the rate of change comparison |
Example
D.valueType.RATE
Variable
Custom Driver variable
Created via D.createVariable
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
uid |
string | The identifier of the variable. Must be Unique. Max 50 characters
cannot be one of the following reserved words: "table", "column", "history" |
name |
string | The Name/Label of the variable. Max 100 characters |
value |
string | The Value of the variable. Max 500 characters |
unit |
string | The Unit of measurement of the variable (eg %). Max 10 characters |
valueType |
ValueType | The type of the variable value (used for visualization purposes). |
WinRMCallback
The WinRM Command Execution Result
Type:
- callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
output |
WinRMOutput |
<optional> |
Output of the execution, present if no error has occurred |
error |
ErrorResult |
<optional> |
Will be present if the execution resulted in an error |
WinRMOptions
The WinRM Library Options
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | The winrm command to execute against the device | ||
username |
string |
<optional> |
The device username. If not set the custom driver management purpose one is used | |
password |
string |
<optional> |
The device password. If not set the custom driver management purpose one is used | |
port |
string |
<optional> |
5985 | The WinRM port |
WinRMOutput
The WinRM Command Execution Result output
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
commandId |
string | Id of the WinRM command | |
shellId |
string | Id of the remote shell that executed the command | |
stdout |
string | standard output produced by the command | |
stderr |
string |
<optional> |
standard error produced by the command (should always be null) |
exitCode |
int | exit code of the command (should always be 0) |