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": "d5b11229f5aab884b504bdf8", "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": "317dd6ad828c105d2acd4dae", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c2a3404cb80d3dbcb2d9b729", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "4d86e99175bf0cc5e50be2f1", "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": "906a4a2244fd49afd20de594", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "04b2182b9cba28f8b136348d", "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": "officia eiusmod deserunt", "original": { "_id": "2ea8dec4b00764c9dadd21d9", "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": "f9f1d4fefeb5f9534b399568", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2ba35703f9ea47667b9683a2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "elit", "original": { "_id": "b8f7952b14cd064e3c69e1c3", "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": "6bd73f40466e3027b5ed140a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1f1893a7609b267f58923b9b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "cillum enim cupidatat esse", "success": true }, { "message": "eu nostrud ea", "original": { "_id": "b3b45d1155fcbfed0936248c", "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": "9aaf7ee17b04336ce27df140", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c820b54e5c1b2c2706ab0dc5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "id quis velit nostrud qui", "success": false }, { "message": "dolore adipisicing est laborum sed", "original": { "_id": "e8a4ba422ebe58aedb4a64da", "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": "9fde27de14519431c596865e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "83b38abfa4a6ea9d0f0a95c9", "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": "D4Ebcea883fD631E11Aa3D6F", "createdBy": "1a2EBFAE4CE60AB19cB7aB5A", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "5303b3BE0e5eaD0c09d82c75", "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" ] } } } }