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": "7663537db3466336ac2d1036", "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": "0ba4825f2b1c07257b11a51c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9b2d510d69a3bb4da1e7cdd2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "fdad2f892dff738ab3fbc1f8", "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": "7badc3b7f53fe50e79297bc1", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4b8a8807a55614601d064dc0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "7fe4dc717940e23044cac0c1", "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": "1467b24ad881ea64b1bde593", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3a2c9ffdf285cc6289e939fa", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "96e9667c2798fa85c182e835", "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": "719d1911b1524d36bb47a348", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "64784af90b3792895c81e2ab", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "dd4bc8e3e017a01c417565a8", "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": "58a1e0f698b99b86adb00bf6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3c2ea249cf7ed1691d98cd58", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 } ] }
{ "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": "ad exercitation nisi", "original": { "_id": "d72dea254c60ac3b54f08e1c", "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": "0b8368602a2f653f68c82908", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e2f921e93b4415a09b5a26e4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": false }, { "message": "qui tempor ut", "original": { "_id": "79c2789867691ee63447bd74", "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": "2ea40f4672a27c7425858738", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f2b727506e5fc9288eaaa880", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "voluptate mollit occaecat enim", "success": true }, { "message": "voluptate laboris nisi sit", "original": { "_id": "5b2b7291f3a744e4dbbadc0b", "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": "6376a7df3dc70a3f5ccc8a7a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "44bec42517bcbbe82bf0a4a6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "aliquip ad", "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }