Read Ui Meta-Data Api
Read Ui Meta-Data Api
Description:
This API is used to read the UI Meta data to dynamically render the controls for selected type of gateway or child device. API returns UI meta
data with all required properties to render the individual UI control. API returns the complete Json structure to render the controls for the given
combination of vendor type and device type.
The device wrapper service is designed in a such way, it can easily accommodate any new type of vendor types in future and same is applicable
to read UI meta data API which is currently supporting two vendor types but in future more can be added with minimal changes.
URL:
api/devicewrapper/v1/uimetadata
Method:
POST
Headers:
N/A
Sample Request Payload:
1.
{
"vendorTypeName": "Starfish",
"deviceTypeName": "Child"
}
2.
{
"vendorTypeName": "Dashboard",
"deviceTypeName": "Child"
}
3.
{
"vendorTypeName": "Dashboard",
"deviceTypeName": "Gateway"
}
4.
{
"vendorTypeName": "Starfish",
"deviceTypeName": "Gateway"
}
Sample Response:
1.
{
"message": "UI Meta Data retrieved successfully for Starfish, Gatewa
y",
"data": [
{
"id": "ipAddress",
"label": "IP Address*",
"type": "text",
"rules": {
"required": true,
"pattern": {
"value": "^(?!0)(?!.*\\.$)((1?\\d?\\d|25[0-5]|2[0-4]\\d)
(\\.|$)){4}$",
"message": "Invalid IP Address"
}
}
},
{
"id": "serial",
"label": "Serial",
"type": "text"
},
{
"id": "macAddress",
"label": "Mac",
"type": "text"
},
{
"id": "publishRate",
"label": "Publish Rate*",
"options": [
{ "key": "1", "value": "00:01m" },
{ "key": "5", "value": "00:05m" },
{ "key": "15", "value": "00:15m" },
{ "key": "60", "value": "01:00hr" },
{ "key": "240", "value": "04:00hr" },
{ "key": "480", "value": "08:00hr" },
{ "key": "720", "value": "12:00hr" },
{ "key": "1440", "value": "24:00hr" }
],
"type": "select",
"rules": {
"required": true
},
"defaultValue": "5"
}
]
}
2.
{
"message": "UI Meta Data retrieved successfully for Starfish, Child"
,
"data": [
{
"id": "guid",
"label": "GUID*",
"type": "text",
"rules": {
"required": {
"value": true,
"message": "Guid Field Required"
},
"pattern": {
"value": "/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}
-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i",
"message": "Invalid GUID"
}
},
"fieldLimit": 36
}
]
}
3.
{
"message": "UI Meta Data retrieved successfully for Dashboard, Gatew
ay",
"data": [
{
"id": "guid",
"label": "GUID*",
"type": "text",
"rules": {
"required": {
"value": true,
"message": "Guid Field Required"
},
"pattern": {
"value": "/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}
-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i",
"message": "Invalid GUID"
}
},
"fieldLimit": 36
}
]
}
4.
{
"message": "UI Meta Data retrieved successfully for Dashboard, Child
",
"data": {}
}