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": "e655bd65faf50b826c4a6bd3", "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": "b593d877754f998c03a5fe3f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "12f2627e8a198900ee068cdb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "db7e7cc5aa9e8670f57d5509", "name": "eu occaecat in Excepteur" } ] }, { "_id": "074b29dff2d15ecc4fb54560", "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": "7e89e178bf7e6174b092bda5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9bbb66cf586cab8581614c42", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "457e7fc5c6655a13fc20d4fd", "name": "occaecat do sunt" }, { "_id": "027dc70547bc1e940046e805", "name": "incididunt" } ] }, { "_id": "9e45597f9207534c115ebf0f", "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": "3a834a68e96f3bd11a664eb7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7bac8e79994a895361d47879", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e1c424decab2614c4f3b92bc", "name": "sed" } ] } ] }
{ "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 mollit", "original": { "_id": "da14ad7b32133c517b356da0", "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": "8707b294129cb92f244371fe", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b2c3f759e54d1275b008d70d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e7534c0b7d62e11caf89acc0", "name": "sit labore dolore" } ] }, "created": null, "edit": "incididunt", "success": true }, { "message": "eu dolore consequat ullamco non", "original": { "_id": "ef5c278a27c7d98e570cd84b", "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": "1290d813f93b62e1b92a8f6f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cb638459a089a173a91c74ca", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "51fe143d6187ae6bd06a4e1e", "name": "ad minim est dolore voluptate" }, { "_id": "6c177fe6ac4fe8a40e350238", "name": "proident incididunt esse ut" }, { "_id": "6e26e1593cbbcc98c051c6ad", "name": "occaecat ut" }, { "_id": "98ec8d2326976954f260cf9a", "name": "amet in irure" }, { "_id": "9964a5c23f9caa97d9f457ca", "name": "elit" } ] }, "created": null, "edit": "esse tempor in", "success": true }, { "message": "elit est qui esse exercitation", "original": { "_id": "758cdaed7f647abd4724bdf7", "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": "51aabe8808df27a17d864930", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "65a86a012aff8d03f4ca4ed1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "009d87f35406852bd69b034f", "name": "minim do tempor est" }, { "_id": "76f9451c80852cc2136b635e", "name": "minim pariatur nostrud Lorem culpa" }, { "_id": "feefd3f88f9edad10e0fce08", "name": "reprehenderit" }, { "_id": "ad345543e5953cbc12902523", "name": "commodo ullamco" }, { "_id": "38b54421f0f160c9e7fef667", "name": "cillum ut veniam qui in" } ] }, "created": null, "edit": "mollit", "success": false }, { "message": "nulla sint Duis", "original": { "_id": "2929b24089d69f0aabfeacd2", "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": "ce71e43a7005f35400bcedb1", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e1ba6907f375dc10c8706daa", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a821ff0fb75c6d00af3ab1ba", "name": "in minim" }, { "_id": "9f54e447946832d052493d59", "name": "ipsum" } ] }, "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": "401D1b2A2756A8d8d6DaFDBc", "createdBy": "07d03BdC5cbE7dCde7f8F080", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "8976fe3dE4EC2dc37b83cC21", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "fd5fDC97EA7d7aBE51dfFf7B", "name": "nisi nostrud", "description": "A user-defined object to help group documents." }, { "_id": "D5dA3cE46CcF9eF4aeF79735", "name": "est", "description": "A user-defined object to help group documents." } ] }, "edit": "est do ex id aliqua", "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" ] } } } }