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": "efb32a9e0b4c02353a41fa6e", "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": "d6664afed1ad5f7cb05f3b19", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "952fc26d3a93320280d9ff21", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 } ] }
{ "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": "voluptate", "original": { "_id": "c4eb7f8a52e68ea0d7cc07af", "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": "43faab630b83d99f145e8f62", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0479f0e154f0ed38ee248c06", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "tempor", "success": false }, { "message": "aliquip", "original": { "_id": "5f0cc922061ac8497ca3f602", "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": "45588494f27aa3451f16c7f5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ac2916583097eaff5ea44b36", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "laborum culpa deserunt", "original": { "_id": "ec2346870d4ef61ae71980de", "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": "3cecf413793012c955adadbe", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1721bb8455a72fa00fca3f6b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "eiusmod", "original": { "_id": "7dadecdf3fb369255486a6d8", "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": "8ec34f3f38aa52d5b5b04e3b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1edd84955848e465ef0353c8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "velit id in", "original": { "_id": "edebb7648dbb2210ec746901", "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": "91d6e431b0b35a02e38612dd", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1e3b1084feb064bdb2b0a3c8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "edDA1Ea86E764B6Bf9258122", "createdBy": "1C4DaF4B8642c2CbA0C1450e", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "2Cc54DFafb09BB2fdFcbaB3D", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2072267a04D4ccD28ADB04eC", "name": "sint veniam", "description": "A user-defined object to help group documents." }, { "_id": "CDfFcFaFa4Ce376388F7Fd5E", "name": "laboris non in ex nulla", "description": "A user-defined object to help group documents." }, { "_id": "F4053b0ACEA99aDee90D9Fb2", "name": "elit", "description": "A user-defined object to help group documents." } ] }, "edit": "cupidatat sed cillum", "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" ] } } } }