Skip to main content
Version: 4.0

Get Attribute Unit List

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/attribute/unit/list
Query parameters
Table 1. Query parameter description
ParameterTypeDescription
typestringRequired. Attribute unit types, including visible and all.
keywordstringFuzzy match the name and alias.
Response
  • 200: Successful.
{
"code" : 200,
"data" : [ {
"id" : 16667,
"name" : "km"
} ],
"detail" : "string",
"message" : "ok"
}
  • 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}

Get Attributes by Search Conditions

Comprehensive attribute query interface, and you can use it to run complex filters on attributes. For example: Get attributes under instance i1, bound with the label system.label2, not belong to the app test and return attribute values.

instanceNames=i1&labelFullNames=system.label2&
excludeAppNames=true&appNames=test&needValue=true
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/attributes
Query parameters
Table 1. Query parameter description
ParameterTypeDescription
hasBindRelationbooleanWhether the attributes are bound with others.
withBindRelationbooleanWhether the returned data is bound with others.
historicalbooleanWhether there is historical data.
displayablebooleanWhether to display main field.
needValuebooleanWhether to return attribute values. Used together with instanceNames, and when the returned attribute is inherited by multiple instances, corresponding value is the attribute value of the last instance from the instanceNames list.
needInstanceInfobooleanWhether to return instance name and alias. Used together with instanceNames, and when there are multiple instances, information of the last instance from the instanceNames list will be returned.
excludeLabelFullNamesbooleanWhether to get data without specific labels. Used together with labelFullNames.
excludeAppNamesbooleanWhether to get data that is not under specified app. Used together with appNames.
containsInheritedMetadatabooleanWhether to contain inherited metadata. Used together with specific template or instance.
containsSelfMetadatabooleanWhether to contain metadata. Used together with specific template or instance.
needKnowAlarmbooleanWhether to get alarm status. If it is true, the returned field existAlarm is valid.
dataTypesarray-
filterNamesarrayFiltering attribute aliases.
filterNamespacestringFiltering namespaces.
keywordstringFuzzy match the name and alias.
pageIndexintegerRequired. Page number. The default is 1.
pageSizeintegerRequired. The number of data on each page. The default is 20 and the maximum is 500.
namespacesarray-
labelFullNamesarrayLabel namespace.
appNamesarray-
instanceNamesarrayInstance alias list that contains the metadata. When it is not empty, templateNames is invalid.
sourceFunctionSetFullNamesarraySource function set namespace.
templateFullNamesarrayTemplate namespace that contains the metadata.
functionSetFullNamesarrayFunction set namespace that contains the metadata.
Response
  • 200: Successful.
{
"list" : [ {
"comment" : "this ia s test",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"id" : 12345,
"templateId" : 12222,
"sourceFunctionSetId" : 12221,
"instanceId" : "12223",
"labelIds" : [ 11111 ],
"deletable" : true,
"editable" : true,
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"namespace" : "system",
"unit" : "kg",
"templateName" : "Template_12",
"templateNamespace" : "system",
"existAlarm" : false, //no existing alarms
"value" : "string", //attribute value
"instanceEnName" : "string",
"instanceDisplayName" : "string"
} ],
"pagination" : [ {
"total" : 10, //total data
"pageSize" : 20,
"current" : 1 //current page number
} ]
}
  • 400: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}

Get Attribute Details by Attribute Namespace and Alias

Get specified attributes and returns nothing when there is no required results. The results can be at most 100.

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/instance/attributes
Query parameters

instanceAttributes: Instance attribute alias. In the format of attribute namespace.attribute alias.

Response
  • 200: Successful.
[ {
"comment" : "this is a test",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"id" : 12345,
"templateId" : 12222,
"sourceFunctionSetId" : 12221,
"instanceId" : "12223",
"labelIds" : [ 11111 ],
"deletable" : true,
"editable" : true,
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"namespace" : "system",
"unit" : "kg",
"templateName" : "Template_12",
"templateNamespace" : "system",
"existAlarm" : false,
"instanceEnName" : "instance1",
"instanceDisplayName" : "instance1"
} ]
  • 400: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}

Add Template Attribute

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute
Request Body
{
"comment" : "this is a test",
"dataType" : "LONG", //required
"subDataType" : "LONG", //required when dataType is set to SYSTEMCODE
"dataTypePrecision" : 0, //required when dataType is set to DECIMAL. leave it null for other types
"dataTypeScale" : 0, //required when dataType is set to DECIMAL
"defaultValue" : "666",
"display" : false, //whether is main display field
"displayName" : "p1", //required
"enName" : "p1", //required
"hasKeyRelation" : false, //whether primary or foreign key relations exist
"historical" : false, //required. whether to save history data. Leave it empty for DECIMAL, FILE and OBJECT data types
"persistent" : false, //required
"readWriteMode" : "READ_ONLY", //required
"stringMaxLength" : 0, //required when dataType is set to string
"unique" : false,
"valueScale" : 2, //required when dataType is set to FLOAT/DOUBLE/DECIMAL
"appAccessMode" : "PUBLIC", //required
"appName" : "system", //required
"appShowName" : "system",
"namespace" : "system",
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"unit" : "kg",
"compress" : true, //whether to set compress parameter
"paramValue" : "0.2", //set when setting compress to true
"paramUnit" : "%", //set when setting compress to true
"maxRisingPeriod" : 600, //set when setting compress to true
"labelIds" : [ 12333 ]
}
Response
  • 200: Successful.
{
"code" : 200,
"data" : 19999,
"detail" : "string",
"message" : "ok"
}
  • 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}

Get Created Attributes of Current Template

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute/self
Query Parameter
Table 1. Query parameter description
ParameterTypeDescription
templateNamespacestring-
templateNamestring-
pageIndexintegerRequired. Page number. The default is 1.
pageSizeintegerRequired. The number of data on each page. The default is 20 and the maximum is 500.
Response
  • 200: Successful.
    {
    "code" : 200,
    "data" : {
    "data" : [ {
    "comment" : "this is a test template",
    "dataType" : "LONG",
    "subDataType" : "LONG",
    "dataTypePrecision" : 0,
    "dataTypeScale" : 0,
    "defaultValue" : "666",
    "display" : false,
    "displayName" : "p1",
    "enName" : "p1",
    "hasKeyRelation" : false,
    "historical" : false,
    "persistent" : false,
    "readWriteMode" : "READ_ONLY",
    "stringMaxLength" : 0,
    "unique" : false,
    "valueScale" : 2,
    "id" : 12345,
    "templateId" : 12222,
    "sourceFunctionSetId" : 12221,
    "instanceId" : "12223",
    "labelIds" : [ 11111 ],
    "deletable" : true,
    "editable" : true,
    "max" : 100,
    "min" : 0,
    "maxValue" : 100.88,
    "minValue" : 0.88,
    "namespace" : "system",
    "unit" : "kg",
    "templateName" : "Template_12",
    "templateNamespace" : "system"
    } ],
    "pageIndex" : 1,
    "pageSize" : 20,
    "total" : 100,
    },
    "detail" : "string",
    "message" : "ok"
    }
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }

Edit Template Attribute

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute/{attributeNamespace}/{attributeName}
Request body
{
"appAccessMode" : "PUBLIC", //PUBLIC or PRIVATE
"comment" : "edit attribute",
"compress" : false,
"defaultValue" : "12",
"display" : false,
"displayName" : "udpateAttribute1",
"historical" : false,
"id" : 16668,
"labelIds" : [ 15555 ],
"max" : 100,
"maxRisingPeriod" : 900,
"min" : 1,
"maxValue" : 100.88,
"minValue" : 0.88,
"paramUnit" : "%",
"paramValue" : "0.2",
"persistent" : false,
"readWriteMode" : "READ_ONLY", //READ_ONLY or READ_WRITE
"unique" : false,
"unit" : "kg",
"useDisplayField" : false, //whether to enable main display field
"valueScale" : 2
}
Response
  • 200: Successful.
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }

Delete Template Attribute

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute/{attributeNamespace}/{attributeName}
Response
  • 200: Successful.
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }

Add Entity Instance Extension Attribute

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/entity/{instanceName}/attribute
Request Body
{
"comment" : "this is a test template",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"appAccessMode" : "PUBLIC",
"appName" : "system",
"appShowName" : "system",
"namespace" : "system",
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"unit" : "kg",
"compress" : true,
"paramValue" : "0.2", //compress parameter value
"paramUnit" : "%", //compress parameter unit
"maxRisingPeriod" : 600, //compress parameter maximum rising period
"labelIds" : [ 12333 ]
}
Response
  • 200: Successful.
    {
    "code" : 200,
    "data" : 19999,
    "detail" : "string",
    "message" : "ok"
    }
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }

Edit Entity Instance Extension Attribute

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/entity/{instanceName}/attribute/{attributeNamespace}/{attributeName}
Request Body
{
"appAccessMode" : "PUBLIC",
"comment" : "edit attribute",
"compress" : false,
"defaultValue" : "12",
"display" : false,
"displayName" : "udpateAttribute1",
"historical" : false,
"id" : 16668,
"labelIds" : [ 15555 ],
"max" : 100,
"maxRisingPeriod" : 900,
"min" : 1,
"maxValue" : 100.88,
"minValue" : 0.88,
"paramUnit" : "%",
"paramValue" : "0.2",
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"unique" : false,
"unit" : "kg",
"useDisplayField" : false,
"valueScale" : 2
}
Response
  • 200: Successful.
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }

Delete Entity Instance Extension Attribute

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/entity/{instanceName}/attribute/{attributeNamespace}/{attributeName}
Response
  • 200: Successful.
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }

Get Attribute of Current Instance

Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/instance/{instanceName}/attribute/self
Response
  • 200: Successful.
    {
    "code" : 200,
    "data" : {
    "data" : [ {
    "comment" : "this is a test template",
    "dataType" : "LONG",
    "subDataType" : "LONG",
    "dataTypePrecision" : 0,
    "dataTypeScale" : 0,
    "defaultValue" : "666",
    "display" : false,
    "displayName" : "p1",
    "enName" : "p1",
    "hasKeyRelation" : false,
    "historical" : false,
    "persistent" : false,
    "readWriteMode" : "READ_ONLY",
    "stringMaxLength" : 0,
    "unique" : false,
    "valueScale" : 2,
    "id" : 12345,
    "templateId" : 12222,
    "sourceFunctionSetId" : 12221,
    "instanceId" : "12223",
    "labelIds" : [ 11111 ],
    "deletable" : true,
    "editable" : true,
    "max" : 100,
    "min" : 0,
    "maxValue" : 100.88,
    "minValue" : 0.88,
    "namespace" : "system",
    "unit" : "kg",
    "templateName" : "Template_12",
    "templateNamespace" : "system",
    "existAlarm" : false,
    "value" : "string",
    "instanceEnName" : "string",
    "instanceDisplayName" : "string"
    } ],
    "pageIndex" : 1,
    "pageSize" : 20,
    "total" : 100
    },
    "detail" : "string",
    "message" : "ok"
    }
  • 500: General internal error of OODM.
    {
    "code": 10001001,
    "data": {},
    "detail": "string",
    "message": "string"
    }