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": "ff4bece079399e21c0b61e04", "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": "bf7de1cb3c7647259bcca690", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bc44da100c455d08ed7df592", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "7e5b58ea082e90d0eb892ca9", "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": "f1646facd4001111e2b8b28a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "616323179ecc9bd7602b7e58", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "3907fb47bb09fc87a561bc97", "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": "39ac48ae5791e8964cdab37d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "835ba93bfa324033af647d31", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "9beefd5aedc6f620de9dd1d9", "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": "07be51d378ac4bdc65e38a26", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c751c0a960cf8aca690670a4", "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": "Lorem magna nulla veniam et", "original": { "_id": "4d6352c64c3bb4d6c923ffd0", "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": "f121c9bb030333a7ddd816c8", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0e66f50e6679f0e26e8bcca0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "0B08fFE0Fd3CfC26cBEdcF3a", "createdBy": "E5b52dc291C5b24dd8b7ebB6", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "88dBEc3D8A0e33FFA2DeB7aA", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": false }, { "message": "ea culpa occaecat qui", "original": { "_id": "468f65139783550bf02f16ae", "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": "4e7d3b5e93e750e102d74630", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "47f1b28a9a87260033c5cf50", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "id et enim velit pariatur", "success": true }, { "message": "enim dolore labore", "original": { "_id": "8a3eb05e3598742d4a1c8295", "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": "aca744cf6188c652ef735f8b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a6b5dafa7362ddb03b8dd864", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "0CdCA50BAa7fE45f062bdfE2", "createdBy": "AB4C40CCE18adb6D2E84dbBB", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "a8fabb6B051fE36972F39B79", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": true }, { "message": "voluptate non incididunt nulla ullamco", "original": { "_id": "d83b1b3745cef346eb5326b2", "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": "4a1c8059fe3f37b222fdd080", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c62b17cad66056c3e54eda00", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "CeCb6Cb23AB10AD1b9Ff3f08", "createdBy": "65A0C91db3BFd016ea5DD3FB", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "Ff0FB6aE8d22ced5adcF453e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }