Summary
Save a Template
Description
Save a Smart Template
Route
PUT /smart_template/save
Roles
admin
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
smart_template |
object |
yes |
Smart template object with details |
Copied to Clipboard
{
"smart_template": {
"_id": "256f5345-909c-1d6c-92eb-6f0f566d32d5",
"form": {
"name": "Form 123",
"children": [
{
"properties": {
"type": "leafref",
"path": "/ncs:devices/ncs:device/ncs:name",
"min": "1",
"max": null,
"minLength": null,
"maxLength": null,
"default": false,
"direction": "vertical",
"required": true,
"enforce": false,
"hidden": true
},
"id": "consectetur ut mollit enim",
"type": "container",
"element": "{\"type\":\"service_model\",\"id\":{\"name\":\"/ncs:services/devices:stringified_json\"}",
"name": "vlan_id_123",
"display_name": "vlan",
"source_type": "service_model",
"source": "/ncs:services/abc_devices:ios.device",
"key": "service.vlanid"
}
],
"elements": [
{
"type": "service_model",
"id": {
"name": "/ncs:services/test_devices:service_name"
}
},
{
"type": "service_model",
"id": {
"name": "/ncs:services/test_devices:service_name"
}
},
{
"type": "service_model",
"id": {
"name": "/ncs:services/test_devices:service_name"
}
},
{
"type": "service_model",
"id": {
"name": "/ncs:services/test_devices:service_name"
}
},
{
"type": "service_model",
"id": {
"name": "/ncs:services/test_devices:service_name"
}
}
],
"_id": "bef79d11-bb21-26f7-6c69-a9b9339ac396",
"groups": [
"40d700263eb4a2e03307d07d",
"4f70f6bba431c7e1085c6bd3"
],
"created": "1945-10-23T20:41:32.482Z",
"created_by": "bbec4781c132ae722140ec95",
"last_updated": "1960-09-28T22:05:13.088Z",
"last_updated_by": "b0a0eef81075fe6cdcbda127",
"tags": [
"consequat exercitation ipsum enim ut",
"sint qui officia incididunt sit",
"mollit et dolor ea dolor",
"dolor qui cupidatat aute"
]
},
"faml": {
"_attr": {
"type": "keyword",
"ns": "http://tail-f.com/ns/config/1.0",
"prefix": "ios",
"condition": "cant",
"severity": "warning"
}
},
"name": "hptRf",
"native": "hostname itential",
"os": "eos",
"created": "1365617144958",
"create_by": "WRHfwVHnCFI"
}
}
Copied to Clipboard
{
"type": "object",
"properties": {
"smart_template": {
"type": "object",
"properties": {
"_id": {
"type": "string",
"pattern": "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"
},
"form": {
"$ref": "formDocument"
},
"faml": {
"oneOf": [
{
"$ref": "famlObject#/definitions/famlLeaf"
},
{
"$ref": "famlObject#/definitions/famlContainer"
},
{
"$ref": "famlObject#/definitions/famlList"
}
]
},
"name": {
"type": "string",
"pattern": "[A-Za-z]+"
},
"native": {
"type": "string",
"enum": [
"hostname itential",
"interface GigabitEthernet 1"
]
},
"os": {
"type": "string",
"enum": [
"cisco-ios, cisco-iosxr",
"eos",
"junos"
]
},
"create_by": {
"type": "string",
"pattern": "[A-Za-z]+"
},
"created": {
"type": "string",
"pattern": "1[1-9]{12}"
}
},
"required": [
"_id",
"form",
"faml",
"name",
"native",
"os",
"created_by",
"created"
]
}
},
"required": [
"smart_template"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
smart_template |
object |
Number of objects created or modified |
Copied to Clipboard
{
"n": 1,
"nModified": 1,
"ok": 1
}
Copied to Clipboard
{
"type": "object",
"properties": {
"n": {
"type": "number",
"enum": [
1
]
},
"nModified": {
"type": "number",
"enum": [
1
]
},
"ok": {
"type": "number",
"enum": [
1
]
}
},
"required": [
"n",
"nModified",
"ok"
]
}