Summary
Save a Template
Description
Save a Smart Template
Route
PUT /smart_template/save
Roles
Parameters
Name | Type | Required | Description |
---|---|---|---|
smart_template | object | yes | Smart template object with details |
{ "smart_template": { "_id": "d2275197-67b4-8f27-6f21-9290cbe8be9f", "form": { "name": "Form 123", "children": [ { "properties": { "type": "leafref", "path": "/ncs:devices/ncs:device/ncs:name", "min": null, "max": null, "minLength": "1", "maxLength": "4", "default": "magna", "direction": "vertical", "required": true, "enforce": true, "hidden": true }, "id": "non voluptate dolor", "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" }, { "properties": { "type": "leafref", "path": "/ncs:devices/ncs:device/ncs:name", "min": "1", "max": "4", "minLength": null, "maxLength": null, "default": true, "direction": "vertical", "required": true, "enforce": true, "hidden": false }, "id": "enim labore esse consectetur", "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": "1", "max": "4", "minLength": "1", "maxLength": null, "default": null, "direction": "vertical", "required": false, "enforce": false, "hidden": true }, "id": "deserunt quis laborum in", "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" }, { "properties": { "type": "leafref", "path": "/ncs:devices/ncs:device/ncs:name", "min": null, "max": "4", "minLength": "1", "maxLength": "4", "default": 9714905.039155886, "direction": "vertical", "required": true, "enforce": false, "hidden": false }, "id": "incididunt Excepteur ea Lorem pariatur", "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" } } ], "_id": "679ffaf4-5c35-1434-e475-7294c7b78ece", "groups": [ "28edf162084d52c53ef2d120", "424e41670ad19dc7c9775cf0" ], "created": "1957-11-10T10:38:32.521Z", "created_by": "e92a59db7b4e2cc49c65d55b", "last_updated": "1994-08-02T07:29:11.051Z", "last_updated_by": "8e006dde9f01d1428485932b", "tags": [ "dolor veniam occaecat", "veniam labore", "laboris proident incididunt amet" ] }, "faml": { "_attr": { "type": "keyword", "ns": "http://tail-f.com/ns/config/1.0", "prefix": "ios", "condition": "must", "severity": "notices" }, "_keys": [ "mKpfdLf", "SMztmVirMm", "WZzFmJsRX", "Xt" ], "_children": [ { "X": { "_attr": { "type": "leaf", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "cant", "severity": "error" } } }, { "w": { "_attr": { "type": "list", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "cant", "severity": "error" } } }, { "K": { "_attr": { "type": "leaf", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "cant", "severity": "warning" }, "_value": "l" } }, { "Z": { "_attr": { "type": "keyword", "ns": "http://tail-f.com/ns/config/1.0", "prefix": "ios", "condition": "cant", "severity": "error" } } }, { "J": { "_attr": { "type": "keyword", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "cant", "severity": "notices" } } } ] }, "name": "htrquKBc", "native": "hostname itential", "os": "eos", "created": "1124684826428", "create_by": "V" } }
{ "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
Name | Type | Description |
---|---|---|
smart_template | object | Number of objects created or modified |
{ "n": 1, "nModified": 1, "ok": 1 }
{ "type": "object", "properties": { "n": { "type": "number", "enum": [ 1 ] }, "nModified": { "type": "number", "enum": [ 1 ] }, "ok": { "type": "number", "enum": [ 1 ] } }, "required": [ "n", "nModified", "ok" ] }