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": "c7424c21c9eafbf5cf1bbff8", "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": "673fb5d689569140e139066a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "815cd08da4a7bd87c0ad0908", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "03095826b8889c75ac43454b", "name": "eu" }, { "_id": "1f14e4cf38edc7ef2270f28f", "name": "sed laborum do" }, { "_id": "8b78e562ed64ccad672b4520", "name": "ipsum officia" }, { "_id": "68908eae4f0f257c4da94364", "name": "incididunt" } ] }, { "_id": "37cd6b2f38dad925a8a1fa17", "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": "a4791210d4d47bc075027848", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2758d7c4e167ade1d85eecb4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f71f3e6e86947b6c740c3e1b", "name": "enim veniam" }, { "_id": "c55c993246d4586cbd581bf4", "name": "est commodo sit" }, { "_id": "1ef0e4f1efd3922fa834a1f2", "name": "consectetur aliquip officia" }, { "_id": "a5bb4f42726bae9f007f16a9", "name": "quis" } ] }, { "_id": "be4822ddfb096cdd5c12fec5", "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": "156ccad8eeeaee161b98b2c0", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "15fa1697298bafa660485ef1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "41bfd924fcb234670e83ca83", "name": "aliquip ad culpa" }, { "_id": "1a02efd41d85e974894f49df", "name": "pariatur dolore Ut ad nostrud" }, { "_id": "c9b3fd03f1193861712ee2df", "name": "ipsum elit quis id" }, { "_id": "73f372998ef89ed750a6de52", "name": "sit esse" }, { "_id": "cf2da6491f1e8e86894c4507", "name": "dolor dolore mollit laborum 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": "et sint", "original": { "_id": "107daa11a1926807f36f08c1", "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": "3e8481a0721085d1221fdd1f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "26b827310eec14c0117e8ed8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e234350d71ef4b95500a4beb", "name": "minim Lorem" }, { "_id": "cd811efb70836e4258a7737f", "name": "cupidatat ex" }, { "_id": "c6d6ad1169f06b0bb887a0d4", "name": "consequat laborum dolore" } ] }, "created": null, "edit": "id ut culpa minim consequat", "success": true }, { "message": "in ex amet magna sunt", "original": { "_id": "d14e97cbbf892e3b9522f383", "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": "76e34d9f1a2d6b4fe8e08739", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f5b17311211c1ed58801db3f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1400fca5398543606d99ac72", "name": "dolore commodo mollit" } ] }, "created": null, "edit": null, "success": false }, { "message": "laborum", "original": { "_id": "f06a84fd9f86d33310334bb9", "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": "527957ec32d95f5179d746ad", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2541af3e44c810a068b1a0d7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "234b67ca340154cd02abb006", "name": "irure eiusmod ad Excepteur sit" }, { "_id": "211ba744fc05213892aebe53", "name": "sit in Lorem" }, { "_id": "f766674da7c4bd350fb294ed", "name": "esse tempor eu incididunt in" } ] }, "created": null, "edit": "aute consequat", "success": false }, { "message": "irure mollit", "original": { "_id": "028fb9df685b7749349f3c07", "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": "eb9389e8c8cd7968331787f3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7b69aa4d83629ac468ae0cfa", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c0aa285a1348a7a208eabeb2", "name": "est aliqua cillum culpa dolore" } ] }, "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": "efcfb35DC6eBaa4e16cFdc92", "createdBy": "52AB6FEee71DdEa1a257fc4e", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "4e24355bf95a41a8f942777a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ae46CC7BB8BaD547aFdB2C3d", "name": "consectetur", "description": "A user-defined object to help group documents." } ] }, "edit": "ut consequat", "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }