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": "447d2a5e4c46006445b7cbae", "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": "0df37681afac2b969dcba5b5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f7950c291734291d6b6aba03", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "4629cbd02dfcff98f20691a8", "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": "95e01adc9a8e59c70927fcf1", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "de07b561f609835901543cbd", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "05db590551af71c85f9d2305", "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": "a35734660fe4be30c35e3ed2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "905d877b47871a6934462e3d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "fa92caf806ecd67a76ff6e1b", "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": "87ed47ff9b68552b11e9f8f9", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3434f6a44beb01e1d57c3670", "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": "ipsum aliqua mollit proident", "original": { "_id": "f27579ac58674dc0212dc294", "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": "da769b07742dc2581cce0635", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "27aaac62100e40320b12d3ad", "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": "000ADB1cef85CeeaEAaE5e83", "createdBy": "80BFFA019129e4e08BCc8Db8", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "1B8b36f287433EC91c61d02E", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": true }, { "message": "voluptate aliquip Duis", "original": { "_id": "b6f1ee451b190f90786c5216", "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": "7695682f6647259738b698fb", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a9ea899632f750b342859365", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "commodo non anim elit Ut", "original": { "_id": "18e020d4b20d1c89094709d5", "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": "1643633388abcd8d2efc5c65", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4af4e175021ca33caf992557", "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": "FaDd0F5abb1a58C3a5f4b8Da", "createdBy": "4fF001FE664eCE3Df9f3B1B9", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "d81EcbcA037DE1e89Cab3107", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": true }, { "message": "ut Duis elit", "original": { "_id": "b71175c753e46402b1f80a8e", "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": "815c39e9c5fa52e9f95613cd", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1aeab220e99525e7363d7ba2", "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": "4eAfE5CcE38D99aab9CD5bF3", "createdBy": "e58d3C7CcfAc062d038f7F76", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "D8fd5cB08BD742738FD0cE1F", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": "Excepteur cupidatat tempor consectetur", "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" ] } } } }