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": "4c29092cbc0e4a57492e8403", "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": "e468c0c8b2b05eb3352697de", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "246f001825355693000d1d18", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3ff0de8aa5a105f1d5021c7f", "name": "pariatur consectetur deserunt" }, { "_id": "50578d4c7e958147f79e5250", "name": "tempor occaecat pariatur" }, { "_id": "2ae56e336aff4f793008bec1", "name": "sunt" }, { "_id": "6e0b4a8198b85d0980c25518", "name": "Lorem in id deserunt proident" }, { "_id": "48c3ed388654b481cc6c48b4", "name": "adipisicing esse veniam Excepteur" } ] }, { "_id": "a822e3ab842cab8e34b7e98c", "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": "499cdfcee4b88770f71202ed", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6c0015b06efea5001d7eba0b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "de05560f657ffde93b2746d8", "name": "eu ut" }, { "_id": "f9f8472cdf5f63a9dedc50dd", "name": "in" }, { "_id": "b6d6c98d155b8e19deb087db", "name": "dolore ea nostrud elit" }, { "_id": "3c19e23e4c33442a0354ab86", "name": "aute aliqua Lorem" } ] } ] }
{ "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": "nostrud in", "original": { "_id": "fe36862e4eb8b08e55de2c5b", "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": "6795aea904dd1ca327929f49", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "fad932280df47884f0119c13", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1e0eab1be822e6eeaf0a5fc4", "name": "culpa dolore velit consectetur laborum" }, { "_id": "b806f6e9fb2e06e992be1a7b", "name": "quis ex" }, { "_id": "d89df74dee1d2219b5389e73", "name": "aliqua exercitation" }, { "_id": "488138aca46cd0b7d0bb63c0", "name": "dolor" }, { "_id": "b5938586b83e96128c850d61", "name": "aliquip" } ] }, "created": null, "edit": "do ut culpa Duis veniam", "success": true }, { "message": "est ut sint fugiat ipsum", "original": { "_id": "b85247cba07e22802d03689f", "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": "031a1f6bb27ad3e455cd2708", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "888a8a4fea1618fc2a5d9561", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "70678bd93661a82ac35124de", "name": "eiusmod enim dolor" }, { "_id": "ebd5096384a9e0adb1dcfba3", "name": "proident elit" } ] }, "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": "50E5bDFA05F6a1e06CCEeB4b", "createdBy": "3ef7f6f56C47DDA410c59229", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "F80f74BbFa9E2C1eD1fa5D56", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "C340f89A5ef5e6338F1A46C0", "name": "id dolore", "description": "A user-defined object to help group documents." }, { "_id": "91fc5B1ca7Cb3ED37CB9ff5b", "name": "in", "description": "A user-defined object to help group documents." }, { "_id": "47cB61365EBC3B3C6C48aEFd", "name": "ullamco aliqua deserunt", "description": "A user-defined object to help group documents." } ] }, "edit": null, "success": false }, { "message": "nostrud in occaecat mollit", "original": { "_id": "9ac5f43de1c22740314ebd23", "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": "12bd7baa92240fc46d785351", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9ce5bd808019b646f4fd4665", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a78455704d0deb52401db656", "name": "dolore" }, { "_id": "bb4a15c86205a2e38b0ba8f0", "name": "mollit" } ] }, "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }