Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Web API Reference

AssetDatabase GetElementTemplates

AssetDatabase GetElementTemplates

Retrieve element templates based on the specified criteria. Only templates of instance type "Element" and "EventFrame" are returned. By default, all element and event frame templates in the specified Asset Database are returned.

Remarks

Users can search for the element and event frame template based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the templates that match the default search.

Request

GET assetdatabases/{webId}/elementtemplates

URL Parameters

  • webId

    The ID of the database to search. See WebID for more information.

  • field

    Specifies which of the object's properties are searched. See Search Field for more information. Multiple search fields may be specified with multiple instances of the parameter. The default is 'Name'.

  • query

    The query string used for finding objects. The default is no query string. See Query String for more information.

  • sortField

    The field or property of the object used to sort the returned collection. The default is 'Name'. See Sort Field for more information.

  • sortOrder

    The order that the returned collection is sorted. The default is 'Ascending'. See Sort Order for more information.

  • maxCount

    The maximum number of objects to be returned per call (page size). The default is 1000.

  • selectedFields

    List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.

  • webIdType

    Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType". See WebID Type for more information.

Status Codes

200: A list of element templates matching the specified condition.

Sample Response Body

{
  "Items": [
    {
      "WebId": "I1ETDqD5loBNH0erqeqJodtALAkpSYp6uykE2Ku0yChDU91g",
      "Id": "a7989492-b2ab-4d90-8abb-4c8284353dd6",
      "Name": "MachineName",
      "Description": "Manufacturing Machine MachineName",
      "Path": "\\\\MyAssetServer\\MyDatabase\\ElementTemplates[Boiler]",
      "AllowElementToExtend": false,
      "BaseTemplate": "Equipment",
      "InstanceType": "Element",
      "NamingPattern": "%TEMPLATE%",
      "CategoryNames": [
        "Equipment Assets"
      ],
      "ExtendedProperties": {},
      "Severity": "None",
      "CanBeAcknowledged": false,
      "Links": {
        "Self": "https://localhost.osisoft.int/piwebapi/elementtemplates/I1ETDqD5loBNH0erqeqJodtALAkpSYp6uykE2Ku0yChDU91g"
      }
    },
    {
      "WebId": "I1ETDqD5loBNH0erqeqJodtALAkpSYp6uykE2Ku0yChDU91g",
      "Id": "a7989492-b2ab-4d90-8abb-4c8284353dd6",
      "Name": "MachineName",
      "Description": "Manufacturing Machine MachineName",
      "Path": "\\\\MyAssetServer\\MyDatabase\\ElementTemplates[Boiler]",
      "AllowElementToExtend": false,
      "BaseTemplate": "Equipment",
      "InstanceType": "Element",
      "NamingPattern": "%TEMPLATE%",
      "CategoryNames": [
        "Equipment Assets"
      ],
      "ExtendedProperties": {},
      "Severity": "None",
      "CanBeAcknowledged": false,
      "Links": {
        "Self": "https://localhost.osisoft.int/piwebapi/elementtemplates/I1ETDqD5loBNH0erqeqJodtALAkpSYp6uykE2Ku0yChDU91g"
      }
    }
  ],
  "Links": {}
}
In This Topic
TitleResults for “How to create a CRG?”Also Available in