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": "bdd68fc391071b501ce2231a", "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": "4d7ab44a73ed8534a5a66851", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4c51e92b819cfc91f8b18b1a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "85d4cc294fa6fe0a5b3b8081", "name": "ut exercitation esse" }, { "_id": "521915dbd0fee770afdb02b6", "name": "deserunt amet dolor ullamco sint" }, { "_id": "08f7061ad04515b3bca5077b", "name": "reprehenderit" }, { "_id": "c0a4a249ba4e6d2711c9ed22", "name": "voluptate dolore ut cupidatat do" }, { "_id": "03e59529c8408de56b6f0a84", "name": "pariatur deserunt magna non" } ] }, { "_id": "cf3b63ca3197b5a2e7a146d4", "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": "d47053b59f51cf51e86aafb5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "dbda006474cf73fa24aa5f80", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1862775eed5cbec419330228", "name": "amet" } ] }, { "_id": "ccbd27ff225fc4f4ac3de953", "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": "98203583f54288ed06e10aad", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b31d5f302123e6de0766b2a6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6192f55d0faf59fac488442b", "name": "do reprehenderit eiusmod" }, { "_id": "40844cf353c333078c132d58", "name": "exercitation reprehenderit" }, { "_id": "d952a5be2e32fac53d4e855c", "name": "dolor minim laboris" }, { "_id": "4a682716dbcc2b925b2f26aa", "name": "amet aliqua adipisicing" }, { "_id": "d787a0fa5deecd772fd44c67", "name": "labore pariatur" } ] } ] }
{ "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": "incididunt eiusmod proident", "original": { "_id": "09d4d0fa7da3f10e7fe00000", "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": "cc5db161a0cc38222d5014da", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2ffb1a8db7874d3ea04d2052", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c492dd912331fdc0845b3c78", "name": "mollit" }, { "_id": "6f69e60f2bcfac0739343b78", "name": "magna" }, { "_id": "9e1dbee227c572cf687f865a", "name": "velit sit in" } ] }, "created": null, "edit": "officia", "success": false }, { "message": "ipsum cupidatat in magna", "original": { "_id": "2529c3f2cb7cdb292d5d6aaf", "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": "cf9757548c91de7f6b7a6d00", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "abd3e2587ed4f34a81f4fe10", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3c5d595c8369eaadc07dc3a0", "name": "officia" }, { "_id": "5fe714d234c65defc08d6b7e", "name": "aliqua incididunt adipisicing commodo Lorem" }, { "_id": "e56b274cac28d3acbdb1aa23", "name": "qui id" }, { "_id": "25b5b5f92b706eee0753f48e", "name": "laborum dolor velit nostrud" }, { "_id": "cc6eb346c6244e33c6018b34", "name": "tempor ipsum ea culpa cillum" } ] }, "created": null, "edit": null, "success": true }, { "message": "consectetur velit", "original": { "_id": "be3c556d19ca3d3b91256c21", "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": "5d86def937a84a2ac1e8983e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8ab97cd68673de84cfd46cda", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0015f6d22140fc1d7930815d", "name": "in" }, { "_id": "6fa3fbb3670ec9848ca64e6d", "name": "ullamco ut consectetur ex" } ] }, "created": null, "edit": "laborum Excepteur ullamco non", "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" ] } } } }