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": "b1968b381c6d18419eef9902", "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": "d3b78365687943ee5e19669d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "fe78f67cf3d84d4f406414d9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a0bc984da7574a41e4474f98", "name": "sint eiusmod" }, { "_id": "d3d3d43816121a17d5a9df53", "name": "qui dolore" } ] } ] }
{ "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": "aute esse minim", "original": { "_id": "699516af46cc761520187333", "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": "51c0c9b78fc3008547412894", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b9bf46b9c2b299f39730e43a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "742969fa42ccf385bf71d65f", "name": "voluptate commodo enim" }, { "_id": "4842341bdef009741fa428ae", "name": "cillum officia dolor eu sint" }, { "_id": "68a38e75a1ad6f5ce7c8cf47", "name": "occaecat aute sed laborum" }, { "_id": "f3806ae695eeaf8bb0290ba3", "name": "elit minim quis qui anim" }, { "_id": "340ec3b64c912866e124c06a", "name": "in proident eiusmod culpa id" } ] }, "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": "9C8EdCc332DeC314893e0Dff", "createdBy": "3EdaAedce4cFa5901aFBD3ba", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "35e0E55dac06E8B5bA8eFD90", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3e49e59248848898f9EcF1E9", "name": "amet", "description": "A user-defined object to help group documents." }, { "_id": "8503Deaa3B7A21ABDBeA8c00", "name": "officia", "description": "A user-defined object to help group documents." }, { "_id": "abeb6c7bE428Ac2e05a410aE", "name": "dolor consectetur reprehenderit", "description": "A user-defined object to help group documents." }, { "_id": "95C3BD9CC5F5AAA5Ef8a0Dde", "name": "ipsum aute consectetur cillum", "description": "A user-defined object to help group documents." } ] }, "edit": null, "success": true }, { "message": "amet labore ut", "original": { "_id": "c32779253807274c12e642aa", "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": "f3783d136780a1327aef4826", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f469a87ed9d55bf8e4b40dca", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1dfce505b640409816632e8a", "name": "dolor incididunt" } ] }, "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": "3bA954c52FDe8fad25b5ea2d", "createdBy": "607cad9A5BbbdeBE37D1a9D0", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "A94ccFB9d3EE18564D1e380b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "78ebda5DeD2FB5aeAdDbd26a", "name": "magna Duis quis aute", "description": "A user-defined object to help group documents." } ] }, "edit": null, "success": false }, { "message": "qui fugiat aliqua ipsum", "original": { "_id": "5f2c8d4c485f62f81609fd27", "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": "bec7ffaca7ea506c22e084ec", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "662152f020da29b6809fda7b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ea0220df9510d4c6ef9bd9e2", "name": "Ut velit aute" }, { "_id": "2fc414c7d2c1d637714bf63b", "name": "Lorem ullamco commodo incididunt" }, { "_id": "0d03aeee38334889733fc33d", "name": "sed nisi mollit" } ] }, "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": "e1CE230c5e0E9EB4f9FBDAff", "createdBy": "b1C3A8B30e181aa799271E7B", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "eC8Ded1fe7ed9A000cDD42E6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "fFbfF0ae54ae9E9bAfBa5b4F", "name": "mollit laborum", "description": "A user-defined object to help group documents." }, { "_id": "eFB0ADeeCA16FdE80ff2D4cd", "name": "nostrud enim exercitation tempor", "description": "A user-defined object to help group documents." }, { "_id": "eDfDc5DcC7D26a35c1EaeCbb", "name": "sunt non Lorem esse", "description": "A user-defined object to help group documents." }, { "_id": "Ca8E251d6cE8a5eC08c8142D", "name": "fugiat", "description": "A user-defined object to help group documents." }, { "_id": "0fADfbA8Abc97881DDe7abdC", "name": "eiusmod", "description": "A user-defined object to help group documents." } ] }, "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" ] } } } }