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": "0c391fbe471fa869830202cd", "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": "21f960511ddebd16ab5de2d5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "72e32555ed47dbbe4cc533b2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f6665d9fd2cabcc03bf1ec86", "name": "quis irure minim qui anim" }, { "_id": "735b9379f21fa002954928d4", "name": "in" }, { "_id": "190516c559d4ad8b51e030c2", "name": "in elit magna dolore fugiat" }, { "_id": "06f4d4ddae416cf3462a9117", "name": "ex Duis" }, { "_id": "c9def9949201a1bb93ddfbae", "name": "ut" } ] } ] }
{ "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": "in dolore in", "original": { "_id": "5ea24f226e06f75c2064c80d", "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": "F98b5Bafa7a6bcfaae76B4dC", "createdBy": "9ddfca5c0d8e0e9bded1f1f6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a55d6b09206e7e53952f4541", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a44731189ad898c1f8ce28ea", "name": "in elit aliquip adipisicing" }, { "_id": "14b7d416635281937e54f341", "name": "incididunt" }, { "_id": "f8b8306b2d3182103ce3af29", "name": "deserunt ea est amet tempor" }, { "_id": "2fc06c8c08f1179522abf51c", "name": "ut aliquip aliqua eiusmod exercitation" } ] }, "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": "2618A7Addf3299CABddE0A4e", "namespace": { "type": "project", "name": "pariatur id nisi reprehenderit in", "accessControl": { "read": [ "dolore", "in", "irure Excepteur aute Duis tempor", "et" ], "write": [ "ut Ut ea", "sit in", "qui", "ipsum ullamco dolor", "deserunt et" ], "execute": [ "dolore Lorem ut ut laborum", "amet voluptate est", "magna esse do nulla", "dolore labore", "cupidatat sunt mollit do aute" ], "manage": [ "in nostrud officia elit est" ] } }, "createdBy": "c9B15bfEd0bC07ceA2F0AC18", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "153a9Fd618E1B44dbd37e886", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7bE6D9b94f67A8ddFFa5CC46", "name": "mollit" }, { "_id": "1CDEF23D6A16FE16BD65E3Fe", "name": "qui" }, { "_id": "Ef94dF3B08a99c481cD7cC78", "name": "tempor do dolor sint" }, { "_id": "4ee8aCC6FC7B8a2beF9712a5", "name": "minim deserunt culpa" }, { "_id": "b530898fe9FdC8E10F911a8b", "name": "aliqua in" } ] }, "edit": "cupidatat labore et ut", "success": false }, { "message": "consectetur voluptate", "original": { "_id": "492844dac804f6a516f49e69", "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": "B3b7cEF0Ed7d898dcd6945EF", "createdBy": "3c178c06eceb04880e571405", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "357df45c3a6c7668a8cd58e8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2760ea507dadfa05e51117b4", "name": "sed commodo" }, { "_id": "5c21585f89e503d760901485", "name": "sit culpa in mollit" }, { "_id": "183b73e0c6062fc73befea7f", "name": "consectetur est voluptate ad" }, { "_id": "84aaa0feaedd936f716e5921", "name": "mollit pariatur do incididunt" }, { "_id": "173e7221e5fcd0548d5c1289", "name": "fugiat officia" } ] }, "created": null, "edit": "velit nulla culpa sunt nisi", "success": true }, { "message": "proident enim id sit mollit", "original": { "_id": "4da4e9a3c73532cf530baf71", "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": "9a9d42c94c27000c7a935899", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bd00784e3a622df4ef1dd93f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f9dffb5cf26b3c52a6bac27b", "name": "deserunt cillum adipisicing" }, { "_id": "4430df40f93e0119af379ad1", "name": "nostrud magna voluptate" } ] }, "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": "a1735f0E3C5f72b20c8c8eF5", "namespace": { "type": "project", "name": "reprehenderit enim aute", "accessControl": { "read": [ "dolor dolore in tempor do", "sint", "qui", "adipisicing reprehenderit", "velit" ], "write": [ "dolor" ], "execute": [ "qui id ex", "pariatur enim magna ut cillum", "consectetur est exercitation", "Lorem aute veniam dolor" ], "manage": [ "occaecat", "Duis proident tempor irure", "ut adipisicing aute in nostrud", "anim aliqua dolor sint dolore" ] } }, "createdBy": "FC0f5DdEafF36313404dE70B", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "9eDcAb1cFB9075dAFc33DC0C", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2C2D2Ba849bAAd01eCA9193f", "name": "deserunt" }, { "_id": "3EC43DeEFB7a472Eaf867Bd0", "name": "ullamco dolor mollit tempor eu" } ] }, "edit": null, "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" ] } } } }