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": "6a6f997cb70cea27140a8f11", "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": "924b6b6c04b464207b4d645a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b1437319c3f417df1acf1f5f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "384526b0f8818ddb9ac9ffa5", "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": "a71710813c7028ebc05443a6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e4afc195fb414668a52dca67", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "30f220a0d82c82bdec0cecae", "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": "dd17a46be58cf53a604abb49", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "858ac6b132cc1fd1808d2e29", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "1652397986d3e635a5ec2ed9", "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": "055562daaf96823e3d01ee60", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c1ac2a3bb2b636ad0bd84bf3", "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": "commodo", "original": { "_id": "2fd0096f1de5b674f51a8046", "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": "e146baea205ec38d6a0275ad", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "97976470a2b2d5346b9936e9", "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": "B9aCCEae74475c4982bd1Fbd", "createdBy": "eB5e3CB9e371dF544CBe57BB", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "1f9A3F13FEcfbEfda8bbb0eE", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": false }, { "message": "enim amet nostrud laborum", "original": { "_id": "9a43bf0222870093c1af66f0", "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": "6dd0099044d60623b7d18b6c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5f0f375e8109364cf8fc74c6", "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": "C1935564bD2f8EB2d34ebefC", "createdBy": "0179afd1a042634b70eAa8E5", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "07Ee9AC5C2caA4Ba5C7FB29e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": false }, { "message": "dolor", "original": { "_id": "7f4dd8bfce8011e64250e7b7", "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": "d1af131ddb209323fe6e5240", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9828178856a25b7f7bac5b49", "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": "9C242d62694Dd6CbBc7a63cb", "createdBy": "DbA45F3536eefBB733fE4e33", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "96cb8EE512cA474ed6d9AF5a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": true }, { "message": "minim ea cillum ex", "original": { "_id": "54c33b6db60afdb2e0df9d56", "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": "6f2d2c2ff4a4be8cf503f7cc", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a7015fe279fccfc1e2e40bfe", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "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" ] } } } }