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": "e0fd317b-8433-63b8-caa7-87f98e763c33", "form": { "name": "Form 123", "children": [ { "properties": { "type": "leafref", "path": "/ncs:devices/ncs:device/ncs:name", "min": "1", "max": "4", "minLength": null, "maxLength": null, "default": null, "direction": "vertical", "required": true, "enforce": false, "hidden": false }, "id": "laborum culpa", "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": null, "minLength": "1", "maxLength": null, "default": false, "direction": "vertical", "required": false, "enforce": false, "hidden": true }, "id": "eiusmod ex", "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": null, "minLength": null, "maxLength": null, "default": true, "direction": "vertical", "required": false, "enforce": false, "hidden": false }, "id": "sed eiusmod consequat 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": "service.vlanid" }, { "properties": { "type": "leafref", "path": "/ncs:devices/ncs:device/ncs:name", "min": "1", "max": null, "minLength": "1", "maxLength": "4", "default": false, "direction": "vertical", "required": false, "enforce": true, "hidden": true }, "id": "eu dolor sunt nisi", "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": "4", "minLength": "1", "maxLength": "4", "default": "consequat Excepteur", "direction": "vertical", "required": true, "enforce": false, "hidden": true }, "id": "eu aliqua anim occaecat ea", "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": "1de50f9a-02d9-624b-6fb4-29a2f9b93462", "groups": [ "d731975f5de9ff1b73f939c7", "ff48691e1960fc138932424f" ], "created": "1994-04-30T03:54:03.749Z", "created_by": "3c534e9535e6e618e7998f17", "last_updated": "1997-06-12T17:49:41.674Z", "last_updated_by": "ac49687bc87acde6b3e4b5fb", "tags": [ "proident dolore", "amet Ut nostrud dolor" ] }, "faml": { "_attr": { "type": "list", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "cant", "severity": "notices" }, "_keys": [ "pTWSN", "jXdTH" ], "_children": [ { "t": { "_attr": { "type": "leaf", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "must", "severity": "notices" }, "_value": "m" } }, { "U": { "_attr": { "type": "keyword", "ns": "http://tail-f.com/ns/ncs", "prefix": "ncs", "condition": "must", "severity": "notices" } } }, { "F": { "_attr": { "type": "leaf", "ns": "http://tail-f.com/ns/config/1.0", "prefix": "ios", "condition": "must", "severity": "error" }, "_value": "H" } }, { "V": { "_attr": { "type": "keyword", "ns": "http://tail-f.com/ns/config/1.0", "prefix": "ncs", "condition": "must", "severity": "warning" } } } ] }, "name": "UgJCzXDU", "native": "interface GigabitEthernet 1", "os": "junos", "created": "1375429281853", "create_by": "ZloQP" } }
{ "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" ] }