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": "d489113a5f552a1b06e3cbde", "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": "EFeECB0E4e9CfaDfd5Ca752D", "createdBy": "43c46a6d52f08a86ddb18b2d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c96a8c2869798d7460da7266", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4e47cb110bf23905bf7ac7c1", "name": "proident sunt eu" }, { "_id": "402308d1da3aa4b7a2a1f256", "name": "aute" }, { "_id": "d02bdf6c6f0b87047c7997e4", "name": "fugiat dolor id ea culpa" }, { "_id": "4137644f441e515a340758a0", "name": "laboris fugiat" } ] }, { "_id": "728693825a54abdf2f028609", "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": "a55ECAF130F75FdadfcBB5F7", "createdBy": "c40fe728fbd8277a3fd08954", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ad1ba5d98395b3f600e35b46", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "25ad0f78814702dcb8ca3436", "name": "nulla dolore do exercitation" }, { "_id": "18aca684c087f5e9b05bc4f1", "name": "officia est aute deserunt ea" }, { "_id": "f8745518edaab711773cb108", "name": "labore dolor occaecat" } ] } ] }
{ "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": "labore eu", "original": { "_id": "3e6ca67e1c93f5d1d66775dd", "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": "BBa9Ff4B9b75eF91dB33Fee9", "createdBy": "077022bc8f1a12cd4cd65a5a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1e8379c7b2b13d628ff54a4b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9443a700d9491afc61bd1026", "name": "Duis" }, { "_id": "b24d6a05ead077eb2ccba61c", "name": "in ullamco ut" }, { "_id": "5338b078eb43d5a866136774", "name": "sunt in cupidatat" } ] }, "created": null, "edit": "adipisicing", "success": false }, { "message": "quis adipisicing", "original": { "_id": "df532d0269555ca76fe4283f", "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": "7E623296cfEa6B1b9AACB7CC", "createdBy": "ce811bc9cb47bc3014b43839", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9aa8b5d711545496efd867ee", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8a51a8b771d5b4f744f2d2be", "name": "occaecat laborum" }, { "_id": "0beaa4a98e462d3ca8dcc102", "name": "eu elit nostrud" }, { "_id": "516d83afd8888955314efa21", "name": "adipisicing est incididunt elit" } ] }, "created": null, "edit": "nisi", "success": false }, { "message": "Lorem Excepteur reprehenderit", "original": { "_id": "5a0782d74b500f9aeb374342", "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": "a77d9e53455df37335ccaf76", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c23ec1c08d26bc0c048c40ae", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c1a72ad3729f77657c797b76", "name": "ut dolore incididunt" }, { "_id": "d63603ef6abf0a3ebabd7bec", "name": "ullamco enim aute cillum in" }, { "_id": "24ecff4f916d4894d74d054b", "name": "incididunt Lorem" }, { "_id": "367a315caf92c47d4a7762b2", "name": "dolore adipisicing id 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": "72AD91e89CAdACe1bfdDDB71", "namespace": { "type": "project", "name": "laborum", "accessControl": { "read": [ "ipsum nisi esse commodo ut" ], "write": [ "amet cupidatat in proident", "magna in velit officia" ], "execute": [ "veniam proident labore nostrud" ], "manage": [ "anim cillum esse", "dolore est incididunt" ] } }, "createdBy": "3b9969Ee4db08DA2eDfeD66b", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "27ec8B2CB4e8ce18EfB94792", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "eb68e7096FDccdA5cbDA66FC", "name": "laboris amet elit qui dolor" }, { "_id": "E3c280ccB1e090381E9ccFB6", "name": "exercitation elit aute sed" }, { "_id": "7aFcB1a7bCD543f0BA6bEF7C", "name": "sed Duis ullamco non" }, { "_id": "CcDad1adFE6A6FE4Ca7DE26f", "name": "laborum irure exercitation cillum" }, { "_id": "Aba7Eb5cFd37a88BD12DbFC9", "name": "amet" } ] }, "edit": null, "success": false }, { "message": "commodo", "original": { "_id": "3778c45036b3ea1be114e737", "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": "f103ac15475f2a5e39d57834", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "59f66b64bcb0e17f02c2a813", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "29c9979f94ceffda68c308b7", "name": "dolore sit esse" }, { "_id": "1f657cb27a333146653d8f3d", "name": "labore incididunt sint" }, { "_id": "b993c326c8d7b3d5155fd230", "name": "commodo elit reprehenderit amet dolor" }, { "_id": "7b2a98f2de0661717b8cd6b2", "name": "non nulla" } ] }, "created": null, "edit": "non", "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" ] } } } }