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": "7613a121-84b4-8c3b-4f2a-d8f3f13cc788",
"form": {
"name": "Form 123",
"children": [
{
"properties": {
"type": "leafref",
"path": "/ncs:devices/ncs:device/ncs:name",
"min": null,
"max": "4",
"minLength": null,
"maxLength": null,
"default": -75242772.15564546,
"direction": "vertical",
"required": false,
"enforce": false,
"hidden": false
},
"id": "officia elit aliquip incididunt labore",
"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"
}
}
],
"_id": "e018b64c-058f-8f73-9aa9-91286a650bc5",
"groups": [
"0a9b2729c847402396648ef0"
],
"created": "1962-04-05T08:19:11.193Z",
"created_by": "15f378659b2f28563a16cead",
"last_updated": "2008-10-06T15:43:10.886Z",
"last_updated_by": "5a6796cfcdd4eb73dbf3199c",
"tags": [
"elit qui",
"nisi consectetur",
"deserunt cupidatat",
"reprehenderit",
"in"
]
},
"faml": {
"_attr": {
"type": "list",
"ns": "http://tail-f.com/ns/ncs",
"prefix": "ncs",
"condition": "must",
"severity": "error"
},
"_value": "j"
},
"name": "QtEezlw",
"native": "hostname itential",
"os": "junos",
"created": "1248336131441",
"create_by": "lespblKd"
}
}
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"
]
}