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": "c042d75f3c342cd8c3691289", "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", "createdBy": "5dd78ef31103661076838d5d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "28d9944c78235bb0353ba464", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5d6ea4f8751cced3d2a54bd2", "name": "laboris" }, { "_id": "fe7781770868bd55a014c965", "name": "enim Duis" }, { "_id": "c5cc9f6ac066bd4858592a0d", "name": "cillum ullamco tempor" }, { "_id": "8cf2f8c82b58bbaa203131d5", "name": "sed non qui in et" }, { "_id": "afa0d04cb167d664648c5b95", "name": "dolor nisi et Excepteur in" } ] }, { "_id": "7b966faea2b3bb94e0a7ad93", "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", "createdBy": "98bf1be9198d3e08d6385740", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f1928e93a5f990c345d209db", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4d1d926bfb88913df91088f0", "name": "in ullamco" }, { "_id": "c5163fa625ebf637b392cf29", "name": "dolore amet" }, { "_id": "316b533b0140ff765fe7151c", "name": "proident sunt tempor Duis Ut" }, { "_id": "84821c731c30c6ad6fe5f53f", "name": "occaecat sint" }, { "_id": "c3d7a263b938543ce198eb72", "name": "nisi velit" } ] }, { "_id": "5991983e6db755f60abbc8bc", "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", "createdBy": "026e2ee4235b4047ee6cb52e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2f060d81c1174b66646a7a8a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "bad52930fe1b1a66f46b26df", "name": "non aliquip" }, { "_id": "4106897437736597945faad2", "name": "ex irure in" }, { "_id": "4595d9bc183500c11a726ba8", "name": "amet ut eu tempor" }, { "_id": "72c76443ec3c58904eddc45f", "name": "eu aliquip dolore incididunt" }, { "_id": "ee0bcb60358bb2e9552a2a30", "name": "cillum cupidatat aliqua ipsum elit" } ] } ] }
{ "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": "adipisicing irure velit sunt et", "original": { "_id": "89bd125c75c4c35d212da433", "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", "createdBy": "673c2111d0949392d92b3b75", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1d637b198fa047612940299b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2e1e442d5e59bdfe7ee1b0e5", "name": "esse proident ullamco aliquip" } ] }, "created": null, "edit": null, "success": true }, { "message": "aliquip in quis ipsum qui", "original": { "_id": "07a3443fd9b0a8b970bc6c19", "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", "createdBy": "f6c2cd8996622048bfacca92", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9e0168419e5692e6e3144644", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c89a738f337977b20b7de137", "name": "velit" } ] }, "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": "13eCf1ee56FDA8b2b0badeD6", "createdBy": "0Ba4c8A11Bb0145CA9aAe64A", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "b7E83bACE98A66fCE7adfF54", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "A05A13BeaCEd605F8cdead62", "name": "mollit laboris culpa in elit", "description": "A user-defined object to help group documents." }, { "_id": "236BE8Ac10804B60c5e1F830", "name": "tempor esse Lorem in", "description": "A user-defined object to help group documents." }, { "_id": "4B246c282C01f716deCF1C06", "name": "velit enim Duis", "description": "A user-defined object to help group documents." }, { "_id": "7ff393a72ABCb84ECe40EeaA", "name": "quis mollit labore", "description": "A user-defined object to help group documents." }, { "_id": "FaBB251e0d10AF8Be53abBff", "name": "laborum dolor voluptate cillum", "description": "A user-defined object to help group documents." } ] }, "edit": "consectetur sit cupidatat Ut Duis", "success": false }, { "message": "aute dolor officia dolore", "original": { "_id": "322e4d2e80bc9ca1e9b12f11", "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", "createdBy": "2ad258c2f78d4ba183647ecb", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "66b7ba482242ca80ba918377", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9f73c9a075c3b4d1962aac85", "name": "adipisicing dolor elit" }, { "_id": "1955dc537754a753b8ff206e", "name": "nisi" }, { "_id": "0d266191ceeba189ee6c7935", "name": "reprehenderit" }, { "_id": "1bf00de5d2f9d7ff5b160085", "name": "commodo magna exercitation" } ] }, "created": null, "edit": "proident veniam pariatur", "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }