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": "9e99b61f5729585c5362eee6", "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": "12f6a1a2fb0b551b7a34ec5a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ad30b544b00f437b93ba0a3c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4e85c92df9be48e4bd21b8cb", "name": "ut proident in minim sunt" }, { "_id": "9073197cd641c776d0795a50", "name": "in enim Excepteur dolor" }, { "_id": "5d05a8b53b93be112a6f5bd8", "name": "consectetur amet aute" } ] } ] }
{ "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": "ut dolore deserunt", "original": { "_id": "d098606a0f70160569c4d405", "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": "e18e9a075b75cc67636fba2a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9f08b59569b0e40c95de2a24", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "103c9f0d18ae4ec2b61ffa96", "name": "cupidatat" }, { "_id": "6380df4c1bed9746a8da1be2", "name": "sit ipsum occaecat cillum sed" }, { "_id": "d3e28a6d0a89c70217ae6fd4", "name": "in Ut commodo ad" } ] }, "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": "21CA8672c03306f9987a4635", "createdBy": "DDC0Acd466DDD497e08eF30c", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "AdAF8705d4BFeD8E4fC3394A", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "76B9c2F9e59C8bBbB34a1b2c", "name": "mollit pariatur nostrud laborum Excepteur" }, { "_id": "9C0eAfCED9F7bdF74eE7C7D9", "name": "Excepteur" }, { "_id": "BaA1557fdc79efAda442cc78", "name": "minim ut est anim in" }, { "_id": "FeDB2E1eCc78EAa74dcaDAcB", "name": "commodo irure laboris in" } ] }, "edit": null, "success": true }, { "message": "do Duis adipisicing", "original": { "_id": "56baee25b5a79b85936b761d", "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": "fca53d9f92a3807dc17ec0fc", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6e83a0e1c84b843a1ba76bcb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "bb6c1a1d76db54ecd1e20525", "name": "aliqua dolore sint adipisicing" }, { "_id": "1ffaf336366ccf3cb379676d", "name": "adipisicing tempor non" }, { "_id": "0183d8872e60f88554685883", "name": "pariatur amet officia" }, { "_id": "f125f3e5b07440240957a8fb", "name": "in sunt" } ] }, "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": "FD58967fFb882Ea26EE96bBA", "createdBy": "dBEDcC314E5ceb97D86CCE55", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "2deb64eAC4877f1E9c2a8651", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4B3fA7CFce18dE0e1BA36BD0", "name": "ea aute do dolor est" } ] }, "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" ] } } } }