Channel metadata service#

Endpoints for retrieving and updating channel metadata.

OpenAPI file: ChannelMetadataService.json

Endpoints#

Get channel metadata#

POST /timeseries/channel-metadata/v1/channel-metadata/get

Get the metadata for a channel.

Body

channelIdentifier ChannelIdentifier required

​

Fields of ChannelIdentifier
channelName string required

​

dataSourceRid string (RID) required

​

Response

channelIdentifier ChannelIdentifier

​

Fields of ChannelIdentifier
channelName string

​

dataSourceRid string (RID)

​

description string

​

unit string

​

dataType SeriesDataType

​

Values of SeriesDataType
DOUBLE

​

STRING

​

LOG

​

INT

​

UINT

​

DOUBLE_ARRAY

​

STRING_ARRAY

​

STRUCT

​

VIDEO

​

SPATIAL

​

channelKind ChannelKind

Classifies how the channel is used. Omitted values should be treated as STANDARD.

Values of ChannelKind
STANDARD

​

COMMAND

​

Request

curl -X POST "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/get" \
  -H "Authorization: Bearer <api key>" \
  -H "Content-Type: application/json" \
  --data '{
  "channelIdentifier": {
    "channelName": "<channel>",
    "dataSourceRid": "<data source rid>"
  }
}'
import requests

response = requests.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/get",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "channelIdentifier": {
            "channelName": "<channel>",
            "dataSourceRid": "<data source rid>",
        },
    },
)
response.raise_for_status()
print(response.json())
import httpx

response = httpx.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/get",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "channelIdentifier": {
            "channelName": "<channel>",
            "dataSourceRid": "<data source rid>",
        },
    },
)
response.raise_for_status()
print(response.json())
import asyncio

import aiohttp


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        async with session.post(
            "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/get",
            headers={"Authorization": "Bearer <api key>"},
            json={
                "channelIdentifier": {
                    "channelName": "<channel>",
                    "dataSourceRid": "<data source rid>",
                },
            },
        ) as response:
            response.raise_for_status()
            print(await response.json())


asyncio.run(main())

Response: 200

{
  "channelIdentifier": {
    "channelName": "<channel>",
    "dataSourceRid": "<data source rid>"
  },
  "description": "<description>",
  "unit": "<unit>",
  "dataType": "DOUBLE",
  "channelKind": "STANDARD"
}

Batch get channel metadata#

POST /timeseries/channel-metadata/v1/channel-metadata/batch-get

Batch get the metadata for multiple channels. If some channels cannot be found or authorized, they will be omitted from the response.

Body

requests array of GetChannelMetadataRequest

​

Fields of GetChannelMetadataRequest
channelIdentifier ChannelIdentifier required

​

Fields of ChannelIdentifier
channelName string required

​

dataSourceRid string (RID) required

​

Response

responses array of ChannelMetadata

​

Fields of ChannelMetadata
channelIdentifier ChannelIdentifier

​

Fields of ChannelIdentifier
channelName string

​

dataSourceRid string (RID)

​

description string

​

unit string

​

dataType SeriesDataType

​

Values of SeriesDataType
DOUBLE

​

STRING

​

LOG

​

INT

​

UINT

​

DOUBLE_ARRAY

​

STRING_ARRAY

​

STRUCT

​

VIDEO

​

SPATIAL

​

channelKind ChannelKind

Classifies how the channel is used. Omitted values should be treated as STANDARD.

Values of ChannelKind
STANDARD

​

COMMAND

​

Request

curl -X POST "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-get" \
  -H "Authorization: Bearer <api key>" \
  -H "Content-Type: application/json" \
  --data '{
  "requests": [
    {
      "channelIdentifier": {
        "channelName": "<channel>",
        "dataSourceRid": "<data source rid>"
      }
    }
  ]
}'
import requests

response = requests.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-get",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "requests": [
            {
                "channelIdentifier": {
                    "channelName": "<channel>",
                    "dataSourceRid": "<data source rid>",
                },
            },
        ],
    },
)
response.raise_for_status()
print(response.json())
import httpx

response = httpx.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-get",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "requests": [
            {
                "channelIdentifier": {
                    "channelName": "<channel>",
                    "dataSourceRid": "<data source rid>",
                },
            },
        ],
    },
)
response.raise_for_status()
print(response.json())
import asyncio

import aiohttp


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        async with session.post(
            "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-get",
            headers={"Authorization": "Bearer <api key>"},
            json={
                "requests": [
                    {
                        "channelIdentifier": {
                            "channelName": "<channel>",
                            "dataSourceRid": "<data source rid>",
                        },
                    },
                ],
            },
        ) as response:
            response.raise_for_status()
            print(await response.json())


asyncio.run(main())

Response: 200

{
  "responses": [
    {
      "channelIdentifier": {
        "channelName": "<channel>",
        "dataSourceRid": "<data source rid>"
      },
      "description": "<description>",
      "unit": "<unit>",
      "dataType": "DOUBLE",
      "channelKind": "STANDARD"
    }
  ]
}

Update channel metadata#

POST /timeseries/channel-metadata/v1/channel-metadata/update

Update the metadata for a channel.

Body

channelIdentifier ChannelIdentifier required

​

Fields of ChannelIdentifier
channelName string required

​

dataSourceRid string (RID) required

​

description string

​

unitUpdate UnitUpdate

​

Set type to "unit".

unit string

​

Set type to "clearUnit".

clearUnit Empty

​

Response

channelIdentifier ChannelIdentifier

​

Fields of ChannelIdentifier
channelName string

​

dataSourceRid string (RID)

​

description string

​

unit string

​

dataType SeriesDataType

​

Values of SeriesDataType
DOUBLE

​

STRING

​

LOG

​

INT

​

UINT

​

DOUBLE_ARRAY

​

STRING_ARRAY

​

STRUCT

​

VIDEO

​

SPATIAL

​

channelKind ChannelKind

Classifies how the channel is used. Omitted values should be treated as STANDARD.

Values of ChannelKind
STANDARD

​

COMMAND

​

Request

curl -X POST "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/update" \
  -H "Authorization: Bearer <api key>" \
  -H "Content-Type: application/json" \
  --data '{
  "channelIdentifier": {
    "channelName": "<channel>",
    "dataSourceRid": "<data source rid>"
  }
}'
import requests

response = requests.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/update",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "channelIdentifier": {
            "channelName": "<channel>",
            "dataSourceRid": "<data source rid>",
        },
    },
)
response.raise_for_status()
print(response.json())
import httpx

response = httpx.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/update",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "channelIdentifier": {
            "channelName": "<channel>",
            "dataSourceRid": "<data source rid>",
        },
    },
)
response.raise_for_status()
print(response.json())
import asyncio

import aiohttp


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        async with session.post(
            "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/update",
            headers={"Authorization": "Bearer <api key>"},
            json={
                "channelIdentifier": {
                    "channelName": "<channel>",
                    "dataSourceRid": "<data source rid>",
                },
            },
        ) as response:
            response.raise_for_status()
            print(await response.json())


asyncio.run(main())

Response: 200

{
  "channelIdentifier": {
    "channelName": "<channel>",
    "dataSourceRid": "<data source rid>"
  },
  "description": "<description>",
  "unit": "<unit>",
  "dataType": "DOUBLE",
  "channelKind": "STANDARD"
}

Batch update channel metadata#

POST /timeseries/channel-metadata/v1/channel-metadata/batch-update

Batch update the metadata for multiple channels. If some channels cannot be found or authorized, no metadata will be updated for any of the channels in the request.

Body

requests array of UpdateChannelMetadataRequest

​

Fields of UpdateChannelMetadataRequest
channelIdentifier ChannelIdentifier required

​

Fields of ChannelIdentifier
channelName string required

​

dataSourceRid string (RID) required

​

description string

​

unitUpdate UnitUpdate

​

Set type to "unit".

unit string

​

Set type to "clearUnit".

clearUnit Empty

​

Response

responses array of ChannelMetadata

​

Fields of ChannelMetadata
channelIdentifier ChannelIdentifier

​

Fields of ChannelIdentifier
channelName string

​

dataSourceRid string (RID)

​

description string

​

unit string

​

dataType SeriesDataType

​

Values of SeriesDataType
DOUBLE

​

STRING

​

LOG

​

INT

​

UINT

​

DOUBLE_ARRAY

​

STRING_ARRAY

​

STRUCT

​

VIDEO

​

SPATIAL

​

channelKind ChannelKind

Classifies how the channel is used. Omitted values should be treated as STANDARD.

Values of ChannelKind
STANDARD

​

COMMAND

​

Request

curl -X POST "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-update" \
  -H "Authorization: Bearer <api key>" \
  -H "Content-Type: application/json" \
  --data '{
  "requests": [
    {
      "channelIdentifier": {
        "channelName": "<channel>",
        "dataSourceRid": "<data source rid>"
      }
    }
  ]
}'
import requests

response = requests.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-update",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "requests": [
            {
                "channelIdentifier": {
                    "channelName": "<channel>",
                    "dataSourceRid": "<data source rid>",
                },
            },
        ],
    },
)
response.raise_for_status()
print(response.json())
import httpx

response = httpx.post(
    "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-update",
    headers={"Authorization": "Bearer <api key>"},
    json={
        "requests": [
            {
                "channelIdentifier": {
                    "channelName": "<channel>",
                    "dataSourceRid": "<data source rid>",
                },
            },
        ],
    },
)
response.raise_for_status()
print(response.json())
import asyncio

import aiohttp


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        async with session.post(
            "https://api.gov.nominal.io/api/timeseries/channel-metadata/v1/channel-metadata/batch-update",
            headers={"Authorization": "Bearer <api key>"},
            json={
                "requests": [
                    {
                        "channelIdentifier": {
                            "channelName": "<channel>",
                            "dataSourceRid": "<data source rid>",
                        },
                    },
                ],
            },
        ) as response:
            response.raise_for_status()
            print(await response.json())


asyncio.run(main())

Response: 200

{
  "responses": [
    {
      "channelIdentifier": {
        "channelName": "<channel>",
        "dataSourceRid": "<data source rid>"
      },
      "description": "<description>",
      "unit": "<unit>",
      "dataType": "DOUBLE",
      "channelKind": "STANDARD"
    }
  ]
}

Errors#

Errors shows how these errors are sent.

Each error’s errorName is ChannelMetadata: followed by its name below.

Status

Name

Notes

404

ChannelsNotFound

Types#

ChannelIdentifier#

channelName string required

​

dataSourceRid string (RID) required

​

ChannelKind#

Classifies how a channel is used. COMMAND channels accept commands through the Command Service.

STANDARD

​

COMMAND

​

ChannelMetadata#

channelIdentifier ChannelIdentifier required

​

description string

​

unit string

​

dataType SeriesDataType

​

channelKind ChannelKind

Classifies how the channel is used. Omitted values should be treated as STANDARD.

Empty#

An empty JSON object, {}.

GetChannelMetadataRequest#

channelIdentifier ChannelIdentifier required

​

SeriesDataType#

The data types that are available for querying.

DOUBLE

​

STRING

​

LOG

​

INT

​

UINT

​

DOUBLE_ARRAY

​

STRING_ARRAY

​

STRUCT

​

VIDEO

​

SPATIAL

​

UnitUpdate#

UnitUpdate is used to either set a unit, or to clear an existing unit.

Set type to the name of one of the other fields, and set only that field.

unit string

​

clearUnit Empty

​

UpdateChannelMetadataRequest#

channelIdentifier ChannelIdentifier required

​

description string

​

unitUpdate UnitUpdate

​

Page design based on Scalar, MIT License.