Summary:
Lists Data Access templates used to access the internal DsKernel data, and creates new Data Access templates.
URL:
http(s)://{server hostname}/api/dataAccessTemplates
Methods summary
- GET Method - lists all Data Access templates existing on the server.
- POST Method - creates a new Data Access template.
GET Method detail
Lists all Data Access templates existing on the server.
Response:
Lists information about each of templates defined on a server. Each entry has the following attributes:
Name | Description |
---|---|
name | name of the template. |
description | description of the template. |
type | type of the template (either “USER” or “SYSTEM”). |
Example:
INPUT
curl -u admin:admin https://localhost/api/dataAccessTemplates?media=xml -X GET -H "content-type:application/xml"
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="2">
<item xsi:type="dataAccessTemplateSummary" description="Some description" type="SYSTEM" name="A" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
<item xsi:type="dataAccessTemplateSummary" description="" type="USER" name="B" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
</items>
POST Method detail
Creates a new Data Access Template.
Request:
An XML definition of the template, defined according to the Export template syntax section of the Data Access Interface.
Response:
A new template. If unsuccessful, a description of the error that occurred.
Example:
INPUT
curl -u admin:admin https://localhost/api/dataAccessTemplates?media=xml -X POST -H "content-type:application/xml" -d \
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataAccessTemplate type="USER" name="C">
<description>Some description</description>
<object type="DeviceEx" tag="device">
<selector>simple;ref.devices</selector>
<filter></filter>
<attribute asElement="false" tag="name1" expression="name"/>
<object type="PortEx" tag="port">
<selector>simple;ref.ports</selector>
<filter></filter>
<attribute asElement="false" tag="descr" expression="simple;this.ifDescr"/>
</object>
</object>
</dataAccessTemplate>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataAccessTemplate type="USER" name="C">
<description>Some description</description>
<object type="DeviceEx" tag="device">
<attribute expression="name" tag="name1"/>
<object type="PortEx" tag="port">
<attribute expression="simple;this.ifDescr" tag="descr"/>
<selector>simple;ref.ports</selector>
<filter></filter>
</object>
<selector>simple;ref.devices</selector>
<filter></filter>
</object>
/dataAccessTemplate>
Comments
0 comments
Please sign in to leave a comment.