Skip to main content
Version: 2.3.x

Tag APIs (2.0.0)

Download OpenAPI specification:Download

TagService and TagHub API

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

tag

Get the list of all tags

Authorizations:
query Parameters
provider
string

Responses

Response samples

Content type
application/json
Example
{
  • "data": [
    ]
}

monitor

Get monitoring tag values

Returns value of tags in taghub which queried by different sources and time

Authorizations:
path Parameters
provider
required
string

Provider Name - (system, module name, app name)

source
required
string

Source Name - (device name, function name)

query Parameters
tags
string

Tag Name - format (tags=name1,name2,name3)

ms
integer

history data search in milliseconds

streamInterval
integer

create a http streaming connection and response data by milliseconds time interval

compute
string
Value: "diff"

apply a compute method during streaming

onChanged
boolean

create a http streaming connection and response data on tag value changed

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

access

Direct read method by tag

Only 'r', 'rw' access type can work.

Authorizations:
path Parameters
provider
required
string
source
required
string
tag
required
string

Responses

Response samples

Content type
application/json
{
  • "prvdName": "modbus_tcp_master",
  • "srcName": "ioLogik",
  • "tagName": "di0",
  • "timestamp": "1560322153374",
  • "dataType": "uint16",
  • "dataValue": 1
}

Direct write method by tag

Only 'w', 'rw' access type can work.

Authorizations:
path Parameters
provider
required
string
source
required
string
tag
required
string
Request Body schema: application/json
dataType
string
Enum: "uint8" "uint16" "uint32" "uint64" "int8" "int16" "int32" "int64" "float" "double" "string" "boolean" "raw"
dataValue
object

Responses

Request samples

Content type
application/json
{
  • "dataType": "int16",
  • "dataValue": 1
}

Response samples

Content type
application/json
{
  • "message": "string"
}

virtual

Create an user-defined virtual tag

Authorizations:
Request Body schema: application/json
prvdName
required
string <= 1024
srcName
required
string <= 1024
tagName
required
string <= 1024
dataType
required
string
Enum: "uint8" "uint16" "uint32" "uint64" "int8" "int16" "int32" "int64" "float" "double" "string" "boolean" "raw"
dataSize
integer <uint32> [ 0 .. 4294967295 ]

The field is used to specify the size of byte-array, raw, and string. It's useless for others types.

dataUnit
string [ 0 .. 16 ]
access
required
string
Enum: "r" "w" "rw"

Responses

Request samples

Content type
application/json
Example
{
  • "prvdName": "virtual",
  • "srcName": "user",
  • "tagName": "int64_t",
  • "dataType": "int64",
  • "dataUnit": "unit",
  • "access": "r"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an user-defined virtual tag

Authorizations:
Request Body schema: application/json
prvdName
required
string <= 1024
srcName
required
string <= 1024
tagName
required
string <= 1024
dataType
required
string
Enum: "uint8" "uint16" "uint32" "uint64" "int8" "int16" "int32" "int64" "float" "double" "string" "boolean" "raw"
dataSize
integer <uint32> [ 0 .. 4294967295 ]

The field is used to specify the size of byte-array, raw, and string. It's useless for others types.

dataUnit
string [ 0 .. 16 ]
access
required
string
Enum: "r" "w" "rw"

Responses

Request samples

Content type
application/json
Example
{
  • "prvdName": "virtual",
  • "srcName": "user",
  • "tagName": "int64_t",
  • "dataType": "int64",
  • "dataUnit": "unit",
  • "access": "r"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an user-defined virtual tag

Authorizations:
Request Body schema: application/json
prvdName
required
string
srcName
required
string
tagName
required
string

Responses

Request samples

Content type
application/json
{
  • "prvdName": "virtual",
  • "srcName": "user",
  • "tagName": "defined"
}

Response samples

Content type
application/json
{
  • "data": [
    ]
}