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": "1c0ead2b-6b7d-4378-7797-9c8967d28b80",
"form": {
"name": "Form 123",
"children": [
{
"properties": {
"type": "leafref",
"path": "/ncs:devices/ncs:device/ncs:name",
"min": "1",
"max": null,
"minLength": "1",
"maxLength": null,
"default": null,
"direction": "vertical",
"required": true,
"enforce": true,
"hidden": true
},
"id": "commodo nostrud cillum",
"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"
},
{
"properties": {
"type": "leafref",
"path": "/ncs:devices/ncs:device/ncs:name",
"min": null,
"max": null,
"minLength": null,
"maxLength": null,
"default": "ad non",
"direction": "vertical",
"required": true,
"enforce": false,
"hidden": true
},
"id": "ex esse dolore",
"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": "key545385c3-fc66-491b-bf6f-abc2214366dc"
}
],
"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"
}
}
],
"_id": "48ffb3a6-1cf2-f384-9118-183d599f9057",
"groups": [
"b6411984962a38e502c659d2",
"3b6579acfd75640e9b8a5602",
"cbf725fb05a22a293d2ac3bb",
"85ffa8b00981fda1138d0fa5"
],
"created": "2014-12-16T23:37:25.579Z",
"created_by": "8dc9b52f760eb282b594ea00",
"last_updated": "2006-04-14T04:23:37.249Z",
"last_updated_by": "18ef506fb4b803da52698ed4",
"tags": [
"pariatur nulla nisi amet",
"nisi",
"veniam sed Duis nulla"
]
},
"faml": {
"_attr": {
"type": "leaf",
"ns": "http://tail-f.com/ns/ncs",
"prefix": "ios",
"condition": "cant",
"severity": "warning"
}
},
"name": "PAlSa",
"native": "interface GigabitEthernet 1",
"os": "junos",
"created": "1811723293888",
"create_by": "M"
}
}
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"
]
}