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": "8edc5409-23b0-6e85-d996-0c41e06542fe", "form": { "name": "Form 123", "children": [ { "properties": { "type": "leafref", "path": "/ncs:devices/ncs:device/ncs:name", "min": null, "max": "4", "minLength": "1", "maxLength": "4", "default": -81252554.65956852, "direction": "vertical", "required": true, "enforce": true, "hidden": true }, "id": "Lorem qui velit deserunt", "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": "1", "maxLength": "4", "default": 38588081.61194661, "direction": "vertical", "required": false, "enforce": true, "hidden": true }, "id": "exercitation aliquip", "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": null, "maxLength": null, "default": "cillum dolor Lorem", "direction": "vertical", "required": false, "enforce": false, "hidden": true }, "id": "exercitation dolor eiusmod", "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" } }, { "type": "service_model", "id": { "name": "/ncs:services/test_devices:service_name" } } ], "_id": "d337ee1c-22db-eb92-cfa2-29902166516d", "groups": [ "d91027f2890cb52d6b41d302", "ff3f419942c38ed00fa6bd4b" ], "created": "1998-12-13T02:14:21.639Z", "created_by": "205e06840aff2304ea910a1a", "last_updated": "1997-09-04T10:17:11.565Z", "last_updated_by": "a69b99292713090ca674988d", "tags": [ "id cupidatat", "nisi sunt occaecat reprehenderit" ] }, "faml": { "_attr": { "type": "leaf", "ns": "http://tail-f.com/ns/config/1.0", "prefix": "ios", "condition": "must", "severity": "error" }, "_keys": [ "eIZlAMaEwh", "dTLYxCr", "B" ], "_children": [ { "V": { "_attr": { "type": "leaf", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "must", "severity": "error" }, "_value": "Z" } }, { "a": { "_attr": { "type": "keyword", "ns": "http://tail-f.com/ns/ncs", "prefix": "ios", "condition": "must", "severity": "error" }, "_value": "l" } } ] }, "name": "HwBUPPOU", "native": "interface GigabitEthernet 1", "os": "eos", "created": "1988417498967", "create_by": "wFOGymuVKYw" } }
{ "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" ] }