Managing Historian Model

The Add Object Type API
Using this API, you can create an object type.
METHOD POST
URI https://<historianservername>/historian-model/v2/objectTypes
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/objectTypes
SAMPLE PAYLOAD
[
{
"name":"Vehicle",
"description":"Vehicle description",
"dataVariables":[],
"containedObjectTypes":[],
"objectTypeTemplates":[],
"lastModifiedUser":"",
"lastmodifiedTime":"",
"versionNumber":0
}
]
Table 1. Payload Parameters
Parameter Description Required? Data Type
name The object type name (must be unique). Yes String
description The description of the object type. No String
containedObjectTypes The list of contained types with details No Array
objectTypeTemplates The list of object type templates, along with their details. No Array
lastModifiedUser The username of the user who created the object type. Yes String
lastModifiedTime The current time. Yes String
versionNumber The version number of the object type. Start with 1 and increment by 1 each time you want to modify the object type. Yes Number
Table 2. Response Parameters
Parameter Data Type Description
detail String Description of the error.
error_code Integer The error code. A value of 0 indicates that the operation was successful.
status String The http request status.
title String The title of the error.
type String The type of the error.
The View Object Type API
Using this API, you can access an object type.
METHOD POST
URI https://<historianservername>/historian-model/v2/objectTypes/info
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/objectTypes/info
SAMPLE RESPONSE
{
"containedObjectTypes":[],
"dataVariables":[],
"description":"Vehicle description",
"lastModifiedUser":"XYZ.admin",
"lastmodifiedTime":"2022-01-21 08:58:20",
"name":"Vehicle",
"objectTypeTemplates":[{"containedObjectTypes":[],
"dataVariables":[],
"defaultTemplate":true,
"description":"Default_Template_Vehicle",
"lastModifiedUser":"XYZ.admin",
"lastmodifiedTime":"2022-01-21 08:58:20",
"name":"Default_Template_Vehicle",
"objectType":"Vehicle",
"substituteParameters":[],
"versionNumber":3}],
"versionNumber":3
}
SAMPLE PAYLOAD {"databaseName":"XYZ","name":"Vehicle"}
Table 3. Payload Parameters
Parameter Description Required? Data Type
name The object type name (must be unique). Yes String
databaseName The name of the Historian server. Yes String
Table 4. Response Parameters
Parameter Data Type Description
name String The object type name (must be unique).
description String The description of the object type.
containedObjectTypes Array The list of contained types with details
dataVariables Array The list of variables (with details) in the object type.
objectTypeTemplates Array The list of object type templates, along with their details.
lastModifiedUser String The username of the user who created the object type.
lastModifiedTime String The current time.
versionNumber Number The version number of the object type. Start with 1 and increment by 1 each time you want to modify the object type.
Table 5. objectTypeTemplates Array Parameters
Parameter Data Type Description
name String The object type name (must be unique).
description String The description of the object type.
containedObjectTypes Array The list of contained types with details
dataVariables Array The list of variables (with details) in the object type.
lastModifiedUser String The username of the user who created the object type.
lastModifiedTime String The current time.
versionNumber Number The version number of the object type. Start with 1 and increment by 1 each time you want to modify the object type.
ObjectType String The object type name.
substituteParameters Array Blank (not applicable)
The Update Object Type API
Using this API, you can modify an object type.
METHOD PUT
URI https://<historianservername>/historian-model/v2/objectTypes
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/objectTypes
SAMPLE RESPONSE Error code and message, specifying whether the object type has been modified (200 for success and other codes for failure).
HEADER
  • Content type: multipart/form-data
  • Boundary: ----WebKitFormBoundaryKeyName
SAMPLE PAYLOAD
------WebKitFormBoundaryViBtYYvOfWhTYyhH
Content-Disposition: form-data; name="objectTypeInfo"; filename="blob"
Content-Type: application/json

{
"containedObjectTypes":[],
"dataVariables":
[
{
"baseType":"NUMBER",
"description":"",
"name":"Speed",
"variableType":"Direct"
},
{
"baseType":"STRING",
"description":"",
"name":"Type",
"variableType":"InDirect"
}
],
"description":"Vehicle description",
"lastModifiedUser":"XYZ.admin",
"lastmodifiedTime":"2022-01-21 11:37:56",
"name":"Vehicle",
"objectTypeTemplates":
[
{
"containedObjectTypes":[],
"dataVariables":
[
{
"baseType":"NUMBER",
"description":"",
"name":"Speed",
"properties":
{"blockType":"AI",
"propertyDefinition":[]
},
"required":true,
"templateTagName":"",
"variableType":"DIRECT"
},
{
"baseType":"STRING",
"description":"",
"name":"Type",
"properties":
{
"blockType":"AI",
"propertyDefinition":[]
},
"required":true,
"templateTagName":"",
"variableType":"INDIRECT"
}
],
"defaultTemplate":true,
"description":"Default_Template_Vehicle",
"lastModifiedUser":"XYZ.admin",
"lastmodifiedTime":"2022-01-21 11:37:56",
"name":"Default_Template_Vehicle",
"objectType":"Vehicle",
"substituteParameters":[],
"versionNumber":5
}
],
"versionNumber":5,
"databaseName":"XYZ",
"containedObjectTypesChanges":
[
{
"newName":"",
"oldName":"Engine"
}
],
"dataVariablesChanges":
[
{
"newName":"",
"oldName":"Color"
}
],
"objectTypeTemplatesChanges":
[
{
"newName":"",
"oldName":"Car"
}
]
}
------WebKitFormBoundaryViBtYYvOfWhTYyhH--
Table 6. Payload Parameters
Parameter Description Required? Data Type
name The object type name (must be unique). Yes String
description The description of the object type. No String
dataVariables The list of variables in the object type. No Array
containedObjectTypes The list of contained types with details No Array
objectTypeTemplates The list of object type templates, along with their details. No Array
lastModifiedUser The username of the user who created the object type. Yes String
lastModifiedTime The current time. Yes String
versionNumber The version number of the object type. Start with 1 and increment by 1 each time you want to modify the object type. Yes Number
Table 7. Response Parameters
Parameter Data Type Description
name String The object type name (must be unique).
description String The description of the object type.
containedObjectTypes Array The list of contained types with details.
dataVariables Array The list of variables (with details) in the object type.
objectTypeTemplates Array The list of object type templates, along with their details.
lastModifiedUser String The username of the user who created the object type.
lastModifiedTime String The current time.
versionNumber Number The version number of the object type. Start with 1 and increment by 1 each time you want to modify the object type.
databaseName The name of the Historian server. Yes
containedObjectTypeChanges The list of changes in the contained type. No
dataVariablesChanges The list of changes in the object type variables. No
objectTypeTemplatesChanges The list of changes in the object type templates. No
Table 8. objectTypeTemplates Array Parameters
Parameter Description Data Type
name The object type name (must be unique). String
description The description of the object type. String
containedObjectTypes The list of contained types with details Array
dataVariables The list of variables (with details) in the object type. Array
lastModifiedUser The username of the user who created the object type. String
lastModifiedTime The current time. String
versionNumber The version number of the object type. Start with 1 and increment by 1 each time you want to modify the object type. Number
ObjectType The object type name. String
substituteParameters Blank (not applicable) Array
Table 9. dataVariables Array Parameters
Parameter Description Required? Data Type
name The name of the object type name (must be unique). Yes String
description The description of the object type. No String
variableType The type of the variable (direct, indirect, or static). No String
baseType Not applicable No String
dbTagName Not applicable No String
Table 10. containedObjectTypes Array Parameters
Parameter Description Required? Data Type
name The name of the object type (must be unique). Yes String
description The description of the object type). No String
containedObjectType The name of the object type that you want to use as a contained type. No String
baseType The type of the contained type (ThingName indicates a contained type). No String
Table 11. Response Parameters
Parameter Data Type Description
detail String The description of the error.
error_code Integer The error code. A value of 0 indicates that the operation was successful.
status String The http request status.
title String The title of the error.
type String The type of the error.
The Contained Type List API
Using this API, you can get a list of contained types in each object type.
METHOD GET
URI https://<historianservername> /historian-model/v2/ containedObjectTypesMap
SAMPLE QUERY PARAM GET URL https://localhost:443/historian-model/v2/containedObjectTypesMap
Table 12. Response Parameters
Parameter Description Data Type
containedObjectTypes The list of contained types. Array
name The object type in which the contained type is used. String
The Create Object Instance API
Using this API, you can create an object instance.
METHOD POST
URI https://<historianservername> /historian-model/v2/objects
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/objects
SAMPLE PAYLOAD
[
{
"containedObjects":[],
"containedType":false,
"dataVariables":[],
"databaseName":"XYZ",
"description":"",
"fullName":"",
"name":"Audi1",
"objectDataValueChanges":[],
"objectDataValues":[],
"objectType":"Vehicle",
"objectTypeTemplate":"Car",
"override":false,
"parentName":"",
"substituteParameters":[],
"v1Type":false,
"versionNumber":0
}
]
Table 13. Payload Parameters
Parameter Description Required? Data Type
containedObjects The list of contained object types. No Array
containedType Indicates whether the object type is used as a contained type (by default, False). Yes Boolean
dataVariables The list of variables with details. No Array
description The description of the object instance. No String
fullName The full name of the object instance, which contains the name of the original object type, followed by the contained type name (as applicable). No String
name The name of the object instance. Yes String
objectDataValueChanges The list of changes in the object instance. No Array
ObjectType The object type from which this instance must be created. Yes String
objectTypeTemplate The name of the template you want to use in the object instance. Yes String
Override True or false (required, but not used in Historian). No Boolean
parentName The name of the object type. No String
substituteParameters Not applicable No String
v1Type Indicates whether it is an Operations Hub model or a Historian model (by default, False, indicating a Historian model). Yes Boolean
versionNumber The version number of the object instance. Yes Number
databaseName The name of the Historian system. Yes String
Table 14. Response Parameters
Parameter Data Type Description
detail String Description of the error.
error_code Integer The error code. A value of 0 indicates that the operation was successful.
status String The http request status.
title String The title of the error.
type String The type of the error.
The Object Instance Info API
Using this API, you can view an object instance.
METHOD POST
URI https://<historianservername>/historian-model/v2/objects/info
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/objects/info
SAMPLE RESPONSE
{
"containedObjects":
[
{
"alias":"Engine",
"baseType":"THINGNAME",
"containedObjectType":"Engine",
"containedObjectTypeTemplate":"Default_Template_Engine",
"description":"Engine",
"fullName":"Audi1>Engine",
"name":"Engine",
"variableType":"ContainedAsset"
}
],
"containedType":false,
"dataVariables":
[
{
"baseType":"NUMBER",
"blockType":"AI",
"dbTagName":"Speed",
"description":"",
"name":"Speed",
"properties":[],
"required":true,
"variableType":"Direct"
},
{
"baseType":"STRING",
"blockType":"AI",
"dbTagName":"Type",
"description":"",
"name":"Type",
"properties":[],
"required":true,
"variableType":"InDirect"
},
{
"baseType":"NUMBER",
"blockType":"AI",
"dbTagName":"Color",
"description":"",
"name":"Color",
"properties":[],
"required":true,
"variableType":"Static"
}
],
"databaseName":"XYZ",
"description":"",
"lastModifiedUser":"XYZ.admin",
"lastmodifiedTime":"2022-01-21 11:38:59",
"name":"Audi1",
"objectType":"Vehicle",
"objectTypeTemplate":"Car",
"override":false,"parentName":">",
"substituteParameters":[],
"v1Type":false,
"versionNumber":3
}
SAMPLE PAYLOAD
{"name":"Audi1","databaseName":"XYZ"}
Table 15. Payload Parameters
Parameter Description Required? Data Type
name The name of the object instance. Yes String
databaseName The name of the Historian server. No String
Table 16. Response Parameters
Parameter Description Data Type
containedObjects The list of contained object types. Array
containedType Indicates whether the object type is used as a contained type. Boolean
dataVariables The list of variables with details. Array
description The description of the object instance. String
fullName The full name of the object instance. String
name The name of the object instance. String
objectDataValueChanges The list of changes in the object instance. Array
ObjectType The name of the object instance from which this instance is created. String
objectTypeTemplate The name of the object type template used in the object instance. String
Override True or false. Boolean
parentName The name of the parent. String
substituteParameters Not applicable String
v1Type Indicates whether it is an Operations Hub model or a Historian model (by default, False, indicating a Historian model). Boolean
versionNumber The version number of the object instance. Number
databaseName The name of the Historian server. String
Table 17. containedObjectTypes Array Parameters
Parameter Description Required? Data Type
alias The name of the variable. No String
variableType The type of the variable (direct, indirect, or static). No String
name The name of the object type (must be unique). Yes String
description The description of the object type). No String
containedObjectType The name of the object type that you want to use as a contained type. No String
containedObjectTypeTemplate The template in the contained type that you want to use. No String
baseType The type of the contained type (ThingName indicates a contained type). No String
Table 18. Data Variables Parameters
Parameter Description Required? Data Type
baseType The type of the contained type (ThingName indicates a contained type). No String
blockType Not applicable No String
dbTagName The tag mapped with the variable (in the case of a direct or indirect variable). No String
description The description of the object instance. No String
name The name of the variable. No String
properties Not applicable No Array
required Indicates whether this variable is included in the object instance. No String
variableType The data type of the variable (direct, indirect, or static). No String
The Object Instance with Contained Type Variables API
Using this API, you can view the contained type variables in an object instance.
METHOD POST
URI https://<historianservername>/historian-model/v2/typesInstancesList/objects
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/typesInstancesList/objects
SAMPLE RESPONSE
[
{
"hasItems":true,
"id":"Instances_Audi1_V_",
"loaded":false,
"parentId":"Instances_Audi1",
"text":"Variables",
"type":"objectInstanceVariableRootNode"
},
{
"hasItems":false,
"id":"Instances_Audi1_V_0",
"loaded":false,
"objectFullName":"Audi1",
"parentId":"Instances_Audi1_V_",
"parentObjectName":"Audi1",
"text":"Speed",
"type":"objectInstanceVariableNode"
},
{
"hasItems":false,
"id":"Instances_Audi1_V_1",
"loaded":false,
"objectFullName":"Audi1",
"parentId":"Instances_Audi1_V_",
"parentObjectName":"Audi1",
"text":"Type",
"type":"objectInstanceVariableNode"
},
{
"hasItems":false,
"id":"Instances_Audi1_V_2",
"loaded":false,
"objectFullName":"Audi1",
"parentId":"Instances_Audi1_V_",
"parentObjectName":"Audi1",
"text":"Color",
"type":"objectInstanceVariableNode"
},
{
"hasItems":true,
"id":"Instances_Audi10",
"loaded":false,
"objectFullName":"Audi1>Engine",
"objectType":"Engine",
"objectTypeTemplate":"Default_Template_Engine",
"parentId":"Instances_Audi1",
"parentObjectName":"Audi1",
"status":"state_new",
"text":"Engine",
"type":"objectInstanceContainedAssetNode"
},
{
"hasItems":false,
"id":"Instances_Audi10_V_",
"loaded":false,
"parentId":"Instances_Audi10",
"text":"Variables",
"type":"objectInstanceVariableRootNode"
}
]
SAMPLE PAYLOAD {"name":"Audi1","databaseName":"XYZ"}
Table 19. Payload Parameters
Parameter Description Required? Data Type
name The name of the object instance. Yes String
databaseName The name of the Historian system. Yes String
Table 20. Response Parameters
Parameter Description Data Type
hasItems Indicates whether the variable is a static text or a variable (be default, false, indicating that it is static text). Boolean
id The sequence ID to render the model tree. String
loaded Not applicable Boolean
parentId The ID of the parent. String
text Contains the static text value or, in the case of variables, contains the text Variables. String
type

The type of the variable:

  • objectInstanceVariableRootNode: Indicates static text.
  • objectInstanceVariableNode: Indicates direct, indirect, or a static variable.
  • objectInstanceContainedAssetNode: Indicates a variable in a contained type.
String
The Object Instance - Variable Information API
Using this API, you can view the variable details of an object instance.
METHOD POST
URI https://<historianservername> /historian-model/v2/ objects/variables/info
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/objects/variables/info
SAMPLE RESPONSE
{
"blockType":"AI",
"variableName":"Speed",
"variableTagName":"Audi1>Speed",
"variableType":"Direct",
"variableValue":"Audi1>Speed"
}
SAMPLE PAYLOAD {"databaseName":"XYZ","name":"Audi1>Speed"}
Table 21. Payload Parameters
Parameter Description Required? Data Type
name The name of the object instance. Yes String
databaseName The name of the Historian system. Yes String
Table 22. Response Parameters
Parameter Description Data Type
blockType Not applicable String
variableName The name of the variable. String
variableTagName The name of the tag associated with the variable (not applicable for a static variable). String
variableType The type of the variable (static, direct, or indirect). String
variableValue The value of the variable (in case of a static variable) or the associated tag (in case of a direct or indirect variable). String
The Historian Model API
Using this API, you can view the Historian model of a Historian system.
METHOD POST
URI https://<historianservername>/historian-model/v2/typesObjectsList
SAMPLE QUERY PARAM POST URL https://localhost:443/historian-model/v2/typesObjectsList
SAMPLE PAYLOAD {"databaseName":"XYZ"}
Table 23. Payload Parameters
Parameter Description Required? Data Type
databaseName The name of the Historian system. Yes String
Table 24. Response Parameters
Parameter Description Data Type
assetTemplates List of all the templates in the Historian model. Array
assetTemplatesInfo List of the details of all the templates in the Historian model. Array
assetTypes List of all the object types in the Historian model. Array
assetTypesInfo List of the details of all the object types in the Historian model. Array
assets List of all the object instances in the Historian model. Array
assetsInfo List of the details of all the object types in the Historian model. Array
Table 25. assetTemplates Parameters
Parameter Description Data Type
defaultTemplate Indicates whether it is the default template. Boolean
description The description of the template. String
lastModifiedUser The username of the user who last modified the template. String
lastmodifiedTime The date and time when the template was last modified. Date and time
name The name of the template. String
objectType The name of the object type associated with the template. String
versionNumber The version number of the template. Integer
Table 26. assets Parameters
Parameter Description Data Type
assetFullName The full name of the object instance. Array
assetName The name of the object instance. String
lastModifiedUser The username of the user who last modified the object instance. String
lastmodifiedTime The date and time when the object instance was last modified. Date and time
assetParentName The parent name of the asset. String
containedAssets List of all the contained types in the object type. Array
versionNumber The version number of the object instance. Integer
Table 27. assetsInfo Parameters
Parameter Description Data Type
containedType Indicates whether the object type is a contained type. Boolean
databaseName The name of the Historian system. String
lastModifiedUser The username of the user who last modified the object instance. String
lastmodifiedTime The date and time when the object instance was last modified. Date and time
description The description of the object instance. String
name The name of the object instance. String
objectType The name of the object type associated with the object instance. String
objectTypeTemplate The name of the template used in the object instance. String
Override Updated or not. Boolean
ParentName The parent name of the asset. String
status Not applicable String
v1Type Not applicable Boolean
versionNumber The version number of the object instance. number
The Export Historian Model API

When you create an object type or an object instance, you can use it only in the Historian system in which you have created it. If, however, you want to use the object type/instance in a different Historian system, you can export it and then import it into the other Historian system.

Using this API, you can export a Historian model, along with the object types, object instances, variables, templates, and contained types, into another Historian system.

METHOD GET
URI http://<historianservername>/historian-model/v2/export?types=<true/false>&templates=<true/false>&instances=<true/false>&databaseName=<encrypted Historian system name>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/v2/export?types=true&templates=true&instances=true&databaseName=KNQWYA
SAMPLE RESPONSE
{
"admissionTime": 1642600209,
"jobId": 0
}
Table 28. Query Parameters
Parameter Description Required? Data Type
types Indicates whether you want to include object types while exporting the Historian model. Yes Boolean
templates Indicates whether you want to include templates while exporting the Historian model. No Boolean
instances Indicates whether you want to include object instances while exporting the Historian model. No Boolean
databaseName The Historian system from which you want to export the Historian model. Yes String (Encrypted)
Table 29. Response Parameters
Parameter Description Data Type
admissionTime The timestamp in Epoch time format when the model is exported. Unix Time Stamp
jobId The job id with which the operation started. Integer
The Export Historian Model to Historian - Job Status API
Using this API, you can view the status of exporting a Historian model to another Historian system.
METHOD GET
URI http: //<historianservername>/historian-model/import-export/status/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/status/?jobId=1
SAMPLE RESPONSE
{
"admissionTime": 1642601025,
"completionTime": 1642601025,
"isRunning": 0,
"processing": "Completed",
"processingElement": 14,
"startTime": 1642601025,
"statusPercentage": 100
}
Table 30. Query Parameters
Parameter Description Required? Data Type
jobId The job created when the export command is run. Yes Integer
Table 31. Response Parameters
Parameter Description Data Type
admissionTime The timestamp in Epoch time format when the model is exported. Unix Time Stamp
completionTime The completing time of the job. Unix Time Stamp
isRunning The status of the job. String
processing Indicates whether the elements are being processed. String
processingElement The element that is being processed. String
startTime The start time of the job. Unix Time Stamp
statusPercentage The percentage of job completion. Integer
The Historian Model to Historian - Job Log API
Using this API, you can view the job log of exporting a Historian model to another Historian system.
METHOD GET
URI http: //<historianservername>/historian-model/import-export/log/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/log/?jobId=1
SAMPLE RESPONSE
[
{
"Elements": ["2022-01-19T08-08-43\t"],
"LogStringCode": 12304
},
{
"Elements": [ "2022-01-19T08-08-43\t","3"],
"LogStringCode": 12309
},
{
"Elements": ["2022-01-19T08-08-43\t","2.1"],
"LogStringCode": 12310
}
]
Table 32. Query Parameters
Parameter Description Required? Data Type
jobId The job created when you run the export command. Yes Integer
Table 33. Response Parameters
Parameter Description Data Type
Array of Elements List of elements that are processed. Array
LogStringCode The processing code. Integer
The Export Historian Model to Historian - Job Result API
Using this API, you can export and retrieve a Historian model in a CSV file. You can then import it into another Historian model.
METHOD GET
URI http: //<historianservername>/historian-model/import-export/result/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/result/?jobId=1
Table 34. Query Parameters
Parameter Description Required? Data Type
jobId The job created when you run the export command. Yes Integer
Table 35. Response Parameters
Parameter Description Data Type
CSV file Contains the exported model file
The Export Historian Model to Operations Hub API

When you create an object type or an object instance, you can use it only in the Historian system in which you have created it. If, however, you want to use the object type/instance in Operations Hub, you can export it and then import it into Operations Hub.

Using this API, you can export a Historian model to Operations Hub.
METHOD GET
URI http://<historianservername>/historian-model/v2/export?types=<true/false>&instances=<true/false>&forOpsHub=<true/false>&databaseName=<encrypted Historian system name>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/v2/export?types=true&instances=true&forOpsHub=true&databaseName=KNOGEYA
SAMPLE RESPONSE
{
"admissionTime": 1642600209,
"jobId": 0
}
Table 36. Query Parameters
Parameter Description Required? Data Type
types Indicates whether you want to include object types while exporting the Historian model. Yes Boolean
instances Indicates whether you want to include object instances while exporting the Historian model. No Boolean
databaseName The Historian system from which you want to export the Historian model. Yes String (Encrypted)
Table 37. Response Parameters
Parameter Description Data Type
admissionTime The timestamp in Epoch time format when the model is exported. Unix Time Stamp
jobId The job id with which the operation started. Integer
The Export Historian Model to Operations Hub Job Status API
Using this API, you can get the job status of exporting a Historian model to Operations Hub.
METHOD GET
URI http://<historianservername>/historian-model/import-export/status/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/status/?jobId=1
SAMPLE RESPONSE
{
"admissionTime": 1642601025,
"completionTime": 1642601025,
"isRunning": 0,
"processing": "Completed",
"processingElement": 14,
"startTime": 1642601025,
"statusPercentage": 100
}
Table 38. Query Parameters
Parameter Description Required? Data Type
jobId The job created when you run the export command. Yes Integer
Table 39. Response Parameters
Parameter Description Data Type
admissionTime The timestamp in Epoch time format when the model is exported. Unix Time Stamp
completionTime The completion time of the job. Unix Time Stamp
isRunning The status of the job. String
processing Indicates whether the elements are being processed. String
processingElement The element which is being processed. String
startTime The start time of the job. Unix Time Stamp
statusPercentage The percentage of job completion. Integer
The Export Historian Model to Operations Hub Job Log API
Using this API, you can get the log of the job when exporting a Historian model to Operations Hub.
METHOD GET
URI http: //<historianservername>/historian-model/import-export/log/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/log/?jobId=1
SAMPLE RESPONSE
[
{
"Elements": ["2022-01-19T08-08-43\t"],
"LogStringCode": 12304
},
{
"Elements": [ "2022-01-19T08-08-43\t", "3"],
"LogStringCode": 12309
},
{
"Elements": ["2022-01-19T08-08-43\t","2.1"],
"LogStringCode": 12310
}
]
Table 40. Query Parameters
Parameter Description Required? Data Type
jobId The job created when you run the export command. Yes Integer
Table 41. Response Parameters
Parameter Description Data Type
Array of Elements List of elements that are processed. Array
LogStringCode The processing code. Integer
The Export Historian Model to Operations Hub Job Result API
Using this API, you can export and retrieve a Historian model in a CSV file. You can then import it into Operations Hub.
METHOD GET
URI http://<historianservername>/historian-model/import-export/result/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/result/?jobId=1
Table 42. Query Parameters
Parameter Description Required? Data Type
jobId The job created when you run the export command. Yes Integer
Table 43. Response Parameters
Parameter Description Data Type
CSV file Contains the exported model. file
The Import Model to Historian API
Using this API, you can import a Historian model from one system to another.
Important: If the name of a tag associated with a variable in a model contains a period (.), you cannot import the tag while importing the model into a Historian system.
METHOD POST
URI http://<historianservername>/historian-model/v2/import?types=<true/false>&templates=<true/false>&instances=<true/false>&databaseName=<encrypted Historian system name>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/v2/import?types=true&templates=true&instances=true&databaseName=KGEYA
SAMPLE RESPONSE
{
"admissionTime": 1642600209,
"jobId": 0
}
Table 44. Payload Parameters
Payload Description Required? Data Type
body CSV file that you want to import Yes file
Table 45. Query Parameters
Parameter Description Required? Data Type
types Indicates whether you want to import object types. Yes Boolean
templates Indicates whether you want to import templates. No Boolean
instances Indicates whether you want to import object instances. No Boolean
databaseName The Historian system name in to which you want to import the model. Yes String (Encrypted)
Table 46. Response Parameters
Parameter Description Data Type
admissionTime The timestamp in Epoch time format when the model is imported. Unix Time Stamp
jobId The job id with which the operation started. Integer
The Import Historian Model to Historian - Job Status API
Using this API, you can view the job status of importing a Historian model to another Historian system.
METHOD GET
URI http://<historianservername>/historian-model/import-export/status/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/status/?jobId=1
SAMPLE RESPONSE
{
"admissionTime": 1642601025,
"completionTime": 1642601025,
"isRunning": 0,
"processing": "Completed",
"processingElement": 14,
"startTime": 1642601025,
"statusPercentage": 100
}
Table 47. Query Parameters
Parameter Description Required? Data Type
jobId The job created when the import command is run. Yes Integer
Parameter Description Data Type
admissionTime The error in text format. Unix Time Stamp
completionTime The completed time of the job. Unix Time Stamp
isRunning The status of the job. String
processing Indicates whether the elements are processed. String
processingElement The element that is being processed. String
startTime The start time of the job. Unix Time Stamp
statusPercentage The percentage of job completion. Integer
The Import Historian Model to Historian - Job Log API
Using this API, you can view the job log of importing a Historian model into another Historian model.
METHOD GET
URI http://<historianservername>/historian-model/import-export/log/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/log/?jobId=1
SAMPLE RESPONSE
[
{
"Elements": ["2022-01-19T08-08-43\t"],
"LogStringCode": 12304
},
{
"Elements": ["2022-01-19T08-08-43\t","3"],
"LogStringCode": 12309
},
{
"Elements": ["2022-01-19T08-08-43\t","2.1"],
"LogStringCode": 12310
}
]
Table 48. Query Parameters
Parameter Description Required? Data Type
jobId The job created when the import command is run. Yes Integer
Table 49. Response Parameters
Parameter Description Data Type
Array of Elements The list of elements that are processed. Array
LogStringCode The processing code. Integer
The Import Historian Model to Historian - Result API
Using this API, you can view the result of importing a Historian model into another Historian system.
METHOD GET
URI http://<historianservername>/historian-model/import-export/result/?jobId=<jobId>
SAMPLE QUERY PARAM GET URL http://localhost:443/historian-model/import-export/result/?jobId=1
SAMPLE RESPONSE
[
{
"Elements":["2022-01-19T08-06-59\t","72","Contained Asset","Engine1"],
"LogStringCode":12214
},
{
"Elements":["2022-01-19T08-06-59\t","73","Contained Asset","cylinder1"],
"LogStringCode":12214
},
{
"Elements":["2022-01-19T08-06-59\t","74","Contained Asset","piston1"],
"LogStringCode":12214
}
]
Table 50. Payload Parameters
Parameter Description Required? Data Type
jobId The job created when the import command is run. Yes Integer
Table 51. Response Parameters
Parameter Description Data Type
Array of Elements The list of elements that are processed. Array
LogStringCode The processing code. Integer
The Duplicate Object Instance API
Using this API, you can copy an object instance.
METHOD POST
URI http: //<historianservername>/historian-model/v2/objects/clone
SAMPLE QUERY PARAM POST URL http://localhost:443/historian-model/v2/objects/clone
SAMPLE PAYLOAD
{
"databaseName":"XYZ",
"source": "Vehicle",
"destination": "Audi",
"description": "the new object"
}
Table 52. Payload Parameters
Parameter Description Required? Data Type
databaseName The name of the Historian system. Yes String
source The name of the object instance that you want to copy. Yes String
destination The name that you want to provide for the copied object instance. Yes String
description The description of the new object instance. No String
The Duplicate Object Type API
Using this API, you can copy an object type. When you copy an object type, all the templates and variables are copied too.
METHOD POST
URI http: //<historianservername>/historian-model/v2/objectTypes/clone
SAMPLE QUERY PARAM POST URL http://localhost:443/historian-model/v2/objectTypes/clone
SAMPLE PAYLOAD
{
"source": "Vehicle",
"destination": "Audi",
"description": "the new object"
}
Table 53. Payload Parameters
Parameter Description Required? Data Type
source The name of the object type that you want to copy. Yes String
destination The name that you want to provide for the copied object type. Yes String
description The description of the new object type. No String
The Export Object Instance API
Using this API, you can export an object instance into another Historian system.
METHOD POST
URI http: //<historianservername>/historian-model/v2/export/objects
SAMPLE QUERY PARAM POST URL http://localhost:443/historian-model/v2/export/objects
SAMPLE PAYLOAD
{
"objects": 
[
"object_Instance_1",
"Object_Instance_2"
],
"objectType": "Audi",
"objectTypeTemplate": "Vehicle",
"databaseName": "XYZ"
}
Table 54. Payload Parameters
Parameter Description Required? Data Type
objects The list of the object instances that you want to export. Yes Array
objectType The object type associated with the object instances that you want to export. Yes String
objectTypeTemplate The template type of the object instances that you want to export. No String
databaseName The name of the Historian system. Yes String
The Export Object Type API
Using this API, you can export an object type into another Historian system.
METHOD POST
URI http://<historianservername>/historian-model/export/objectTypes
SAMPLE QUERY PARAM POST URL http://localhost:443/historian-model/export/objectTypes?databaseName= KOGEYA
SAMPLE PAYLOAD
{
"objectType": 
["object_type_1","object_type_2"]
}
Table 55. Payload Parameters
Parameter Description Required? Data Type
objectType The list of object types that you want to export. Yes Array
Table 56. Query Parameters
Parameter Description Required? Data Type
databaseName The name of the Historian system from which you want to export the object type. Yes String (encrypted)
The Delete Object Instance API
Using this API, you can delete an object instance. If there are direct variables in the object type, you can also choose to delete the tags associated with these variables (along with their data).
METHOD DELETE
URI http://<historianservername>/historian-model/v2/objects
SAMPLE QUERY PARAM DELETE URL http://localhost:443/historian-model/v2/objects
SAMPLE PAYLOAD
{ 
"databaseName":"XYZ",
"name": "Vehicle1",
"permanentDelete": true
}
Table 57. Payload Parameters
Parameter Description Required? Data Type
databaseName The name of the Historian system. Yes String
name The name of the object instance that you want to delete. Yes String
permanentDelete Indicates whether you want to permanently delete the object instance. If you do so, the tags are deleted as well. Yes Boolean
The Incoming Dependencies API
Using this API, you can view a list of object instances associated with an object type. This is used to check if an object type contains object instances before you delete the object type.
METHOD POST
URI http://<historianservername>/historian-model/v2/objectTypes/IncomingDependencies
SAMPLE QUERY PARAM POST URL http://localhost:443/historian-model/v2/objectTypes/ IncomingDependencies
SAMPLE PAYLOAD
{
"name": "Vehicle",
"databaseName":"XYZ"
}
Table 58. Payload Parameters
Parameter Description Required? Data Type
name The name of the object type that you want to delete. Yes String
databaseName The name of the Historian system associated with the object type. Yes String
The Delete Object Type API
Using this API, you can delete an object type. You can delete multiple object types together; however, all the object types must belong to the same Historian system. You cannot delete an object type if it is used in an object instance; you must first delete the object instance.
METHOD DELETE
URI http://<historianservername>/historian-model/v2/objectTypes
SAMPLE QUERY PARAM DELETE URL http://localhost:443/historian-model/v2/objectTypes
SAMPLE PAYLOAD
{
"databaseName": "XYZ",
"objectTypes": ["Vehicle","Engine"] 
} 
Table 59. Payload Parameters
Parameter Description Required? Data Type
objectTypes The list of object types that you want to delete. Yes Array
databaseName The name of the Historian system associated with the object types. Yes String