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": "a23d55e58a66238a6411d676", "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": "a9b12b60b0924637b2d7d8db", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "db84dc9e24abafd1372a2e4d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "db0576600c38f1717c9b294b", "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": "4eb9d097ab978d3dfa48dc70", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "46b9bcaf58b2e2c8d9a62d2d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "c3f2bccc9016f5465b47c107", "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": "0c2ce7d2882501b22028d180", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1bd66893f398859c32d4cb46", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "432f485e6bbcb18257112ff3", "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": "96707fb1df8e721546d1ee60", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2bc32d6b147c003ceb381ef3", "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": "do sint", "original": { "_id": "484bb97f8bed938e745f6b40", "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": "7202bbe343bfe03b9298832b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "aef009b983bb74d144f7352c", "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": "Ceeb7d4a68C6c6e101eDcE1B", "createdBy": "9fb3eEcAe6de8A7e78A1DCEE", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "edb9c7ACD885c0b9AAc7C1bE", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": "commodo", "success": true }, { "message": "ut pariatur adipisicing", "original": { "_id": "3cc8ece71f174a0b2ac4fe47", "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": "61d71e1a70b8af9a50c4954c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0f4a158171beba00c42d6604", "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": "3b52ca3d2a92870eCCfed9fe", "createdBy": "EFaF51896Bcb4aFce826bA63", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "eEc0CACC15BbFFf70eB28916", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": true }, { "message": "id enim", "original": { "_id": "495f7584294a37abee604869", "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": "d23fd5ec284e28b776f3e48a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "72818e3ba8b1a2784188af47", "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": "3d7d29aB57f8d0eCBfdb2ABF", "createdBy": "CE6a54CF38FEeCe7D7bA9ADa", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "d96C2E9fbE7bBfFac9DF29a9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": "velit cillum", "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" ] } } } }