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": "03cd2be5ad2708af06a4435c", "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": "28cb1bbdae57b1847f7a7866", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a75728b3be5f175aef90aad7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9782bc3df6e01dfeab6cafcb", "name": "sunt eu" } ] }, { "_id": "4cedbbe84a9c3b021c3cfedf", "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": "414ed230060110c28f923538", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f0eb78ee8ac40e7dadb367e7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f102a73ac4e6ad4f88389e74", "name": "aliquip laboris" }, { "_id": "1822d81889b8daa93b651697", "name": "enim do magna ad" }, { "_id": "450c0265ec6848ba57b030d1", "name": "do Ut" }, { "_id": "4f3ce9d724a3390031060067", "name": "esse" } ] }, { "_id": "8c21137982d724558678e00e", "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": "3c3370a2e9989b91093ae865", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "040a90c3fad456695c4d53c6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8017e315bfe23ac3920025f8", "name": "dolor" } ] }, { "_id": "0c6248e6a86907ffbb8748d3", "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": "296dfa1fcfe0e6265f0b11a2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "df37a30ab9995f1c7b184710", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1b3a34404babfa07dd79ab34", "name": "esse ea" }, { "_id": "85a09369674482919b72a32a", "name": "laborum mollit ex irure" }, { "_id": "fbea7b0eaf7c257a9f2c7dd3", "name": "aute" }, { "_id": "9315255fad0da57dbc89c25c", "name": "non" } ] } ] }
{ "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": "amet consequat cillum", "original": { "_id": "129e3c6d5d2b6cf29ef1fda1", "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": "9950f9d21782b0c6ff2e689f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4f3429223f547a4220cc8d0b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b6ddb3b1253bfe9447a8dd8f", "name": "sunt ea" } ] }, "created": null, "edit": "reprehenderit", "success": true }, { "message": "id ullamco proident commodo do", "original": { "_id": "1a17c11c3eae0767f7484f7a", "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": "e307e14f4b8d017291f2d379", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "51089e7fc0f8e0e4d24cf657", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f4864ec7799584184f338af5", "name": "adipisicing et" }, { "_id": "e4bb1088cf4e01e8f38bd243", "name": "Excepteur do aliquip" }, { "_id": "42ab062db8c5865768e9ebf3", "name": "cupidatat aute" }, { "_id": "a05aac734d763c3a454227c1", "name": "cillum" } ] }, "created": null, "edit": null, "success": true }, { "message": "esse non in occaecat", "original": { "_id": "f1ac7f12cf71a3fd40c0708f", "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": "73a783c1107041b8084fcbb3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b439f192cec2bc6e09033619", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0b8a013c3ebafb9417d8a419", "name": "adipisicing" }, { "_id": "a86a5710f4b77d3990577a3f", "name": "nisi dolore laborum sint" } ] }, "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": "8f5D7daAe99bFfe703CcfbD7", "createdBy": "3eBb0DFC0f2EA2d3CA87b74a", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "E0AC0d4F8fb6F54fAB595f9e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "32EA97b6deCF81BbFAdBF12f", "name": "quis voluptate in Excepteur eu", "description": "A user-defined object to help group documents." }, { "_id": "c0fCC7075E71e5dB86796cDC", "name": "sunt elit sed eu", "description": "A user-defined object to help group documents." }, { "_id": "03adeeFDD7d0d2e971Ab19Cf", "name": "culpa in nostrud sit", "description": "A user-defined object to help group documents." }, { "_id": "05e5b18CdB3AE477bEaBf34E", "name": "aliqua amet nostrud", "description": "A user-defined object to help group documents." } ] }, "edit": "laborum", "success": false }, { "message": "nostrud velit sed sint cillum", "original": { "_id": "c7f79ff14398699f6819f01c", "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": "87cab125e33d4d379b790f26", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9d905c7f8cc25d22501d52cd", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "fed87033f7344b91c5c23ff8", "name": "eiusmod ullamco" } ] }, "created": null, "edit": "tempor ea ipsum sint", "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" ] } } } }