List templates on the SDM Server
get
/{versionId}/routeSets/importTemplates
Get all the templates configured by a user on SDM Server.
Request
Path Parameters
-
versionId(required):
The rest api version, it's value is v1.3
Response
200 Response
400 Response
The user input is invalid.
401 Response
The session ID is invalid.
403 Response
There is no permission to access the resources.
404 Response
The object (resource URI, device, and so on) of your input request cannot be found.
500 Response
Internal server error
Examples
Examples of Accessing the API
See Authenticate for how to acquire a session cookie.
The following example shows how to get the list of templates on the SDM server using curl.
curl -X GET \
-b sessionid.txt \
--header "Accept: application/xml" \
"https://example.com:8443/rest/v1.3/routeSets/importTemplates"
The following example shows how to get the list of templates on the SDM server using Python.
import requests
from lxml import etree
url = "https://example.com:8443/rest/v1.3/routeSets/importTemplates"
headers = { "Accept":"application/xml", "Cookie":cookie }
resp = requests.get(url, headers=headers)
Example of the Response Body
The following example shows the contents of the response body in XML.
<importTemplates>
<importTemplates>
<columnMappings>
<columnName>nextHop</columnName>
<csvName>6</csvName>
</columnMappings>
<columnMappings>
<columnName>trunkContext</columnName>
<csvName>10</csvName>
</columnMappings>
<columnMappings>
<columnName>description</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>pubUser2</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>pubUser1</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>sed</columnName>
<csvName>3</csvName>
</columnMappings>
<columnMappings>
<columnName>pubId</columnName>
<csvName>2</csvName>
</columnMappings>
<columnMappings>
<columnName>npa</columnName>
<csvName>18</csvName>
</columnMappings>
<columnMappings>
<columnName>order</columnName>
<csvName>7</csvName>
</columnMappings>
<columnMappings>
<columnName>formulaFeapp</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user1</columnName>
<csvName>13</csvName>
</columnMappings>
<columnMappings>
<columnName>user2</columnName>
<csvName>14</csvName>
</columnMappings>
<columnMappings>
<columnName>preference</columnName>
<csvName>8</csvName>
</columnMappings>
<columnMappings>
<columnName>trunkGroup</columnName>
<csvName>9</csvName>
</columnMappings>
<columnMappings>
<columnName>format</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>weight</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>priority</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user5</columnName>
<csvName>17</csvName>
</columnMappings>
<columnMappings>
<columnName>user3</columnName>
<csvName>15</csvName>
</columnMappings>
<columnMappings>
<columnName>nxx</columnName>
<csvName>19</csvName>
</columnMappings>
<columnMappings>
<columnName>user4</columnName>
<csvName>16</csvName>
</columnMappings>
<columnMappings>
<columnName>destGroup</columnName>
<csvName>5</csvName>
</columnMappings>
<columnMappings>
<columnName>formulaFeappPubId</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>name</columnName>
<csvName>sample</csvName>
</columnMappings>
<columnMappings>
<columnName>formula</columnName>
<csvName>4</csvName>
</columnMappings>
<columnMappings>
<columnName>rn</columnName>
<csvName>11</csvName>
</columnMappings>
<columnMappings>
<columnName>cic</columnName>
<csvName>12</csvName>
</columnMappings>
<columnMappings>
<columnName>operation</columnName>
<csvName>1</csvName>
</columnMappings>
<name>sample</name>
<objectId>ID6</objectId>
<sedFormula></sedFormula>
</importTemplates>
</importTemplates>
The following example shows the contents of the response body in JSON.
{
"importTemplates": [{
"columnMappings": [{
"columnName": "nextHop",
"csvName": ""
},{
"columnName": "trunkContext",
"csvName": ""
},{
"columnName": "description",
"csvName": ""
},{
"columnName": "pubUser2",
"csvName": ""
},{
"columnName": "pubUser1",
"csvName": ""
},{
"columnName": "sed",
"csvName": "3"
},{
"columnName": "pubId",
"csvName": "2"
},{
"columnName": "npa",
"csvName": ""
},{
"columnName": "order",
"csvName": ""
},{
"columnName": "formulaFeapp",
"csvName": ""
},{
"columnName": "user1",
"csvName": ""
},{
"columnName": "user2",
"csvName": ""
},{
"columnName": "preference",
"csvName": ""
},{
"columnName": "trunkGroup",
"csvName": ""
},{
"columnName": "format",
"csvName": ""
},{
"columnName": "weight",
"csvName": ""
},{
"columnName": "priority",
"csvName": ""
},{
"columnName": "user5",
"csvName": ""
},{
"columnName": "user3",
"csvName": ""
},{
"columnName": "nxx",
"csvName": ""
},{
"columnName": "user4",
"csvName": ""
},{
"columnName": "destGroup",
"csvName": ""
},{
"columnName": "formulaFeappPubId",
"csvName": ""
},{
"columnName": "name",
"csvName": "template1"
},{
"columnName": "formula",
"csvName": ""
},{
"columnName": "rn",
"csvName": ""
},{
"columnName": "cic",
"csvName": ""
},{
"columnName": "operation",
"csvName": "1"
},
"name": "template1",
"objectId": "ID22",
"sedFormula": ""
}]
}
Example for Range Type RouteSet
This example shows the response available in NNC 9.0.2 and later.
An example XML response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<importTemplates>
<importTemplates>
<columnMappings>
<columnName>nextHop</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>trunkContext</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>description</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>pubUser2</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>pubUser1</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>sed</columnName>
<csvName>3</csvName>
</columnMappings>
<columnMappings>
<columnName>pubId</columnName>
<csvName>2</csvName>
</columnMappings>
<columnMappings>
<columnName>npa</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>order</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>formulaFeapp</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user1</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user2</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>preference</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>trunkGroup</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>format</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>weight</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>priority</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user5</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user3</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>nxx</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user4</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>destGroup</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>formulaFeappPubId</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>name</columnName>
<csvName>template</csvName>
</columnMappings>
<columnMappings>
<columnName>formula</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>rn</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>cic</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>operation</columnName>
<csvName>1</csvName>
</columnMappings>
<name>template</name>
<objectId>ID40</objectId>
<pubIdType>E164</pubIdType>
</importTemplates>
<importTemplates>
<columnMappings>
<columnName>nextHop</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>rangeStart</columnName>
<csvName>2</csvName>
</columnMappings>
<columnMappings>
<columnName>trunkContext</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>description</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>rangeEnd</columnName>
<csvName>3</csvName>
</columnMappings>
<columnMappings>
<columnName>sed</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>order</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>formulaFeapp</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user1</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user2</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>preference</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>trunkGroup</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>format</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>weight</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>priority</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user5</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user3</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>user4</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>destGroup</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>name</columnName>
<csvName>template_range</csvName>
</columnMappings>
<columnMappings>
<columnName>formula</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>rn</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>cic</columnName>
<csvName></csvName>
</columnMappings>
<columnMappings>
<columnName>operation</columnName>
<csvName>1</csvName>
</columnMappings>
<name>template_range</name>
<objectId>ID83</objectId>
<pubIdFormula></pubIdFormula>
<pubIdType>range</pubIdType>
<sedFormula></sedFormula>
</importTemplates>
</importTemplates>
An example JSON response:
{
"importTemplates": [{
"columnMappings": [{
"columnName": "nextHop",
"csvName": ""
},{
"columnName": "rangeStart",
"csvName": "2"
},{
"columnName": "trunkContext",
"csvName": ""
},{
"columnName": "description",
"csvName": ""
},{
"columnName": "rangeEnd",
"csvName": "3"
},{
"columnName": "sed",
"csvName": "4"
},{
"columnName": "order",
"csvName": ""
},{
"columnName": "formulaFeapp",
"csvName": ""
},{
"columnName": "user1",
"csvName": ""
},{
"columnName": "user2",
"csvName": ""
},{
"columnName": "preference",
"csvName": ""
},{
"columnName": "trunkGroup",
"csvName": ""
},{
"columnName": "format",
"csvName": ""
},{
"columnName": "weight",
"csvName": ""
},{
"columnName": "priority",
"csvName": ""
},{
"columnName": "user5",
"csvName": ""
},{
"columnName": "user3",
"csvName": ""
},{
"columnName": "user4",
"csvName": ""
},{
"columnName": "destGroup",
"csvName": ""
},{
"columnName": "name",
"csvName": "sample_Range"
},{
"columnName": "formula",
"csvName": ""
},{
"columnName": "rn",
"csvName": ""
},{
"columnName": "cic",
"csvName": ""
},{
"columnName": "operation",
"csvName": "1"
}
],
"name": "sample_Range",
"objectId": "ID41",
"pubIdFormula": "",
"pubIdType": "range"
},{
"columnMappings": [{
"columnName": "nextHop",
"csvName": ""
},{
"columnName": "trunkContext",
"csvName": ""
},{
"columnName": "description",
"csvName": ""
},{
"columnName": "pubUser2",
"csvName": ""
},{
"columnName": "pubUser1",
"csvName": ""
},{
"columnName": "sed",
"csvName": "3"
},{
"columnName": "pubId",
"csvName": "2"
},{
"columnName": "npa",
"csvName": ""
},{
"columnName": "order",
"csvName": ""
},{
"columnName": "formulaFeapp",
"csvName": ""
},{
"columnName": "user1",
"csvName": ""
},{
"columnName": "user2",
"csvName": ""
},{
"columnName": "preference",
"csvName": ""
},{
"columnName": "trunkGroup",
"csvName": ""
},{
"columnName": "format",
"csvName": ""
},{
"columnName": "weight",
"csvName": ""
},{
"columnName": "priority",
"csvName": ""
},{
"columnName": "user5",
"csvName": ""
},{
"columnName": "user3",
"csvName": ""
},{
"columnName": "nxx",
"csvName": ""
},{
"columnName": "user4",
"csvName": ""
},{
"columnName": "destGroup",
"csvName": ""
},{
"columnName": "formulaFeappPubId",
"csvName": ""
},{
"columnName": "name",
"csvName": "sample_E164"
},{
"columnName": "formula",
"csvName": ""
},{
"columnName": "rn",
"csvName": ""
},{
"columnName": "cic",
"csvName": ""
},{
"columnName": "operation",
"csvName": "1"
}],
"name": "sample_E164",
"objectId": "ID42",
"pubIdType": "E164",
"sedFormula": ""
}]
}