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": "8deb48c5-3bd4-83d6-2003-1211b69b7a1a",
"form": {
"name": "Form 123",
"children": [
{
"properties": {
"type": "leafref",
"path": "/ncs:devices/ncs:device/ncs:name",
"min": null,
"max": null,
"minLength": null,
"maxLength": null,
"default": "reprehenderit ullamco magna laboris",
"direction": "vertical",
"required": false,
"enforce": true,
"hidden": false
},
"id": "in sed eu",
"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": "c213273b-1bab-a32a-d593-962cac0608c7",
"groups": [
"552f87b29d95d83f0b7a9ecc"
],
"created": "2015-04-23T20:20:23.116Z",
"created_by": "24d579008939ba46845a20e0",
"last_updated": "1983-11-23T15:35:45.946Z",
"last_updated_by": "eb6d04faef90fe2d5d2fb20a",
"tags": [
"dolor"
]
},
"faml": {
"_attr": {
"type": "keyword",
"ns": "http://tail-f.com/ns/config/1.0",
"prefix": "ncs",
"condition": "cant",
"severity": "warning"
},
"_value": "o"
},
"name": "Pyguilnr",
"native": "hostname itential",
"os": "junos",
"created": "1627672747122",
"create_by": "vERTwfsCjnF"
}
}
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"
]
}