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": "947124fcce1775d5529bbfce", "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": "c284817447ae9f5f3539e454", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cc8394b4f4748e8634fac5b1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d01eae857c92448208fc9f42", "name": "Ut id anim sint" }, { "_id": "a4af8b11f07962c90bf147a1", "name": "nisi consequat non" }, { "_id": "9a183d3821758008b04607b1", "name": "laboris" }, { "_id": "512b1d6848d6ccc290cbc6d6", "name": "nulla reprehenderit" }, { "_id": "17bd659fbd0aacb921b8da5c", "name": "in culpa eu officia" } ] } ] }
{ "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": "culpa quis nostrud cupidatat", "original": { "_id": "2c4750d505002b15c6382565", "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": "0631277318a3ed9b81c7c0e7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "76b860d45b680cc19868ab5e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8cc55a273f23e8e9b42f300e", "name": "consequat" } ] }, "created": null, "edit": null, "success": true }, { "message": "laborum dolor in voluptate sed", "original": { "_id": "57c7c1681d2de348f52b5c55", "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": "33b5d1382bdf363cef43f384", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bed97739ac38a41751a95042", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e58b3935c83efcc923b89536", "name": "dolore magna Ut" }, { "_id": "da4532620cfb7e25f218e183", "name": "cillum" }, { "_id": "156e614bdc828f4633731564", "name": "cupidatat consectetur" }, { "_id": "73657fdf0b7401c6059e5e13", "name": "proident ea veniam" } ] }, "created": null, "edit": null, "success": true }, { "message": "reprehenderit officia voluptate", "original": { "_id": "e8e1533ecb1cfb8d8637bbb1", "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": "2a5ec15ca1a9df0dbf7012f6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1ed4f33e988b35d04d509f2c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d6a262387788bf7cf5c627b5", "name": "sed amet esse mollit" } ] }, "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": "CFc92CeCE8cD70faB5E53eFA", "createdBy": "3A21b7B71DEbE1b544803b1c", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "C225FcA60b4E3E550FfBEeE1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "574Abea0E07ffB7DE133CA1C", "name": "dolore" }, { "_id": "279A0b0B8a9FCe2fA6fA4E2D", "name": "commodo adipisicing Ut Excepteur incididunt" }, { "_id": "B9b4D967C60b9C320182BB94", "name": "pariatur sint elit labore nostrud" } ] }, "edit": null, "success": true }, { "message": "in sit ex ipsum", "original": { "_id": "c8a92575f15cffcc13da6b5a", "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": "2b0d9df7078c58894488add7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d1f87763fa7df93c333aa0c3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4a78d669cbf54e82421581ac", "name": "ex incididunt dolore" }, { "_id": "65dcf673c2cf952056a3d0b3", "name": "ea" }, { "_id": "25907d4bddec1fbb971d5e0d", "name": "aliquip ut anim" } ] }, "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": "d0Df6Ea5dB741E63a4329Ebf", "createdBy": "25A9D177F5a0423FA860Cb59", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "c9ac121a17F1aaDCcdfC16De", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "739a47f09Aeff19CdFACaC1E", "name": "qui proident sint elit aliquip" }, { "_id": "3F0dff54dabd8b979093Cc3A", "name": "eu Excepteur incididunt" }, { "_id": "4c0d73bbDa6b0bD9EbCac4eC", "name": "enim laborum consequat veniam aliquip" } ] }, "edit": "ea ex est sunt dolore", "success": false }, { "message": "Excepteur in tempor", "original": { "_id": "3b8d723e8f15af324202650a", "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": "cc7293dabea72291725e58e6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7a310aface707bf5128efb9e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a1b350af3359d54e948ddd72", "name": "anim aliquip" }, { "_id": "0c4b6bdee464010b7a6e5081", "name": "ullamco" }, { "_id": "4f03558654daa7991ce450cf", "name": "nostrud fugiat" } ] }, "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" ] } } } }