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
channelIdentifierChannelIdentifierrequired
Fields of
ChannelIdentifierchannelNamestring required
dataSourceRidstring (RID) required
Response
channelIdentifierChannelIdentifier
Fields of
ChannelIdentifierchannelNamestring
dataSourceRidstring (RID)
descriptionstring
unitstring
dataTypeSeriesDataType
Values of
SeriesDataTypeDOUBLE
STRING
LOG
INT
UINT
DOUBLE_ARRAY
STRING_ARRAY
STRUCT
VIDEO
SPATIAL
channelKindChannelKindClassifies how the channel is used. Omitted values should be treated as STANDARD.
Values of
ChannelKindSTANDARD
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
requestsarray ofGetChannelMetadataRequest
Fields of
GetChannelMetadataRequestchannelIdentifierChannelIdentifierrequired
Fields of
ChannelIdentifierchannelNamestring required
dataSourceRidstring (RID) required
Response
responsesarray ofChannelMetadata
Fields of
ChannelMetadatachannelIdentifierChannelIdentifier
Fields of
ChannelIdentifierchannelNamestring
dataSourceRidstring (RID)
descriptionstring
unitstring
dataTypeSeriesDataType
Values of
SeriesDataTypeDOUBLE
STRING
LOG
INT
UINT
DOUBLE_ARRAY
STRING_ARRAY
STRUCT
VIDEO
SPATIAL
channelKindChannelKindClassifies how the channel is used. Omitted values should be treated as STANDARD.
Values of
ChannelKindSTANDARD
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
channelIdentifierChannelIdentifierrequired
Fields of
ChannelIdentifierchannelNamestring required
dataSourceRidstring (RID) required
descriptionstring
unitUpdateUnitUpdate
Set
typeto"unit".unitstring
Set
typeto"clearUnit".clearUnitEmpty
Response
channelIdentifierChannelIdentifier
Fields of
ChannelIdentifierchannelNamestring
dataSourceRidstring (RID)
descriptionstring
unitstring
dataTypeSeriesDataType
Values of
SeriesDataTypeDOUBLE
STRING
LOG
INT
UINT
DOUBLE_ARRAY
STRING_ARRAY
STRUCT
VIDEO
SPATIAL
channelKindChannelKindClassifies how the channel is used. Omitted values should be treated as STANDARD.
Values of
ChannelKindSTANDARD
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
requestsarray ofUpdateChannelMetadataRequest
Fields of
UpdateChannelMetadataRequestchannelIdentifierChannelIdentifierrequired
Fields of
ChannelIdentifierchannelNamestring required
dataSourceRidstring (RID) required
descriptionstring
unitUpdateUnitUpdate
Set
typeto"unit".unitstring
Set
typeto"clearUnit".clearUnitEmpty
Response
responsesarray ofChannelMetadata
Fields of
ChannelMetadatachannelIdentifierChannelIdentifier
Fields of
ChannelIdentifierchannelNamestring
dataSourceRidstring (RID)
descriptionstring
unitstring
dataTypeSeriesDataType
Values of
SeriesDataTypeDOUBLE
STRING
LOG
INT
UINT
DOUBLE_ARRAY
STRING_ARRAY
STRUCT
VIDEO
SPATIAL
channelKindChannelKindClassifies how the channel is used. Omitted values should be treated as STANDARD.
Values of
ChannelKindSTANDARD
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 |
|
Types#
ChannelIdentifier#
channelNamestring required
dataSourceRidstring (RID) required
ChannelKind#
Classifies how a channel is used. COMMAND channels accept commands through the Command Service.
STANDARD
COMMAND
ChannelMetadata#
channelIdentifierChannelIdentifierrequired
descriptionstring
unitstring
dataTypeSeriesDataType
channelKindChannelKindClassifies how the channel is used. Omitted values should be treated as STANDARD.
Empty#
An empty JSON object, {}.
GetChannelMetadataRequest#
channelIdentifierChannelIdentifierrequired
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.
unitstring
clearUnitEmpty
UpdateChannelMetadataRequest#
channelIdentifierChannelIdentifierrequired
descriptionstring
unitUpdateUnitUpdate
Page design based on Scalar, MIT License.