ThingsPro Edge RESTful API Reference API Reference

Welcome to the ThingsPro Edge RESTful API reference. This is a live document of how you can use ThingsPro Edge APIs. The ThingsPro Edge API is organized around the REST methodology, and it uses resource-oriented URLs, and common HTTP response codes to indicate API errors.

API Endpoint
https://localhost/api/v1
Response Content-Types: application/json
Schemes: http, https
Version: 1.0.0

Paths

tag

GET /tags/{type}

Gets all tags with given type.

type: string fieldbus, system, virtual
in path

(no description)

200 OK

Successful response

type
object
Response Example (200 OK)
{
  "tag_list": [
    {
      "srcName": "device0",
      "tagName": "di0",
      "dataType": "uint16",
      "duration": 100,
      "dataUnit": "",
      "access": "ro"
    },
    {
      "srcName": "device0",
      "tagName": "di1",
      "dataType": "uint16",
      "duration": 100,
      "dataUnit": "",
      "access": "ro"
    }
  ]
}
tag

GET /tags/{type}/templates

Gets template list by given fieldbus protocol

type: string fieldbus, EthernetIP, modbus
in path

(no description)

200 OK

Successful response

type
object
Response Example (200 OK)
{
  "list": [
    {
      "template_name": "temp1",
      "protocol_name": "EthernetIP",
      "tag_list": [
        {
          "op": "write",
          "polling_period_ms": 100,
          "request_timeout_ms": 10,
          "address": 0,
          "type": "uint16",
          "id": "do0",
          "quantity": 2
        },
        {
          "op": "write",
          "polling_period_ms": 100,
          "request_timeout_ms": 10,
          "address": 2,
          "type": "uint16",
          "id": "do1",
          "quantity": 2
        }
      ]
    }
  ]
}
tag

DELETE /tags/{type}/templates

Deletes template list by given fieldbus protocol

list: object[]
object
template_name: string
protocol_name: string
type: string fieldbus, EthernetIP, modbus
in path

(no description)

Request Example
{
  "list": [
    {
      "template_name": "temp1",
      "protocol_name": "EthernetIP"
    }
  ]
}
200 OK

Successful response

type
object
Response Example (200 OK)
{
  "list": [
    {
      "template_name": "temp1",
      "protocol_name": "EthernetIP"
    }
  ]
}
tag

GET /tags/{type}/templates/{name}

Gets fieldbus tag settings by the given protocol and template name.

type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

200 OK

Successful response.

type
object
Response Example (200 OK)
{
  "template_name": "temp1",
  "protocol_name": "EthernetIP",
  "tag_list": [
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 0,
      "type": "uint16",
      "id": "do0",
      "quantity": 2
    },
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 2,
      "type": "uint16",
      "id": "do1",
      "quantity": 2
    }
  ]
}
tag

POST /tags/{type}/templates/{name}

Adds a new IO template by the given protocol and template name.

template_name: string
tag_list: object[]
object
op: string
polling_period_ms: integer
request_timeout_ms: integer
address: integer
type: string
id: string
quantity: integer
type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

Request Example
{
  "template_name": "temp1",
  "protocol_name": "EthernetIP",
  "tag_list": [
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 0,
      "type": "uint16",
      "id": "do0",
      "quantity": 2
    },
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 2,
      "type": "uint16",
      "id": "do1",
      "quantity": 2
    }
  ]
}
200 OK

Successful response.

tag

PUT /tags/{type}/templates/{name}

Updates an IO template by the given protocol and template name.

template_name: string
tag_list: object[]
object
op: string
polling_period_ms: integer
request_timeout_ms: integer
address: integer
type: string
id: string
quantity: integer
type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

Request Example
{
  "template_name": "temp1",
  "protocol_name": "EthernetIP",
  "tag_list": [
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 0,
      "type": "uint16",
      "id": "do0",
      "quantity": 2
    },
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 2,
      "type": "uint16",
      "id": "do1",
      "quantity": 2
    }
  ]
}
200 OK

Successful response.

tag

DELETE /tags/{type}/templates/{name}

Removes an IO template by the given protocol and template name.

type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

200 OK

Successful removing the template.

tag

GET /tags/{type}/devices

Gets all devices that refer to the given template, | otherwise remove all devices of the type

type: string fieldbus, EthernetIP, modbus
in path

(no description)

template: string
in query

(no description)

200 OK

Succeed to get device list

type
object
Response Example (200 OK)
{
  "device_list": [
    {
      "name": "adapter_device0",
      "interface": "eth0",
      "template_name": "temp4",
      "total_tags": 20,
      "success_tags": 16,
      "t_to_o_packet_rate": 100,
      "o_to_t_data_size": 496,
      "connection_type": 0,
      "o_to_t_real_time_format": 1,
      "o_to_t_instance": 100,
      "encapsulation_timeout": 0,
      "configuration_instance": 1,
      "adapter_port": 44818,
      "t_to_o_data_size": 496,
      "adapter_ip": "10.144.33.155",
      "t_to_o_real_time_format": 0,
      "o_to_t_packet_rate": 100,
      "timeout_multiplier": 2,
      "t_to_o_instance": 200
    }
  ]
}
tag

DELETE /tags/{type}/devices

Removes all devices that refer to the given template

device_list: object[]
object
name: string
interface: string
template_name: string
type: string fieldbus, EthernetIP, modbus
in path

(no description)

template: string
in query

(no description)

Request Example
{
  "device_list": [
    {
      "name": "adapter_device0",
      "interface": "eth0",
      "template_name": "temp4",
      "total_tags": 20,
      "success_tags": 16,
      "t_to_o_packet_rate": 100,
      "o_to_t_data_size": 496,
      "connection_type": 0,
      "o_to_t_real_time_format": 1,
      "o_to_t_instance": 100,
      "encapsulation_timeout": 0,
      "configuration_instance": 1,
      "adapter_port": 44818,
      "t_to_o_data_size": 496,
      "adapter_ip": "10.144.33.155",
      "t_to_o_real_time_format": 0,
      "o_to_t_packet_rate": 100,
      "timeout_multiplier": 2,
      "t_to_o_instance": 200
    }
  ]
}
200 OK

Succeed to remove devices

tag

POST /tags/{type}/devices/{name}

Adds an device config by given protocol and device name.

name: string
interface: string
template_name: string
type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

Request Example
{
  "name": "adapter_device0",
  "interface": "eth0",
  "template_name": "temp4",
  "total_tags": 20,
  "success_tags": 16,
  "t_to_o_packet_rate": 100,
  "o_to_t_data_size": 496,
  "connection_type": 0,
  "o_to_t_real_time_format": 1,
  "o_to_t_instance": 100,
  "encapsulation_timeout": 0,
  "configuration_instance": 1,
  "adapter_port": 44818,
  "t_to_o_data_size": 496,
  "adapter_ip": "10.144.33.155",
  "t_to_o_real_time_format": 0,
  "o_to_t_packet_rate": 100,
  "timeout_multiplier": 2,
  "t_to_o_instance": 200
}
200 OK

Ok.

tag

PUT /tags/{type}/devices/{name}

Updates an device config by given protocol and device name.

name: string
interface: string
template_name: string
type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

Request Example
{
  "name": "adapter_device0",
  "interface": "eth0",
  "template_name": "temp4",
  "total_tags": 20,
  "success_tags": 16,
  "t_to_o_packet_rate": 100,
  "o_to_t_data_size": 496,
  "connection_type": 0,
  "o_to_t_real_time_format": 1,
  "o_to_t_instance": 100,
  "encapsulation_timeout": 0,
  "configuration_instance": 1,
  "adapter_port": 44818,
  "t_to_o_data_size": 496,
  "adapter_ip": "10.144.33.155",
  "t_to_o_real_time_format": 0,
  "o_to_t_packet_rate": 100,
  "timeout_multiplier": 2,
  "t_to_o_instance": 200
}
200 OK

Ok.

tag

DELETE /tags/{type}/devices/{name}

Removes an device config by given protocol and device name.

type: string EthernetIP, modbus
in path

(no description)

name: string
in path

(no description)

200 OK

OK.

tag

GET /tags/{type}/configs

Export all io configuration from fieldbus folders

type: string fieldbus
in path

(no description)

200 OK

Successful export IO configuration.

type
object
Response Example (200 OK)
{
  "url": "/run/shm/tag-io-configs.tar.gz"
}
tag

PUT /tags/{type}/configs

Import all io configuration to fieldbus folders

type: string fieldbus
in path

(no description)

200 OK

Successful import IO configuration.

type
object
Response Example (200 OK)
{
  "fieldbus": [
    {
      "name": "string",
      "status": "string"
    }
  ]
}

Schema Definitions

DeleteTemplateList: object

list: object[]
object
template_name: string
protocol_name: string
Example
{
  "list": [
    {
      "template_name": "temp1",
      "protocol_name": "EthernetIP"
    }
  ]
}

TemplateList: object

list: object[]
object
template_name: string
tag_list: object[]
object
op: string
polling_period_ms: integer
request_timeout_ms: integer
address: integer
type: string
id: string
quantity: integer
Example
{
  "list": [
    {
      "template_name": "temp1",
      "protocol_name": "EthernetIP",
      "tag_list": [
        {
          "op": "write",
          "polling_period_ms": 100,
          "request_timeout_ms": 10,
          "address": 0,
          "type": "uint16",
          "id": "do0",
          "quantity": 2
        },
        {
          "op": "write",
          "polling_period_ms": 100,
          "request_timeout_ms": 10,
          "address": 2,
          "type": "uint16",
          "id": "do1",
          "quantity": 2
        }
      ]
    }
  ]
}

Template: object

template_name: string
tag_list: object[]
object
op: string
polling_period_ms: integer
request_timeout_ms: integer
address: integer
type: string
id: string
quantity: integer
Example
{
  "template_name": "temp1",
  "protocol_name": "EthernetIP",
  "tag_list": [
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 0,
      "type": "uint16",
      "id": "do0",
      "quantity": 2
    },
    {
      "op": "write",
      "polling_period_ms": 100,
      "request_timeout_ms": 10,
      "address": 2,
      "type": "uint16",
      "id": "do1",
      "quantity": 2
    }
  ]
}

Tag: object

srcName: string
tagName: string
dataType: string uint8, uint16, uint32, uint64, int16, int32, int64, float32, float64, string, boolean, bytearray
duration: integer (int32)
dataUnit: string
access: string ro, wo, rw
Example
{
  "srcName": "string",
  "tagName": "string",
  "dataType": "string",
  "duration": "integer (int32)",
  "dataUnit": "string",
  "access": "string"
}

TagList: object

tag_list: object[]
object
srcName: string
tagName: string
dataType: string uint8, uint16, uint32, uint64, int16, int32, int64, float32, float64, string, boolean, bytearray
duration: integer (int32)
dataUnit: string
access: string ro, wo, rw
Example
{
  "tag_list": [
    {
      "srcName": "device0",
      "tagName": "di0",
      "dataType": "uint16",
      "duration": 100,
      "dataUnit": "",
      "access": "ro"
    },
    {
      "srcName": "device0",
      "tagName": "di1",
      "dataType": "uint16",
      "duration": 100,
      "dataUnit": "",
      "access": "ro"
    }
  ]
}

ModbusTag: object

op: string
polling_period_ms: integer
request_timeout_ms: integer
address: integer
type: string
id: string
quantity: integer
Example
{
  "op": "string",
  "polling_period_ms": "integer",
  "request_timeout_ms": "integer",
  "address": "integer",
  "type": "string",
  "id": "string",
  "quantity": "integer"
}

Device: object

name: string
interface: string
template_name: string
Example
{
  "name": "adapter_device0",
  "interface": "eth0",
  "template_name": "temp4",
  "total_tags": 20,
  "success_tags": 16,
  "t_to_o_packet_rate": 100,
  "o_to_t_data_size": 496,
  "connection_type": 0,
  "o_to_t_real_time_format": 1,
  "o_to_t_instance": 100,
  "encapsulation_timeout": 0,
  "configuration_instance": 1,
  "adapter_port": 44818,
  "t_to_o_data_size": 496,
  "adapter_ip": "10.144.33.155",
  "t_to_o_real_time_format": 0,
  "o_to_t_packet_rate": 100,
  "timeout_multiplier": 2,
  "t_to_o_instance": 200
}

DeviceList: object

device_list: object[]
object
name: string
interface: string
template_name: string
Example
{
  "device_list": [
    {
      "name": "adapter_device0",
      "interface": "eth0",
      "template_name": "temp4",
      "total_tags": 20,
      "success_tags": 16,
      "t_to_o_packet_rate": 100,
      "o_to_t_data_size": 496,
      "connection_type": 0,
      "o_to_t_real_time_format": 1,
      "o_to_t_instance": 100,
      "encapsulation_timeout": 0,
      "configuration_instance": 1,
      "adapter_port": 44818,
      "t_to_o_data_size": 496,
      "adapter_ip": "10.144.33.155",
      "t_to_o_real_time_format": 0,
      "o_to_t_packet_rate": 100,
      "timeout_multiplier": 2,
      "t_to_o_instance": 200
    }
  ]
}

Export: object

url: string
Example
{
  "url": "/run/shm/tag-io-configs.tar.gz"
}

Import: object

fieldbus: object[]
object
name: string
status: string
Example
{
  "fieldbus": [
    {
      "name": "string",
      "status": "string"
    }
  ]
}