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": "6ac247893f17072d87953e9f", "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": "b9e28e66661817e05eecbd46", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4682161d81786be5a821693a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "aba835ca91c84814b5fdb499", "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": "193bf448c075362188108055", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "55814583344839df5bcad411", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "b458cbfe2f83a3d517a501af", "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": "3ddc1da72c78345eb24ea4cc", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "717ccafdb98ed1e3d1d11606", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "902ffc54a29f3b200a3622ec", "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": "a345cbab15d09380eb33ff49", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "650ce3373db5355e35e1ae93", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "8e5edad2947fe428cb9d49e4", "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": "8106301875790ca0fbfffc63", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8179aa56efe703b9e6157b43", "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": "in", "original": { "_id": "bbf732eec647d16a9e079dbc", "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": "bcfe01a7a75a4d1310257cc7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8d838b00f4cd4768790f1a29", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "exercitation mollit sed", "success": false }, { "message": "dolore ad sit dolor", "original": { "_id": "c0fc868f1b7a7e176c492716", "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": "d9fad89a390be1471523ec87", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3e7f5a7f1bc0e3657974cbff", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "aliquip proident in sed", "original": { "_id": "caa5c82740752f04fa5b1ad1", "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": "f649f1fce1028b092aa0e03f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f55fb4f05f2f690aa7a066c0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "ullamco ut eiusmod cillum sed", "success": false }, { "message": "veniam officia", "original": { "_id": "66d268bf74dceb0ee9cf2ed5", "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": "07548b58a84700d8bea6bd8e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b3642d26609328b107a88991", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": false }, { "message": "Duis mollit minim ex", "original": { "_id": "037b35fa4cd34abc90cf3547", "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": "af2e8af7c33c7db0d9b5dafd", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b17b4d9e781313674a45b714", "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": "4CE7AF40587ED8D4aBBF92A2", "createdBy": "FD42178dD4DC0e47fafecf56", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "CEeE7D97ea3626aBCcfa4FCe", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "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" ] } } } }