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": "62c6a48c686e55354bf6e1d7", "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": "348258429d0af0f87f4d5adf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "267c9dd1da8e0cb73346047d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "459458955e7e9a1645005ae1", "name": "aliquip laborum" }, { "_id": "969a3973eaa6c192d2925c1d", "name": "dolore incididunt" }, { "_id": "e2003b66c61093beffa245d2", "name": "tempor aliquip proident aute" } ] }, { "_id": "048512731fbacd33d143e6d5", "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": "2c02f05095ec8c77d26fe632", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b01e008da50d082f2d8eda26", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6ade439db96b3f29adadbb0b", "name": "ut sint eiusmod do sed" } ] }, { "_id": "4489ea6061de304e257a546c", "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": "82fee0b224c01d8f02771ea0", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8631c8006abdbe1261c74a32", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "024a7f6cd4c013cdce2d55c4", "name": "dolor aute occaecat" } ] } ] }
{ "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": "Duis pariatur reprehenderit velit", "original": { "_id": "90aa9443afeab678cf680d2f", "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": "495897723019b53a65e30b29", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "609d29fd89611c7530b8f34a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1030c497a18d024016a3df91", "name": "quis in commodo nulla" }, { "_id": "8e477bd61b833a07cbe36ad6", "name": "Excepteur consequat reprehenderit" }, { "_id": "7e466744259170bd39e3929b", "name": "esse sint" }, { "_id": "743ee7c59f9caf8d62df1942", "name": "nulla" }, { "_id": "c1e27a8dea617db5a86d85dd", "name": "proident ut" } ] }, "created": null, "edit": null, "success": false }, { "message": "officia", "original": { "_id": "9073034ee351ce45b9958fc3", "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": "325a2d3e1762dd7018a5d49b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "362129170766d1b3b762675c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8cdf7ba3af8bdbcc8a830118", "name": "in" }, { "_id": "570a52551798e47c0c527028", "name": "est eu" }, { "_id": "accec7c6a4bb26f5b9edbb26", "name": "ex" }, { "_id": "c043d8e724e68de5fdeebc71", "name": "exercitation ad" } ] }, "created": null, "edit": null, "success": true }, { "message": "sit", "original": { "_id": "a18420e3ee5450fbcc8b3bf3", "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": "9d3ff823330ab5651739c19e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c9c50b3aacdfeeb6efc6b02b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b602ea7ffdf7ab20244a430c", "name": "non reprehenderit irure ut exercitation" }, { "_id": "796ab01f29d4283111262748", "name": "consequat elit Lorem nostrud exercitation" }, { "_id": "2e5a9b94d7c0a1e33c70cd73", "name": "pariatur dolor" }, { "_id": "a833f66640f4a058a34622d2", "name": "incididunt ex non fugiat" }, { "_id": "26b33c3755f021f5b1d3d2ed", "name": "eu" } ] }, "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }