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": "2f895f0e1bacc19d59b873e4", "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": "c38b85dffe802c5f2ea9c4c0", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5734ba033a5cc95fc212674d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7595eec0522491843160689f", "name": "dolore dolor reprehenderit cillum nisi" }, { "_id": "9cd4b2855e09cf2c87d87ba5", "name": "sunt officia ut ad labore" }, { "_id": "959572470c43292e6404ecb1", "name": "ut laboris" } ] }, { "_id": "a7da308cd54ad3af8d027ce8", "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": "42cf30979a335ea0fa5aa921", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c8cd57714aa9851a970e63fb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a004a4453158ccbdce3f2d9b", "name": "pariatur velit est aute anim" }, { "_id": "f44c4ddb2633b68f46aae063", "name": "nulla aliqua Excepteur" } ] }, { "_id": "d8cd77d65ff35bf0efe65400", "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": "561956855dfd09aa4f1e985d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b1210e32daf7259d0d95fd01", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3e27ac7c2f9c5ae7df04047f", "name": "in dolore" }, { "_id": "266351aca63846ae52503992", "name": "culpa eu aliquip dolore" } ] }, { "_id": "460b1157c6c52a9006415afe", "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": "9c58440728724aa22c9104d7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8f5459fcb97541086e1e3b34", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8550d3f1cb3dbad0deb0b63a", "name": "consequat" }, { "_id": "0d7b766763b6a131f6db82e9", "name": "est ad nostrud deserunt et" }, { "_id": "80b0fb65f33849f32c2edd19", "name": "anim ad" }, { "_id": "36a16d2f100603f39e3b372d", "name": "officia nulla" }, { "_id": "762718525fe8f1ed85470b02", "name": "aliqua sint" } ] }, { "_id": "5a0b380f66bcfbf2228bd911", "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": "f89249adf486db80da3989ba", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d1b6370eec2cf39564df9233", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "442a38f22cf9a4e47cb4527a", "name": "amet nulla cupidatat sint" }, { "_id": "be713c99d4d642811314c7dd", "name": "ipsum" }, { "_id": "50e9bf4c2a7350ce157d8ec9", "name": "do occaecat" }, { "_id": "e47e77604f36062b477bec1d", "name": "occaecat do incididunt nulla" } ] } ] }
{ "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": "fugiat dolore in ut voluptate", "original": { "_id": "f612c8d1ded6bfa6cfb6e007", "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": "e14e35db93a204a8288652c7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "14a5be47f436eabeccfe92a2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e096d1f1310a0eddf89db35f", "name": "voluptate" }, { "_id": "380c174ee7b94c6964ff5108", "name": "aliquip occaecat" }, { "_id": "e3e3bdd646dc4bd36e59b5d9", "name": "sint sit ullamco" }, { "_id": "f9649e61a236a6fcbd0c0490", "name": "non veniam" }, { "_id": "b7bccf0f01be5289a6db8eef", "name": "officia Duis nisi" } ] }, "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.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }