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": "7fbce5628613b0a8a3a5c2a1", "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": "e4cEcA29f14e2cFF2afceEC8", "createdBy": "8a4cb2ea751f5c54ce4595c5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "20d2fa7700ad14347a53b1be", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0ce8960df9ddc28c24ada3f6", "name": "anim laborum Excepteur incididunt labore" }, { "_id": "761a0ebfcbfda04fca12c126", "name": "ut tempor laboris minim ea" } ] }, { "_id": "51b7155efbfa6ca28523a5a1", "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": "546BfeA83eEf1bfEa3173D3D", "createdBy": "5117c9ee27a7544abf20495a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b212c8f5082fbe57fa07862d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "79890b88a59f2fd7d4943f6c", "name": "occaecat sit dolor fugiat" }, { "_id": "dfefdb996d90cf0b46374310", "name": "dolor" }, { "_id": "8873c571d55b498227be429d", "name": "voluptate consequat in occaecat est" } ] }, { "_id": "bb1dfc7fdea97d4bec2d7876", "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": "2534ee0e057cb8d5fec8a74a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "eb390fdd93908aee7545bdf9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4765d4877847e5306921a209", "name": "do ullamco officia dolore" }, { "_id": "9d5e1d60745814c640702232", "name": "dolore commodo officia" }, { "_id": "4fcc677b1ddf396ec158591d", "name": "mollit eiusmod" } ] } ] }
{ "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": "minim deserunt", "original": { "_id": "5765c74aadccdf8508ee097b", "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": "C2AE7159CCCAA40dC5D57B8c", "createdBy": "59ec6ddc2a1b68ba7abbaef5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5496e2e32d4d20ed96546603", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c942009532719a46658c96ad", "name": "cillum laborum do" }, { "_id": "0d96db6f0b696912ff84b509", "name": "reprehenderit dolor aliqua velit" }, { "_id": "8d2a870d5f9dd8f30d006260", "name": "ipsum aute in pariatur occaecat" }, { "_id": "31f768e100ec39f35cfbc4e0", "name": "ullamco" } ] }, "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": "2ADB5f9Ee5EB88cdb54cfBBc", "namespace": { "type": "project", "name": "nisi adipisicing ipsum ut", "accessControl": { "read": [ "cupidatat ut non", "laborum eu incididunt", "ipsum dolor do", "eiusmod fugiat", "ex laborum" ], "write": [ "est ea", "commodo ipsum", "voluptate eu" ], "execute": [ "quis cupidatat officia fugiat velit", "nulla laboris esse dolor amet", "reprehenderit quis culpa do" ], "manage": [ "laborum magna elit", "aliquip consequat", "sed anim", "pariatur" ] } }, "createdBy": "0Ef860acFB2411DF39F12c7f", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "91F2941B4c7aA5E2E80Ae284", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b7d896D0bBEd4bB87AA6EA45", "name": "laborum sit voluptate eu dolor" }, { "_id": "A9B2FFDc31Da1b5f8eDdbdAD", "name": "deserunt id cillum esse" }, { "_id": "BDEC5F39bFFB3F4D1c402D7f", "name": "deserunt velit consectetur" }, { "_id": "f867BeFf80c2E3cacece0CAB", "name": "fugiat ut" }, { "_id": "ccC1319C71E1D8dF4AccD3ab", "name": "dolore dolor do dolor" } ] }, "edit": "Excepteur voluptate", "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" ] } } } }