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": "66671aa70323cd07f9178f83", "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": "AF2BB2eCdC6849067b8D0735", "createdBy": "8aa3c75d4bff60626415f763", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1da252e3464b13945e1b2dba", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ec913354787f418353ba97c8", "name": "cillum nostrud Duis in" } ] }, { "_id": "f6cbd645d6fb07d3873a9d42", "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": "e52436144e8eaeb114044561", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "44b0c389a28ea37cef7964e0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "07fe37fd23acce135d144bb9", "name": "exercitation mollit veniam" }, { "_id": "e524a07dcef527839aa1fd28", "name": "incididunt mollit culpa minim in" }, { "_id": "bb964cde135c345433d7e93d", "name": "labore" }, { "_id": "6c69b122482ebf4f702fdb4f", "name": "amet laboris" }, { "_id": "5e93344af6ac5dd5b9735904", "name": "ut sint aute magna voluptate" } ] }, { "_id": "5f7491fc95ece5546eef516c", "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": "022b55e5e2e6c6e8665efd26", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3824a9e4281bfa70a850d9d9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "52f7d872bc6e9d6a7605ce5b", "name": "voluptate nisi sunt" }, { "_id": "545ed30c28e0f943e3f9c048", "name": "dolor labore aliquip in consequat" } ] } ] }
{ "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": "tempor esse exercitation est", "original": { "_id": "2a21f85a64e2a8282b62535d", "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": "24b6ffc0c00020ba7e4de658", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cad4dacfddb0fafc7b00e582", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "011f7b88fcf3a03a7123fb40", "name": "laborum irure in quis enim" }, { "_id": "5a1a8d23e9b29d7b703846d1", "name": "nisi veniam" } ] }, "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": "cAA1Ee3fEf7FaeDfaDbeA5cf", "namespace": { "type": "project", "name": "non do", "accessControl": { "read": [ "adipisicing tempor", "enim", "commodo Duis pariatur sed" ], "write": [ "eu occaecat dolor Duis", "ut proident labore ullamco", "aliqua pariatur irure", "et fugiat deserunt nisi laboris" ], "execute": [ "dolore enim voluptate" ], "manage": [ "enim minim eiusmod magna ut", "id incididunt veniam minim sed" ] } }, "createdBy": "1EaDCA4fAD4931FA8Fdf3e1F", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "adae91EA8BE58c9ABd129e6A", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3d52D37E7B03C511FCE9a9D9", "name": "ut" } ] }, "edit": null, "success": false }, { "message": "labore exercitation sunt", "original": { "_id": "895cd6e3746f764979e1abfd", "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": "324ce12a34dd86fa195454a2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "28b4fcd82a161507c748c73c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2108b8fdd56d99cf3d3255bb", "name": "deserunt mollit anim ut minim" }, { "_id": "3515d07745d0fd6b5dace435", "name": "cupidatat proident elit" }, { "_id": "87960d439aaf6632e07b6491", "name": "reprehenderit" }, { "_id": "d2ea2cf696a97c2255c12d81", "name": "est enim reprehenderit" } ] }, "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": "8ab8D4F01154b61DFe86b2EA", "namespace": { "type": "project", "name": "ea aliquip cillum elit", "accessControl": { "read": [ "ut laborum consequat laboris", "deserunt ullamco velit", "sint mollit dolor cupidatat", "non elit aute ipsum laboris", "elit" ], "write": [ "exercitation sed voluptate" ], "execute": [ "adipisicing et in veniam laboris" ], "manage": [ "adipisicing occaecat ullamco" ] } }, "createdBy": "AB8698DFCcA56efd99FF6fb6", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "b99e48d37513FD3F176027B4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "DdC4eDb21A7f04F71Ed32aDE", "name": "Lorem id exercitation enim" }, { "_id": "7BB9BAd39bFBbF0041b639BE", "name": "eiusmod" }, { "_id": "Cc4a1bC8B5ea99734ffFE321", "name": "elit nulla aliqua Lorem sint" } ] }, "edit": "deserunt veniam ad", "success": false }, { "message": "adipisicing officia exercitation ut ex", "original": { "_id": "093ae0ccaf527cab0977f052", "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": "0d85ced4b3c35b6f094de41d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5699b742f0f552f0d798405b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e89c67d844b6bf370dc17166", "name": "cupidatat sed nisi in" }, { "_id": "402bb80863ebb06416142ca0", "name": "nisi consectetur in" }, { "_id": "610a5266b7b74880450b14fe", "name": "reprehenderit dolore" } ] }, "created": null, "edit": "sit est dolor dolore ut", "success": true }, { "message": "laboris ad in occaecat Lorem", "original": { "_id": "3aee2d0df7f6d0f70568a23a", "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": "DDDFaA767be7676cB5aC74c3", "createdBy": "5fffeffa35f6b08ad363bccf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "fbefa597a2f626e5cb78af6a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "568637d3be933ec2cedaf690", "name": "veniam tempor amet proident" }, { "_id": "2dc2664d52915a3b86a1a879", "name": "enim fugiat sunt cupidatat eiusmod" }, { "_id": "cd01c9e293adfb607cb6f823", "name": "consectetur ipsum Ut pariatur occaecat" }, { "_id": "3e22eaefe7e037ea64eb6b05", "name": "cupidatat adipisicing" } ] }, "created": null, "edit": null, "success": false }, { "message": "labore fugiat ad eu reprehenderit", "original": { "_id": "697fffef9948d8c594566958", "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": "60522f8ecfc18d421bdd34a3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8f9c7e5b1d0d2d4416e1bc4e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2dd565208a8841be55ab0d5d", "name": "mollit" }, { "_id": "3de89da28b99207a8a052323", "name": "Ut laborum aliqua" } ] }, "created": null, "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.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }