API Reference
Every function the sandbox exposes, grouped by what you’re trying to do. Each entry links to its full signature, parameters, and example.
Signal the end of a run and classify failures.
D.errorType— Known Domotz Context Error types.D.failure— Failure callback in D (D.failure).D.success— Success callback in D (D.success).D.success (backup / restore)— Success callback in D (D.success).D.valueType— Domotz Variable Value Types.
Publish what the driver collected: variables, tables, metrics, configuration backups, and driver parameters.
D.createBackup— Function createBackupD.createExternalDevice— Creates an External IP device objectD.createMetric— Creates a custom driver metric to be sent in the D.success callback.D.createTable— Creates a driver table for variable values visualization in a table formatD.createVariable— Creates a custom driver variable to be sent in the D.success callback.D.getParameter— Get a predefined parameter during execution by its name.Table.addMetrics— Adds a record with metrics data to the tableTable.getResult— Returns the prepared table definition and values in the current driver executionTable.insertRecord— Inserts a record inside the Custom Driver table object.Table.upsertRecord— Inserts or Updates a record inside the Custom Driver table object.ConfigurationBackup— Custom Driver configuration backup Validated version is returned by D.createBackup, should be passed to D.success()ConfigurationRestore— Custom Driver configuration restore Configuration backup to restore, should be passed to restore()Metric— Custom Driver metric created via D.createMetricMetricMetadata— Custom Driver metric metadataVariable— Custom Driver variable created via D.createVariable
Call REST endpoints on the device.
D.device.http.delete— Executes an HTTP DELETE request towards the device.D.device.http.get— Executes an HTTP GET request towards the device.D.device.http.getTLSCertificate— Retrieves the TLS certificate of the server.D.device.http.post— Executes an HTTP POST request towards the device.D.device.http.put— Executes an HTTP PUT request towards the device.
Run commands over SSH and move files with SCP.
D.device.scp.download— Retrieves a file content from a remote server using SCP.D.device.scp.upload— Transfers a file content to a remote server using SCP.D.device.sendSSHCommand— Sends a command to the device via SSH.D.device.sendSSHCommands— Sends a sequence of commands to the device via SSH.
Drive legacy devices over raw Telnet or TCP.
D.device.sendTCPCommand— Sends a command to the device via TCP.D.device.sendTelnetCommand— Sends a command to the device via Telnet.
Walk and set SNMP v1/v2c/v3 OIDs.
D.device.snmpSession.get— Executes SNMP Get for a list of OIDs towards the deviceD.device.snmpSession.getRaw— Executes SNMP Get for a list of OIDs towards the device and returns raw data without type conversion.D.device.snmpSession.objectType— SNMP Object Type constants for comparison with type values returned by getRaw method.D.device.snmpSession.set— Executes SNMP Set for an OID with its respective value and OID type defined.D.device.snmpSession.walk— Executes an SNMP Walk for an OID towards the deviceD.device.createSNMPSession— Starts an SNMP session with the device.
Execute PowerShell on Windows hosts.
D.device.sendWinRMCommand— Sends a command to the device via WinRM.
Push or pull firmware via TFTP client or collector-hosted server.
D.device.tftpClient.download— Retrieves a file content from a remote server using TFTP.D.device.tftpClient.upload— Transfers a file content to a remote server using TFTP.D.tftpServer.accept— Start a TFTP server on network collector that is able to receive a single PUT request from a TFTP client on a fileD.tftpServer.serve— Start a TFTP server on network collector that is able to receive a single GET request from a TFTP client on a file
Read the target device’s IP, credentials, hostname, and metadata, or ping it.
D.device.ip— Returns the IP address of the device object.D.device.macAddress— Returns the MAC address of the device object.D.device.password— Returns the stored password of a device.D.device.ping— Executes a ping operation to the device’s IP address.D.device.serial— Returns the serial number of the device object.D.device.username— Returns stored username of a device.
Hash, HMAC, encrypt, and decrypt inside the sandbox.
D.crypto.Cipher.final— Returns any remaining enciphered contents.D.crypto.Cipher.setAutoPadding— When using block encryption algorithms, the Cipher class will automatically add padding to the input data to the appropriate block size.D.crypto.Cipher.update— Updates the cipher with data.D.crypto.Decipher.final— Returns any remaining plaintext which is deciphered.D.crypto.Decipher.setAutoPadding— When data has been encrypted without standard block padding, calling decipher.setAutoPadding(false) will disable automatic padding to prevent decipher.final() from checking for and removing padding.D.crypto.Decipher.update— Updates the decipher with data.D.crypto.createCipher— Creates a Cipher object using the given algorithm and a raw key.D.crypto.createDecipher— Creates a Decipher object using the given algorithm and raw key.D.crypto.hash— Computes a one-shot cryptographic hash of a string with the named algorithm (for examplesha256,sha1,md5) and returns the digest hex-encoded.D.crypto.hmac— Computes a one-shot HMAC of a string with the named algorithm and key.D.crypto.pbkdf2Sync— Synchronous PBKDF2 (Password-Based Key Derivation Function).
Math, lodash, buffers, HTML parsing, console logging.
console.debug— Write the given message to the sandbox log (debug-level).console.error— Write the given message to the sandbox log (error-level).console.get— Returns the log message entriesconsole.info— Write the given message to the sandbox log (info-level).console.warn— Write the given message to the sandbox log (warning-level).D._unsafe.buffer.alloc— Allocates a new buffer of size bytes.D._unsafe.buffer.concat— Returns a new Buffer which is the result of concatenating all the Buffer instances in the list together.D._unsafe.buffer.from— Allocates a new Buffer using multiple types of input data (array, arrayBuffer, buffer, object, string)D.math.percent— Percentage Calculating FunctionD.htmlParse— Html Parser Library