Skip to content

Driver Instances

Driver Instance Data Structure

A driver instance is a running instance of a driver. It contains configuration options and information about the actual Platform node it's running on.

In responses, a driver instance looks like this:

{
  "owner_id": "50e032fb-964f-440d-9b9a-47870667373c",
  "opts": {
    "url": "https://test"
  },
  "name": "Driver Instance #1",
  "id": "20c66cea-9a28-41dd-8fa9-fc56d3b9f6dc",
  "enabled": true,
  "driver": "Platform.Drivers.HttpPoll",
  "alive_nodes": {
    "nonode@nohost": true
  }
}
Key Example Description
name Driver Instance #1 Name of the driver instance
id 20c66cea-9a28-41dd-8fa9-fc56d3b9f6dc Unique ID of the driver instance (UUID4)
enabled true Boolean value indicating whether the driver instance is active or not
driver Platform.Drivers.HttpPoll Module of the driver that this driver instance runs
opts {"url": "https://test"} Configuration options for the driver
alive_nodes {"nonode@nohost": true} JSON Object showing all nodes running instances of the driver this instance runs

List all Driver Instances

Method: GET, Endpoint: /drivers/instances

Example Request

GET https://element-iot.com/api/v1/drivers/instances?auth=46cb688e2c0b468e26e914235d4b73ea

Example Response

{
  "status": 200,
  "ok": true,
  "body": [
    // Contains an array of driver instancess
  ]
}

This endpoint returns a list of driver instancess.

Show a single Driver Instance

Method: GET, Endpoint: /drivers/instances/:driver_instance_id

Example Request

GET https://element-iot.com/api/v1/drivers/instances/20c66cea-9a28-41dd-8fa9-fc56d3b9f6dc?auth=46cb688e2c0b468e26e914235d4b73ea

Example Response

{
  "status": 200,
  "ok": true,
  "body": {
    // Contains the driver instance
  }
}

The driver instance ID must be the id of the driver instance.