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": "50e9c1cbdb25ac9374715d4f", "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": "3c7f18b3e55d077ce2803fa6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f96cebff2308e2c710b7650d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "abf88fd30ef1ce1c8ad6d192", "name": "proident sit ipsum incididunt" }, { "_id": "e783de5b7c82192d3be183db", "name": "aliqua deserunt officia" }, { "_id": "ee5858f6c65714d34fb3d075", "name": "velit" }, { "_id": "2a0c64bbe561ee8443b2b2d9", "name": "mollit est sit voluptate ut" } ] } ] }
{ "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": "sunt Ut ut", "original": { "_id": "0b24c754e086a52288a8507c", "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": "dAcEcd24bEE5d36ACA0a16aE", "createdBy": "e4de8cf375ef4a5e38fea6d4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1fd84c3bbc22619d4a23af9b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f48f1fbbcae7aab26caeab67", "name": "est" }, { "_id": "8a69bec020d6f69a6746615f", "name": "et non" }, { "_id": "4e3425f637c93abcb035bf04", "name": "nisi quis Ut commodo ex" }, { "_id": "b994ed9084455c72efe715ca", "name": "cillum dolor culpa" }, { "_id": "496a343666c8d1cac5481bde", "name": "nostrud mollit culpa" } ] }, "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": "CCc96aE2bc3AEccbB1Ef94ab", "namespace": { "type": "project", "name": "elit Excepteur", "accessControl": { "read": [ "consectetur veniam id anim laboris", "in enim in proident veniam", "ex" ], "write": [ "commodo ea deserunt", "in sunt proident" ], "execute": [ "exercitation magna", "incididunt minim id ut magna", "in nostrud in labore laboris", "eu voluptate", "non occaecat officia" ], "manage": [ "qui deserunt", "cillum" ] } }, "createdBy": "B83d3Bc5c2E1b3A851709fCE", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "2c3CDfDcfa18Fde9Fc85A5bC", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d9B1fAFEFf88afb7a8b6da26", "name": "culpa magna" }, { "_id": "B8B24204FFEC08cE2DDb1dad", "name": "do" }, { "_id": "dBA4F8F2Db190C7b7df5da37", "name": "in commodo" } ] }, "edit": "fugiat Excepteur nisi ut", "success": false }, { "message": "anim et commodo", "original": { "_id": "3cfb2fe6f424c0528954c1ee", "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": "4a423c7FBDaF8A7Af8f2f5B9", "createdBy": "05041cdfdb2eb78859286264", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a146f992b4db6fa922cf0b40", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d9d2490c818dba0dd2bb77cd", "name": "elit nostrud sed anim non" }, { "_id": "f8cdc965576913dbb9af1d96", "name": "laborum fugiat" }, { "_id": "86e9a9c4a8275da3c68e582f", "name": "sint commodo velit aute" }, { "_id": "cbc3d8ef5159efe13c32fc2c", "name": "minim" } ] }, "created": null, "edit": "fugiat sit", "success": true }, { "message": "aliquip irure", "original": { "_id": "b15926dabd2b78cc7f523962", "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": "EE86D4fd7840B42eeCb66F9a", "createdBy": "8460b300b9500ead54083b58", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b6ba334743851e04d8e8c07f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0ad85098b6b0f6495715f823", "name": "et proident veniam" }, { "_id": "8ced9e30f7a85438780e2e5b", "name": "minim est" }, { "_id": "eab7f953155abd48ff24d341", "name": "ipsum" } ] }, "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": "24DA141b42c3C6daE1Eb28ae", "namespace": { "type": "project", "name": "officia", "accessControl": { "read": [ "pariatur irure aute proident" ], "write": [ "dolore" ], "execute": [ "elit proident", "in culpa elit cupidatat", "quis nisi eu", "occaecat", "consectetur aute sunt nulla dolore" ], "manage": [ "ad", "commodo" ] } }, "createdBy": "33FfBf2aE62aD75fEfc4Cad4", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "D1DA3bbcB9c198BF8cB28984", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "FBbFaBDfF65241f93F1e2Ff4", "name": "Lorem aliqua occaecat dolore" } ] }, "edit": null, "success": false }, { "message": "est minim non", "original": { "_id": "0b4af6abf88b794147b0209a", "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": "eF2E3BE81fda339Caa94ce01", "createdBy": "bdd87e3bce04760d664a0aaf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "696063ae78d3557512e28b8c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5e6d58fb3d02374d450d4085", "name": "exercitation nisi eu" }, { "_id": "bce35f564999e02832beb04c", "name": "esse ad" }, { "_id": "c444594890608d201f801bab", "name": "reprehenderit amet" }, { "_id": "cb9ee444f3675f28da57da5f", "name": "non veniam deserunt consectetur in" }, { "_id": "ec94addff67cde15309a7cbd", "name": "Excepteur in eiusmod sint" } ] }, "created": null, "edit": null, "success": false }, { "message": "non sunt", "original": { "_id": "91317ee90cfbec52394a5711", "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": "2E8ec0a4A80E5dCe8ecde09E", "createdBy": "2faaed143ef21b7d92e2f9c2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1405a9bcfdfe525b159785c5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f18f26c54a13fefe51868b30", "name": "anim elit pariatur officia sit" }, { "_id": "25c77b3e1b29c0d93de409bc", "name": "dolor mollit ullamco" }, { "_id": "83dc3c81fbf2a93993a45459", "name": "cillum in consequat dolore" }, { "_id": "5aad20967b02a6a98dd4c075", "name": "ex officia dolore occaecat enim" } ] }, "created": null, "edit": "dolor nulla dolore aute ullamco", "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" ] } } } }