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": "cb9a7e2025bd5922f16efed0", "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", "projectId": "f8045Fa528a496F42b44dBa9", "createdBy": "8bd972796fbc7bad0a9aa5a1", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5a6c9bd28ff7ffb362e291e5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "df2651871e899eeb00a45bcb", "name": "sed exercitation dolore et dolor" }, { "_id": "8c2f12dcf3beda04d73ef9b1", "name": "in deserunt quis" } ] }, { "_id": "8b48271837d74ddd5dcd2384", "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", "projectId": null, "createdBy": "a8f6768672085848cf6d9afa", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d6988ab8e5fbe18f37a6a559", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "cbab9d5b86e95a1a77a73e5b", "name": "reprehenderit irure laborum" }, { "_id": "14e43ad982404eaab4172181", "name": "voluptate qui aute" }, { "_id": "0943b16256acbb2085ff4e08", "name": "veniam enim" }, { "_id": "b6399901c73f03a9de580b64", "name": "incididunt" }, { "_id": "94d26f0051e26c3ddbf1d94d", "name": "eu minim ipsum dolor irure" } ] }, { "_id": "0aa89c015b9d001fa98e30ed", "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", "projectId": "6e3a14bc20F2cF6c9644A1Ce", "createdBy": "0af60d99246b64990c04d6fb", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "94ea7d95709596de6403c00d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "438e06c4a3b4cd2deed15672", "name": "Duis" }, { "_id": "b7640a7922fa95d63a2c2c39", "name": "irure" }, { "_id": "07ad711f10da18dba3954978", "name": "minim exercitation cupidatat Excepteur" }, { "_id": "4c1240292312c7869f52e05c", "name": "consequat in sunt esse" } ] }, { "_id": "f6fd0687597e34e5553f397b", "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", "projectId": "3F7C4f3E049F0afB6e2f7d58", "createdBy": "7442dae2f4f0a38ad7b02150", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "abfc2c247f3c07e394e32512", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e120caf98d01fd24b48c7cd0", "name": "deserunt quis labore non pariatur" }, { "_id": "a816027745b95012593b345b", "name": "ullamco elit ut" }, { "_id": "2fa2c5fe44fb5dcf23dd9293", "name": "in est veniam sint" }, { "_id": "3a5576833777289aaa02b872", "name": "fugiat" }, { "_id": "99b9795ad1aa733c66145aa9", "name": "fugiat sit voluptate" } ] }, { "_id": "ad399ab8113e058dbf1ce279", "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", "projectId": "Dc00E22EF602AFBD1F0F798B", "createdBy": "87b4f8c30d4589d99bc61b74", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2aff26e63e1a50ed1e8685d9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ff8763a422c8ac893f5b3800", "name": "minim Excepteur" }, { "_id": "d413caabcd285ead60c0d4a8", "name": "ullamco nisi" }, { "_id": "23e80929c0f02be17b7fe5cb", "name": "cillum Ut qui aliqua" } ] } ] }
{ "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": "ut", "original": { "_id": "fd0013c9c4660799d31c46c7", "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", "projectId": "61c5798ACBA9CafBcDA2fa4B", "createdBy": "2972dda0d86ac4c5a163a3a4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "87a4be434498a899049fcbde", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4e9240c685b8f910abd70a8a", "name": "deserunt amet id" } ] }, "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": "fe4c3FEA36AEd5DbBCA89EBD", "namespace": { "type": "project", "name": "ipsum sed proident dolor", "accessControl": { "read": [ "eiusmod ad Lorem non nulla", "in ea", "in non laborum", "dolore qui do" ], "write": [ "consectetur non esse" ], "execute": [ "ullamco", "sit commodo" ], "manage": [ "anim id ullamco", "eu est commodo in", "in consectetur esse", "est" ] } }, "createdBy": "2b4CA7cB7eC76Bca97E0be17", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "1B7ACe4cC8a509dCC0046aca", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "931f9a6dd4c59f24e59aE8dd", "name": "sed magna exercitation" }, { "_id": "7aF27cCDbE885bD0EFd0d2fE", "name": "ut cillum" }, { "_id": "BcE7b50a97dfbeED0912396c", "name": "ut proident commodo amet reprehenderit" } ] }, "edit": "est magna veniam", "success": true }, { "message": "cupidatat commodo Ut nulla", "original": { "_id": "caffcd2b2a9d357c3fbb144c", "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", "projectId": "Dd8fF0df83d9d4EFAECE6b52", "createdBy": "ca970c0930126089c6967c2f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3b9a0ca80e8cd3492794a0d0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "07490e0fe960829fc80f61d5", "name": "aute" } ] }, "created": null, "edit": "Ut amet sit elit in", "success": true }, { "message": "ipsum", "original": { "_id": "c91f5ca16f03c26a123b70c1", "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", "projectId": "7e18AFF0dEcC57EEb230ACBD", "createdBy": "8db450c4df5bb63e365ad8a4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d4282eed4f97110753e8e234", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e70e4e1d843f2e060adfb204", "name": "in irure ut dolore nostrud" } ] }, "created": null, "edit": null, "success": true }, { "message": "proident ullamco Excepteur", "original": { "_id": "84dec4ddd4fe449891778ff3", "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", "projectId": null, "createdBy": "e94d2fd09575f3ef824d6429", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a7fecaaa27106a9fb78d3730", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "72bee45a3f3b0ccf8f55527b", "name": "aliquip proident irure sit exercitation" }, { "_id": "dca2bd3020581271591040d8", "name": "deserunt sit esse incididunt" }, { "_id": "517c5218fd4b76384f81455c", "name": "ipsum laboris consequat Duis velit" }, { "_id": "756605d58844425494e5ce06", "name": "magna fugiat" }, { "_id": "2f76c5dd709c62c04815114b", "name": "commodo laboris quis" } ] }, "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" ] } } } }