To call any of these methods, send a POST request to this url with encoded JSON according to the JSON RPC 2.0 spec.
The 'params' value should be specified by-name (i.e. as a JS object).
Batch requests are supported.
Use the following form to send JSONRPC requests
The following methods are available
Enthusiastically greet who.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| who | Who you want to greet | World | No |
Add a sequence of events to a given timeline, return ids of applied events.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| events | A list of events | – | Yes |
| name | Name of the timeline | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| lat | – | Yes | |
| lng | – | Yes |
Add samples to a sampler.
samples should be a list of samples, where a sample consists of the timestamp (epoch time) and value.
e.g:
samples = [[12342345, 123], [25324365.0, 420.0]]** NOTE ** We are using this for both backward compatibility, and as a temporary fix to read disk samples into the system.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| device_class | device class to use | – | Yes |
| sampler_name | name of sampler | – | Yes |
| samples | list of samples | – | Yes |
| serial | device serial number | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| company_id | User's company id (primary key) | null | No |
| company_uid | User's company uid | null | No |
| password | User's password | null | No |
| serial | Device serial number | – | Yes |
| username | User's username | null | No |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| device_class | – | Yes | |
| info | Information to identify the device | – | Yes |
| name | (friendly) Name of the device | – | Yes |
| serial | Serial number of the device | – | Yes |
| subdomain | Company subdomain | – | Yes |
Check credentials and authorize the rest of the batch requests.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| auth_token | An authorization token | – | Yes |
| device_class | – | Yes | |
| serial | – | Yes | |
| sync_id | null | No |
Check for new firmware.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| current_version | Version number of the current firmware | – | Yes |
Create samplers.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| sampler_names | A list of samplers to create | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| auth_token | – | Yes | |
| rpi_b_plus | null | No | |
| usercode | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| company | User's company | null | No |
| device_class | Name of the device class | – | Yes |
| firmware_b64 | Base64 encoded firmware | – | Yes |
| password | User's password | – | Yes |
| replace | False | No | |
| ui | UI XML | – | Yes |
| username | User's username | – | Yes |
| version | Version number | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| auth_token | Authorization token | null | No |
| device_class_name | Name of the required device class | null | No |
| name | Device friendly name | null | No |
| path | The location to place devices in the device tree | Dataplicity Devices | No |
| serial | Device serial number | null | No |
| ui | XML UI definition for firmware v1 | null | No |
Let us know what agent_version the device uses.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| agent_version | The version of dataplicity | – | Yes |
Let us know the disk capacity and amount used.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| disk_capacity | Capacity of disk in bytes | – | Yes |
| disk_used | Amount of disk used in bytes | – | Yes |
Let the server know which firmware the device is running.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| version | Firmware version | – | Yes |
Save the IP addresses of the device
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| ip_list | A list of all ip address on the device | – | Yes |
Sets tags on the device defined by the machine
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| tag_list | A list of tag names | – | Yes |
Let us know what the revision code of the machine is.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| revision_code | The revision code of the machine | – | Yes |
*Deprecated call, only used on old versions of the agent* The agent used to send through the machine type, rpi_2b for example. These still match our MACHINE_CHOICES, but there is potential for the old agent to send something not in those choices.
Let us know what type the device is.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| machine_type | The type of machine | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| model_name | The model name of the machine (for non-RPi devices | – | Yes |
Let us know what OS the device is running.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| os_version | The OS version | – | Yes |
Update remote directory.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| directory | serialized remote directory | – | Yes |
| file_sizes | Scan includes file sizes | False | No |
Let us know what uname the device presents.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| uname | The result of uname. | – | Yes |
Update a conf file.
Returns the new contents of the configuration file with any changes made by the server.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| contents | conf contents in ConfigParserFormat | – | Yes |
| name | name of conf file on the device | – | Yes |
Update conf files, return any conf files which have changed.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| conf_map | object that maps a conf name on to its contents | – | Yes |
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| device_class | Name of the device class | – | Yes |
| ui | User interface XML | – | Yes |
| version | Firmware version number | – | Yes |
Associate a device with its m2m identity.
| Parameter | Purpose | Default | Required? |
|---|---|---|---|
| identity | An M2M identity (typically a UUID) | – | Yes |