Summary
Translate XPaths to FAML
Description
Translate XPath expressions to FAML
Route
POST /smart_template/xpath/to/faml
Roles
admin
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
xpath |
array |
yes |
An array of xpath expressions |
Copied to Clipboard
{
"xpath": [
{
"xpath": "/ncs:devices/ncs:device[ncs:ncs:name='os']/ncs:config/ios:hostname itential.com",
"value": "Kwz",
"ruleId": "314ce4d9-e8d8-f2c5-e366-c603b4ef034d"
},
{
"xpath": "/ncs:devices/ncs:device[ncs:ncs:name='os']/ncs:name",
"value": "WyWtlmpXZ",
"ruleId": "70c10465-9f8e-687b-6c24-9f3cad003109"
},
{
"xpath": "/ncs:devices/ncs:device[ncs:ncs:name='os']/ncs:config/ios:hostname itential.com",
"value": "iDndWU",
"ruleId": "108a200d-cb60-1e09-e1e2-5c46d5b3f7f1"
},
{
"xpath": "/ncs:devices/ncs:device[ncs:ncs:name='os']/ncs:name",
"value": "SsrVL",
"ruleId": "e8bd05e1-cfeb-67b8-2731-82ae32769a89"
}
]
}
Copied to Clipboard
{
"type": "object",
"properties": {
"xpath": {
"type": "array",
"items": {
"type": "object",
"properties": {
"xpath": {
"type": "string",
"enum": [
"/ncs:devices/ncs:device[ncs:ncs:name='os']/ncs:config/ios:hostname itential.com",
"/ncs:devices/ncs:device[ncs:ncs:name='os']/ncs:name"
]
},
"value": {
"type": "string",
"pattern": "[A-Za-z]+"
},
"ruleId": {
"type": "string",
"pattern": "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"
}
},
"required": [
"xpath",
"value",
"ruleId"
]
}
}
},
"required": [
"xpath"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
config |
object |
FAML object |
Copied to Clipboard
{
"_attr": {
"type": "list",
"ns": "http://tail-f.com/ns/ncs",
"prefix": "ncs",
"condition": "must",
"severity": "warning"
},
"_keys": [
"HeYG",
"M",
"FKcPnYqEgz",
"uGl",
"KaNnSsqINy"
],
"_children": [
{
"f": {
"_attr": {
"type": "leaf",
"ns": "http://tail-f.com/ns/config/1.0",
"prefix": "ios",
"condition": "cant",
"severity": "warning"
},
"_value": "M"
}
},
{
"R": {
"_attr": {
"type": "leaf",
"ns": "http://tail-f.com/ns/ncs",
"prefix": "ios",
"condition": "must",
"severity": "notices"
},
"_value": "F"
}
},
{
"b": {
"_attr": {
"type": "list",
"ns": "http://tail-f.com/ns/ncs",
"prefix": "ios",
"condition": "cant",
"severity": "warning"
}
}
},
{
"t": {
"_attr": {
"type": "keyword",
"ns": "http://tail-f.com/ns/ncs",
"prefix": "ncs",
"condition": "must",
"severity": "error"
},
"_value": "f"
}
},
{
"z": {
"_attr": {
"type": "list",
"ns": "http://tail-f.com/ns/config/1.0",
"prefix": "ios",
"condition": "cant",
"severity": "error"
}
}
}
]
}