JSON RPC auto-generated documentation

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.

Test Form

Use the following form to send JSONRPC requests




                

Methods

The following methods are available

device.add_samples (deprecated)

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.

Parameters
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

device.check_auth

Check credentials and authorize the rest of the batch requests.

Parameters
Parameter Purpose Default Required?
auth_token An authorization token Yes
device_class Yes
serial Yes
sync_id null No

device.check_firmware (deprecated)

Check for new firmware.

Parameters
Parameter Purpose Default Required?
current_version Version number of the current firmware Yes

device.set_agent_version

Let us know what agent_version the device uses.

Parameters
Parameter Purpose Default Required?
agent_version The version of dataplicity Yes

device.set_disk_space

Let us know the disk capacity and amount used.

Parameters
Parameter Purpose Default Required?
disk_capacity Capacity of disk in bytes Yes
disk_used Amount of disk used in bytes Yes

device.set_firmware (deprecated)

Let the server know which firmware the device is running.

Parameters
Parameter Purpose Default Required?
version Firmware version Yes

device.set_ip_addresses

Save the IP addresses of the device

Parameters
Parameter Purpose Default Required?
ip_list A list of all ip address on the device Yes

device.set_machine_defined_tags

Sets tags on the device defined by the machine

Parameters
Parameter Purpose Default Required?
tag_list A list of tag names Yes

device.set_machine_revision

Let us know what the revision code of the machine is.

Parameters
Parameter Purpose Default Required?
revision_code The revision code of the machine Yes

device.set_machine_type

*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.

Parameters
Parameter Purpose Default Required?
machine_type The type of machine Yes

device.set_model_name

Parameters
Parameter Purpose Default Required?
model_name The model name of the machine (for non-RPi devices Yes

device.set_os_version

Let us know what OS the device is running.

Parameters
Parameter Purpose Default Required?
os_version The OS version Yes

device.set_remote_directory

Update remote directory.

Parameters
Parameter Purpose Default Required?
directory serialized remote directory Yes
file_sizes Scan includes file sizes False No

device.set_uname

Let us know what uname the device presents.

Parameters
Parameter Purpose Default Required?
uname The result of uname. Yes

device.update_conf_map (deprecated)

Update conf files, return any conf files which have changed.

Parameters
Parameter Purpose Default Required?
conf_map object that maps a conf name on to its contents Yes

m2m.associate

Associate a device with its m2m identity.

Parameters
Parameter Purpose Default Required?
identity An M2M identity (typically a UUID) Yes