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": "3a46441e491ed356ec4a428c", "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": "93083a7c7220cec8f3244684", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "63fb4ee324524d33135a0b48", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6ac7cf8e4a28535de27e85e2", "name": "ad nisi non exercitation" }, { "_id": "270bea09af7ec995bd7fd0f4", "name": "ut magna aute" }, { "_id": "4ff46773b786799dc22d9da0", "name": "veniam Lorem consectetur id cillum" }, { "_id": "8ef885ab4c40658700916f40", "name": "magna" }, { "_id": "a352388678788c6f32140f85", "name": "Excepteur non" } ] }, { "_id": "9b40dba07aee6cf7376f30f2", "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": "7aE5Ad8EAC0bd5Dfd036Dcc0", "createdBy": "dc2edcd283ec01d6693f4880", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0280c4537b20eafa0ff81da3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9bfff0fc019f390d1165e7dc", "name": "ea Duis elit" }, { "_id": "31f3e4d94bb6c22977cef881", "name": "dolor incididunt ut consectetur sed" }, { "_id": "79d78ce40cfd81521ab9166c", "name": "eu" }, { "_id": "9bb19bc165bc46cac60b3761", "name": "pariatur sed in" } ] } ] }
{ "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": "Duis dolore culpa", "original": { "_id": "d4e661517e79a9d66d86e6e8", "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": "bc588f099756384a57ba8189", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c6533edd08f56b9712a34435", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a9d4cce114ff2d3000148d00", "name": "sunt dolore" }, { "_id": "a0124a1b93a42df1173e74b0", "name": "enim aliquip minim deserunt" }, { "_id": "70cc79557ccfbcf31651d71b", "name": "incididunt Lorem sit nisi" }, { "_id": "f1660ab5a8e084cf041d173e", "name": "sunt Lorem" } ] }, "created": null, "edit": null, "success": false }, { "message": "do cillum amet dolore fugiat", "original": { "_id": "f9fbcba9c74cff824561d1bd", "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": "2d6569af67b78536e8189216", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "33696218ece690649ecb8860", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "061d6ec8bb16dda2ef2a9858", "name": "non" }, { "_id": "931d0d880084628572c5de71", "name": "laborum fugiat aliquip" } ] }, "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": "aFA2c80b91daFc49a4406F0E", "namespace": { "type": "project", "name": "in eu anim", "accessControl": { "read": [ "dolor minim cupidatat velit", "Duis nulla dolor laborum", "Ut sunt dolore", "quis aliquip eu" ], "write": [ "nulla adipisicing est", "occaecat reprehenderit eu Excepteur in", "nulla adipisicing irure dolore occaecat", "id aliquip laboris", "do nisi" ], "execute": [ "ut incididunt anim sunt Excepteur" ], "manage": [ "nulla nisi est ut non", "in", "sint deserunt eiusmod velit" ] } }, "createdBy": "AEcfEFf8b5bC63E38fF089b8", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "3025d1A2DA9AC087fd9F4A0C", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "F8baB1bA9eE8baEBd69dAa48", "name": "ut culpa laboris" }, { "_id": "0befD68e7d3E4534Aa24d892", "name": "velit anim" }, { "_id": "0fD3AbECafeAc0cD3ef9043d", "name": "do ex irure" } ] }, "edit": null, "success": false }, { "message": "labore cillum ea ad", "original": { "_id": "f1172b6be56628b7578889bc", "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": "8bebf0ab13a850df43b98544", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5cf2d4e3106a3bcc6f29b9bf", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "744544f041261f0fbdb8b166", "name": "Excepteur ullamco eu" }, { "_id": "32172a203eec7e23c38fe189", "name": "culpa et" }, { "_id": "6fdb417a41728781575ee829", "name": "deserunt magna labore mollit" }, { "_id": "33ded6f79a5ccd9b9cc1e17c", "name": "enim et dolor Lorem" }, { "_id": "4aa3e17da32cbd6f1fa98e9e", "name": "elit cupidatat dolore Lorem eiusmod" } ] }, "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": "89E2860BeE0b61B5BDc6a9fb", "namespace": { "type": "project", "name": "Excepteur nulla", "accessControl": { "read": [ "in", "eu sunt", "exercitation dolore proident esse voluptate", "sint sed commodo eu" ], "write": [ "id aliqua", "labore sint quis ea", "nulla velit ut ullamco", "Ut occaecat eiusmod non tempor", "exercitation" ], "execute": [ "culpa", "est cillum", "voluptate enim ex sed", "pariatur mollit", "cillum" ], "manage": [ "laboris aliqua sed ipsum", "pariatur tempor nulla", "esse" ] } }, "createdBy": "2b53BA808Cc3268a852eD2C4", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "8Fab72E44A40d8d0fb90c62D", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "AFdBb40AE1b1DeabdF9F65bB", "name": "in tempor" }, { "_id": "F790Cdee7d1d0D8b72A67E71", "name": "ullamco sunt adipisicing sint" }, { "_id": "8F5cBd77ee5FdD3f55a6F4Ee", "name": "mollit" }, { "_id": "6A993b9a5EAccEC5DBD66D19", "name": "pariatur do commodo" }, { "_id": "af9c3196a81350E1cEf9aDaA", "name": "enim consectetur aute voluptate" } ] }, "edit": "dolor Ut deserunt elit ut", "success": true } ] }
{ "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" ] } } } }