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": "2592a7f615ef9a9a2933d374", "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": "DBFC54c957Bd4c37FcaA5Ba4", "createdBy": "e6ac57544bd86d41d387e6f5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8a4aedce58d620297197e010", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "602581e21fee1bb52400066d", "name": "dolor fugiat est officia laboris" }, { "_id": "6e8a07f507d42dc72fc1ddec", "name": "pariatur velit" }, { "_id": "88e558718d1a85b3c77c1a75", "name": "eiusmod incididunt" } ] }, { "_id": "24fb684ff3989aaceb4e0fe8", "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": "502Df06B10d9D9920aEFC7BC", "createdBy": "91849fa0df72d58c6f226992", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "95de97e211184c91aa0432ca", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "201818a4c9c138124e817c53", "name": "voluptate" }, { "_id": "6e5b2d693ed69a69464d27d0", "name": "dolor ipsum dolore" }, { "_id": "ef998216ee8f45b5e62c0f8e", "name": "dolor elit" } ] }, { "_id": "937f8ff0eaa2c0c22159f698", "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": "f48c569333a9aef0ac58c60f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d2e214fa965c2f3d26ee077d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d6271caf2f8ac34d6d46ed21", "name": "ex amet laboris" }, { "_id": "5ccf6437269cbd671f83e286", "name": "sit in enim" }, { "_id": "f17663061ad5a5887bb78135", "name": "in labore laboris Excepteur cillum" }, { "_id": "1c37ac30a7d5638cf7fdaffa", "name": "ullamco" }, { "_id": "f0db570b859be3cb91d3c290", "name": "amet" } ] }, { "_id": "0b4e1ea8ac29225b7106175a", "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": null, "createdBy": "c976e4dba3c20c5dc3fe7a0a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c9a67853592ebbf9a73e757b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8a52792815e32ae4e4b6f95c", "name": "sit velit voluptate eiusmod" } ] }, { "_id": "38a66657bd408d4175d383dc", "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": "a81A5fdafceb30f71fEFa7bA", "createdBy": "0f5f82b5722fb13cf969668b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bc322507253abb94ce167ea8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "019a17d076d87c3881d629af", "name": "aliqua ut" } ] } ] }
{ "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": "officia id Ut aliquip amet", "original": { "_id": "2d189c4b7127fbda23405fb2", "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": null, "createdBy": "eae8ecbe49b6effc5cd0c230", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e32343c0430beea7d31429e3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7e8162bbca37ca048fcb0afa", "name": "veniam in" }, { "_id": "026b2e259d0b4232420b2f8a", "name": "consectetur consequat reprehenderit incididunt enim" } ] }, "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": "ABD0ca92fbe06EF0bd8739B5", "namespace": { "type": "project", "name": "eu ipsum Duis", "accessControl": { "read": [ "nisi velit exercitation dolor", "consectetur id in", "nisi dolore tempor officia in", "est in mollit esse minim" ], "write": [ "eu aliquip sint deserunt", "anim et", "velit id ullamco aliqua" ], "execute": [ "labore dolore cupidatat", "Duis voluptate aute id et" ], "manage": [ "et cillum", "cillum aliquip esse", "sit pariatur enim non voluptate" ] } }, "createdBy": "C6a5e3e955a1c35E4075E32B", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "Fdb84fb2F0b940F3E5493873", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d1090CCccdbcBb01EFbF9987", "name": "do" }, { "_id": "103Dc849EDc93fD1fb1EC790", "name": "Lorem nulla" }, { "_id": "0e3c11935fEA091Ac644dd53", "name": "magna pariatur" } ] }, "edit": "aliquip", "success": false }, { "message": "amet magna enim ullamco adipisicing", "original": { "_id": "e87011d1424e697a672ae495", "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": "d7210b82dD6646de36fFd2Da", "createdBy": "629b824f325131bc0e92fde3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "93ed727dfa96d078a2c9d644", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "21fda5b8dc89d5607cb1944d", "name": "ad incididunt quis" } ] }, "created": null, "edit": "consequat cupidatat eu ut occaecat", "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" ] } } } }