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": "6da8cad0a9a1dddc1dda77a8", "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": "9b88168c9d912f2ed4eeb2f6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "aa8bd19a7bddad2e3e48d945", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d1fb2f2375944addbdb0cfb8", "name": "Duis" } ] }, { "_id": "b27f3a0c6e6301e5a12601b4", "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": "a9a90ec6e5e2490753af6427", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d3afd8cfec3b4cc07523881d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6e972091fe1ab567435939ca", "name": "laborum" } ] }, { "_id": "9a29d9b9b885fd97251d2316", "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": "f95d36495109f2a3e0a2cd17", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "417fc0a851a9f9159284278c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3f63cb7ebbd95eb591255810", "name": "eu quis culpa dolor" } ] }, { "_id": "49a6a83978a252114f4c7fc7", "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": "1e81e977ea80d888b3331e31", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d43531f0b7c919d4dad715bf", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f4325563ad77fb3efb887446", "name": "ex reprehenderit ut" }, { "_id": "1c48a61806169dec39aa551f", "name": "minim" }, { "_id": "9dddf56d28f40bf560e18d4a", "name": "aute" } ] } ] }
{ "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": "reprehenderit", "original": { "_id": "523371ffea133f2ad14677e9", "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": "f7e91cb0cf4b9c29dbb68ac2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3e3beae0c9885190b14fb47f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d9be94471d20deb84d0de2fc", "name": "in ut ex" }, { "_id": "e59bf70186c071cb9ab7137d", "name": "anim eiusmod tempor" }, { "_id": "4e2ffc6016d8c8dd23f4eb1b", "name": "Duis sunt dolore" }, { "_id": "025bfa6e90c82ce8fa42de70", "name": "cillum mollit in sunt ut" }, { "_id": "5071626ea14b64306ac036a6", "name": "nisi exercitation commodo esse nostrud" } ] }, "created": null, "edit": null, "success": true }, { "message": "culpa sunt sed Lorem", "original": { "_id": "c9d8e92c651d30e508ea4c85", "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": "8b9cdb7d73b1695b79b1c30b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "eace946af600a0505d517f35", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5eb6345dd8cf1103a12bce6f", "name": "amet nulla velit" }, { "_id": "9597190945c599293f028e84", "name": "Lorem ut" }, { "_id": "54acfbd7f99bea65d9174c54", "name": "dolore in id esse" }, { "_id": "0368a1b1bd8f01043748def4", "name": "Lorem elit pariatur commodo incididunt" }, { "_id": "c4034e7c270b620a159bb712", "name": "amet laboris nostrud laborum" } ] }, "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": "3c92BE3e55545aA529Dfc9bd", "createdBy": "eDBF6558c23BC6e3bEA6e576", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "a8FB0b14B8e343cEEc1CF014", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "335Dc96e93F2c63afB6D6378", "name": "Excepteur aliquip in laborum" }, { "_id": "D3eaF331CFfB26f0dE3c9Fd8", "name": "eiusmod velit" }, { "_id": "fAd9e9c0A0acA6eFa754787E", "name": "aliqua est" } ] }, "edit": "Excepteur in", "success": true }, { "message": "Duis eiusmod", "original": { "_id": "c43ef2ac9bf0f69fe26a7cfa", "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": "dc484c58ae9d914db1548527", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ffbe68351ca1e47fc54817ce", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f32d5135ce9c2562d61cf261", "name": "mollit sunt et magna" }, { "_id": "72c279f224df77019fa36c42", "name": "dolor" }, { "_id": "d24c9c8c909e16e1128ce931", "name": "qui Excepteur" } ] }, "created": null, "edit": "anim pariatur incididunt eu commodo", "success": false }, { "message": "in occaecat eu anim consequat", "original": { "_id": "6c9e535472e927a5aef34699", "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": "2035bd15ec7315b93875576a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "109487ef8613041f9a328ea7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b03fb6d16c601b84446e0464", "name": "non amet" } ] }, "created": null, "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.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }