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": "97ba28131406bb8a4ed073f6", "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": "e9ce4a95f4e710861597e68d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f88dd7e5d80b4bf0464ec0c8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "bd9433c482b70f9146e1701c", "name": "amet" } ] }, { "_id": "a743c1e82af49705a0de5aef", "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": "8fb70f3fc99c5becb324818c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a0308434dc422a0bf1fb315b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "985b9720a31b3e878cc6070d", "name": "fugiat nisi eiusmod" }, { "_id": "830adf9cccb05cabf62e2cf3", "name": "adipisicing anim laborum in" }, { "_id": "f395bdad1c719bce04451737", "name": "ea consectetur sunt amet laborum" }, { "_id": "d869cc951cc5a8fbec1d5333", "name": "irure incididunt aute" }, { "_id": "df853353fca61ba9c69e3a95", "name": "ipsum" } ] } ] }
{ "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": "consequat", "original": { "_id": "8e9a2db8927c17701898232a", "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": "a97f6f3c86c9652d435faeaa", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4fc449649fdcf7f760184c75", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "67b5e5f09c317550c4d2e6e4", "name": "proident commodo ullamco Ut" }, { "_id": "6419549f9534a1241432a3f8", "name": "ad nulla" }, { "_id": "c401d8c9f5fef7230816e007", "name": "in laborum dolor reprehenderit dolore" }, { "_id": "042808ba15ce84a54b6ce3bd", "name": "officia nisi" }, { "_id": "54d0fb2c2978d8b593de622b", "name": "ea elit" } ] }, "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": "1E6ecf9caBcb1cCEddd9Eafa", "createdBy": "72566dBB51E2aF2fc96A09b1", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "3652b81ace81FCed73050ace", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "faf7aC82DF7a17a7cC1b02E7", "name": "qui ad sint" } ] }, "edit": "proident", "success": false }, { "message": "veniam", "original": { "_id": "598dd06a1c977c83c9e4c1c1", "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": "62a6d0082edd6a00c7609581", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8f25c96ecd8f34f36738cef1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d21a90836c1a8758c0f5ac7c", "name": "occaecat" }, { "_id": "d013cfa79afddac43701e9b1", "name": "quis enim" }, { "_id": "9059ec36abb1e50a5db46b49", "name": "consectetur" } ] }, "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": "7BD4b9dd5093EE2Ece43eFFb", "createdBy": "E31D0F1BBBf5dDCa5B3F12Bc", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "C70494798aE2A3aFBEEBe0B7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "E6F629D28dBDFBAe536e128C", "name": "dolor Duis aute" }, { "_id": "2fBff714F87F8DEFb6C2E319", "name": "elit ut" }, { "_id": "FCD9Ed71A8D87c536Eb6dDfC", "name": "labore sunt" }, { "_id": "75deebA521DCd4C7C7FeFE9D", "name": "Duis cillum ex pariatur proident" } ] }, "edit": "Excepteur", "success": false }, { "message": "aliquip ad cupidatat enim Lorem", "original": { "_id": "3d8846bd56135f2eeb7ef8ee", "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": "e2cec9697d663338f543728b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cc3236b39fdc2778e26e1db0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a78de9fc3342ae4587ffc742", "name": "laborum sed nostrud Excepteur" }, { "_id": "1621c791bc767ba23618c0e2", "name": "qui culpa" }, { "_id": "68aecf521cb67b917efc6237", "name": "id cupidatat" }, { "_id": "ceab4800938c65036206eae1", "name": "pariatur aliquip et enim" } ] }, "created": null, "edit": null, "success": false }, { "message": "culpa dolor", "original": { "_id": "a28d380f71fe05b07abda098", "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": "f969f0ff912c36653d18c9fe", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1cbe78c2aa7f614ebdd882a4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a442e55f26383c6acddddac8", "name": "esse culpa occaecat" } ] }, "created": null, "edit": "qui dolore fugiat", "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" ] } } } }