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": "ab3d3596-0f30-7399-6cdb-67d06b3db7af",
"form": {
"name": "Form 123",
"children": [
{
"properties": {
"type": "leafref",
"path": "/ncs:devices/ncs:device/ncs:name",
"min": "1",
"max": "4",
"minLength": null,
"maxLength": "4",
"default": 25302681.49617432,
"direction": "vertical",
"required": true,
"enforce": false,
"hidden": true
},
"id": "quis sunt ad",
"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": "cc35822b-8478-d491-29b2-865ea56d5d98",
"groups": [
"583a476065c3489ad985f3cf",
"2d15db586e5126a9d1f17c7d",
"a546f2354094cccb9a03506c"
],
"created": "1994-12-04T08:02:48.863Z",
"created_by": "88f7b077fb334be0ec529cde",
"last_updated": "2000-08-05T23:45:15.062Z",
"last_updated_by": "4bbed7331e581c6901052b66",
"tags": [
"laborum labore",
"dolore ut proident non",
"culpa ad",
"fugiat consectetur velit qui",
"ipsum fugiat commodo"
]
},
"faml": {
"_attr": {
"type": "leaf",
"ns": "http://tail-f.com/ns/config/1.0",
"prefix": "ios",
"condition": "cant",
"severity": "notices"
},
"_value": "c"
},
"name": "QXblDkpE",
"native": "hostname itential",
"os": "junos",
"created": "1421342713251",
"create_by": "bQLPq"
}
}
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"
]
}