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": "12f8329a426337c78a405af5", "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": "708860fdc5b2242e87e4a833", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1f8578550dc00e4fabcfa4ae", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c705ac044e10d7d1e93d3188", "name": "aliquip deserunt eu" } ] }, { "_id": "7952d0d5c7a2aeb7cd575ee4", "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": "c372e356D7d3F8e134AfF6C3", "createdBy": "0e367b935613a48532954663", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a1e6cdaf3b95af8b41ee635f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e0c7b4791adfbf4176d887b9", "name": "aute nostrud fugiat consequat aliquip" }, { "_id": "25f4c7ccec8232a402f08241", "name": "dolore laborum aliqua" } ] }, { "_id": "1778548ffa6f64ef63de2cc3", "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": "d26bc502ebaBdd3F0f3A8778", "createdBy": "85e3cd03abd2e256e773ecc5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "896138468a3ec5930e3a1c30", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b61f2be6831986ba5389bfef", "name": "dolor ea magna ullamco labore" }, { "_id": "fdd72a504a930f6e15e25255", "name": "aliquip enim pariatur quis veniam" }, { "_id": "12d19ae79d7246e6ea796ffd", "name": "consectetur eu commodo Ut" }, { "_id": "ced1168926b4b21352f9a338", "name": "in" }, { "_id": "cd1844a429122a5eab4cf4fd", "name": "in do Duis nisi occaecat" } ] }, { "_id": "b3c291d1a3263e0fa832d075", "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": "B01E13e3B31aF3e3ff87EEAb", "createdBy": "87f1dde2861c47e56a6c8ca3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "47aca2dc674f7163580108e2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ec2f5f075098cd687307bc80", "name": "nisi in Lorem" } ] }, { "_id": "dd26007b039fcd64c5c2a147", "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": "647a7c6c02e1c705881e8774", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "40b384a3c6d0c4d38210eb98", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a7cde19be8469805d3f28713", "name": "Ut ea" }, { "_id": "3c2956c370e2c755901cf11e", "name": "ut laborum" }, { "_id": "949cac566069cca59949b39c", "name": "laborum aliquip laboris sit nulla" }, { "_id": "98652c7cf39a1085c320e940", "name": "fugiat consequat nostrud cupidatat Lorem" }, { "_id": "df804755d1e7a13239ceb3a4", "name": "amet id consequat nulla est" } ] } ] }
{ "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": "Excepteur", "original": { "_id": "a022ae03106a50e11858d804", "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": "6d687eccc3b8eced64022faf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "54b937b047f2bf1c53f139cd", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e1136a7561ec2240e3b3afbc", "name": "amet non magna" } ] }, "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": "AA023c34C391e9e28D6c3DB8", "namespace": { "type": "project", "name": "tempor proident reprehenderit", "accessControl": { "read": [ "laboris Ut", "quis", "dolor id deserunt nulla" ], "write": [ "deserunt officia ea elit", "occaecat exercitation", "sint deserunt consequat", "anim cillum nisi Excepteur", "dolore occaecat sed esse" ], "execute": [ "pariatur dolor", "dolore" ], "manage": [ "reprehenderit", "ut ad eiusmod pariatur", "ex deserunt", "cupidatat veniam" ] } }, "createdBy": "2f92bE3edD1FD9eEa31B4C20", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "dD9e83ecbCb19cDa44BF81d6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "dBdBcEdaDaFb615A0cfE4309", "name": "velit ad dolore reprehenderit veniam" }, { "_id": "aB1BaaEd4B972b2D3e3ad3bd", "name": "elit in sit dolore sed" }, { "_id": "ffEFeC5C312af51baC1BaAe3", "name": "labore officia ut" }, { "_id": "6efeFb0243D24a02Fc0b0933", "name": "in veniam do" }, { "_id": "91ecb5E6000bEE97bdFAa5aC", "name": "dolor" } ] }, "edit": "eu", "success": true }, { "message": "mollit anim aute", "original": { "_id": "89619eba24973b0d1601c3cb", "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": "61972c4f15cba3a60ea5ed3c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7d0a18c0ddabecb970af70bc", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "db8166917c3b6cca685a097b", "name": "in eiusmod exercitation et aute" }, { "_id": "f5b0b6788bd810845e18d479", "name": "elit" }, { "_id": "599c8527fe1e2c3ce6004934", "name": "dolore" } ] }, "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": "8D0f9CBA33Eac9861D45174C", "namespace": { "type": "project", "name": "sit laboris aliquip", "accessControl": { "read": [ "dolore in minim commodo", "cillum Ut tempor anim", "labore" ], "write": [ "ad sunt labore velit Ut", "reprehenderit" ], "execute": [ "magna", "fugiat esse sed", "officia", "ea", "et laborum id aute eiusmod" ], "manage": [ "aliqua sint mollit occaecat", "quis sed consequat nulla", "sit do quis dolor", "Lorem in Duis" ] } }, "createdBy": "b2E8E9D8FC5c26bF634070a3", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "5B6D599DaAfcFeEa732E28AB", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "D5edA0ABdfa020dB05CCe0B5", "name": "in cillum magna" }, { "_id": "015Bf764D2ccd559Ea1D648A", "name": "qui non incididunt" }, { "_id": "Aff56dfc26dc0cBEB5F7Cd61", "name": "nisi culpa" }, { "_id": "Dd043e870F9Caf7d49Ee5Ada", "name": "Ut eiusmod in sint" }, { "_id": "ddd851Bf52E1De850ecF70Ce", "name": "anim eiusmod quis sint magna" } ] }, "edit": null, "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" ] } } } }