Summary
Imports a new template document.
Description
Imports a new template document.
Route
POST /automation-studio/templates/import
Roles
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| templates | array | yes | Templates array. |
{ "templates": [ { "_id": "96715d4091dd254a1a389e16", "name": "test", "device": "Sample group", "command": "show ip br", "template": "Value FIRST_WORD (S+)\n\nStart\n ^FIRST_WORD.* -> Record", "text": "some sample text to match against", "type": "test", "projectId": null, "createdBy": "ddbb3737d283956226becbf6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e1195793795b98d726a5a547", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ab7bdeba0b30cc921eaee4d2", "name": "ex do" }, { "_id": "6a952d9f73e49cf63b170c69", "name": "pariatur proident sed" }, { "_id": "4ed2a09941e50e8770b6e7dd", "name": "minim ea" }, { "_id": "15c63a99e04c3ff117de7b3e", "name": "ut nisi" }, { "_id": "26eadbdc59a68d5c2810d64e", "name": "irure aliqua" } ] }, { "_id": "7d249e86e1ea027a7437dd21", "name": "test", "device": "Sample group", "command": "show ip br", "template": "Value FIRST_WORD (S+)\n\nStart\n ^FIRST_WORD.* -> Record", "text": "some sample text to match against", "type": "test", "projectId": "334aAeaBb2DBEb78a7898969", "createdBy": "578023d0e899477be0705bc3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e4d13bf585404d15d9bf6f51", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e272fa2dc06931262dfc1e71", "name": "quis in ea" }, { "_id": "947b3b80630e42532fabb35e", "name": "sunt commodo" }, { "_id": "96aaf5d04c2a61e7da9ef2e3", "name": "Duis" }, { "_id": "eb78296a72f55f0f1076f3f0", "name": "eiusmod deserunt" } ] } ] }
{ "type": "object", "properties": { "templates": { "title": "templates", "description": "Array of template documents to import. If '_id' is provided, it will be replaced with an autogenerated '_id'. If a template's name is already used in the templates collection, it will be renamed with a numeric suffix.", "type": "array", "items": { "$ref": "templateImport" } } }, "required": [ "templates" ], "additionalProperties": false }
Return
| Name | Type | Description |
|---|---|---|
| response | object | Results from each individual import operation. |
{ "imported": [ { "message": "veniam aute in", "original": { "_id": "f710abfdc78e7bd3ef7b720b", "name": "test", "group": "Sample group", "command": "show ip br", "description": "description", "template": "Value FIRST_WORD (S+)\n\nStart\n ^FIRST_WORD.* -> Record", "data": "some sample text to match against", "type": "test", "projectId": null, "createdBy": "c7576d2a77abd030af483fdf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "99cbaea13fb8d9ee58873593", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8e9fd5a8e595cb133c75a366", "name": "aute dolor" }, { "_id": "9e0d838d0b43ea825e4b7db2", "name": "irure" }, { "_id": "a14acbba00c38e6f70615383", "name": "nostrud aute veniam aliqua" } ] }, "created": { "name": "test", "group": "Sample group", "command": "show ip br", "description": "description", "template": "Value FIRST_WORD (S+)\n\nStart\n ^FIRST_WORD.* -> Record", "data": "some sample text to match against", "type": "test", "_id": "EC9bebe42fDbFBef69aCC875", "namespace": { "type": "project", "name": "tempor occaecat non", "accessControl": { "read": [ "ex id nostrud reprehenderit" ], "write": [ "est minim enim cupidatat aliquip", "quis minim nostrud sit" ], "execute": [ "deserunt consequat incididunt", "sed consequat in aliquip ut", "aliquip", "laborum minim ut in enim" ], "manage": [ "labore et ullamco", "amet officia mollit dolore ut", "sed Lorem", "pariatur non consectetur cupidatat", "cupidatat Duis proident" ] } }, "createdBy": "9239eAbc60E884eC6AAa497a", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "db0Dc066C23150C08bDB21A2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "bE5e61A9Ce1bC67FF1DA88ed", "name": "amet dolor in Duis ullamco" }, { "_id": "19BcEf1dcEeb23eDbC9f1CaC", "name": "cupidatat incididunt dolor" }, { "_id": "F0D92DB2f37cA6CD40C7D4B1", "name": "ad in" } ] }, "edit": "ipsum proident veniam mollit enim", "success": false } ] }
{ "title": "response", "type": "object", "properties": { "imported": { "type": "array", "items": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Status flag denoting the success (true) or failure (false) of the template's import operation." }, "message": { "type": "string", "description": "Message containing either confirmation of the import operation or the reason for the failure of the import operation." }, "original": { "description": "The original template given in the import array.", "$ref": "templateImport" }, "created": { "description": "The imported template as it exists after being imported.", "oneOf": [ { "$ref": "template" }, { "type": "null" } ] }, "edit": { "description": "URI to the edit page for the imported template.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }