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": "fb256ff8d853704ede927db9", "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": "bfdddb16a61ebb0ec9e929fe", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "929d61d0db771970ea09e6d6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "699f47d706e1297c95cf67fc", "name": "aliqua" } ] }, { "_id": "b043edd179626bacc2c54922", "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": "8dba4aa96a13cd394fd44983", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "668938d411f6cc6ba0ff2172", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "427797b39a6f176366bb7dfa", "name": "quis anim proident" } ] }, { "_id": "26c0d7202b521c90fb6874c9", "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": "f95d779b74f7aecb6d2a8d65", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "aab4b37afbef8d49266e2780", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a3bb43cbf0735ba22aa5f40f", "name": "dolore do dolor consequat" }, { "_id": "4ad1e6a927c81f221270c7fe", "name": "aute nostrud in enim adipisicing" }, { "_id": "6131584eb965c3c011b19864", "name": "cupidatat" } ] } ] }
{ "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": "cillum Duis deserunt esse", "original": { "_id": "99ad4ce0bad0f182604e0a73", "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": "6419ff2d6a06c9354de27488", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "82194821f2c9e55bee786b2e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c574c5bfef6032c0589c60f8", "name": "aute ut in fugiat" } ] }, "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": "eFfC6aCeD970A242E58ba40A", "createdBy": "96DFe72d67DFC9c22E48cBf9", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "26D2aD8d7023CF93CdBafB2E", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "Eccbc9f3C6Da6E315722BcDf", "name": "id esse elit eiusmod", "description": "A user-defined object to help group documents." }, { "_id": "1CA12b93439d2c7FAA8bF3bD", "name": "Ut", "description": "A user-defined object to help group documents." }, { "_id": "cABe079AcE6D9a1DE68cBaa3", "name": "aliqua proident tempor dolor aute", "description": "A user-defined object to help group documents." }, { "_id": "Bf5Ad48C99F3C9d54cCd42d6", "name": "cillum commodo laboris", "description": "A user-defined object to help group documents." } ] }, "edit": "ad incididunt eiusmod do aliquip", "success": true }, { "message": "quis ea officia", "original": { "_id": "04a85f882331d67b637824d3", "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": "644f2b766b78648df8a70af6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c2e0132d2d8e538b72344cc1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2247c2ec9ccb37db82e1f0f6", "name": "veniam exercitation id irure magna" }, { "_id": "ea07b1972382a12ef493249b", "name": "Ut tempor sit" }, { "_id": "c9700ec9a47745d23067d8df", "name": "ut" } ] }, "created": null, "edit": null, "success": false }, { "message": "Lorem anim", "original": { "_id": "ddbc4ae1e9d9eef1633ba219", "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": "f321f6edd678c545375f6c51", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "47f4ce369e4abc7b1aee9f6e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8177edce1b5ceda8d481912b", "name": "officia non sint ullamco" }, { "_id": "3a94969c3f45479623350440", "name": "qui" }, { "_id": "569976c12588ef336fca9570", "name": "in sint minim esse dolor" }, { "_id": "d1154b5957efc7e8dfaa084d", "name": "exercitation aute consequat ad" } ] }, "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": "7Dadb0F2b842dAdFe6fBb26F", "createdBy": "A103d789fccFc2FE41a0DCD5", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "087b1b6D3d8b41dbef333b2d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3fEDeCAe2Ddd1fBe4cFff69F", "name": "in", "description": "A user-defined object to help group documents." }, { "_id": "f917711D30F095dca98F9f9c", "name": "est amet adipisicing nisi ex", "description": "A user-defined object to help group documents." }, { "_id": "B2Ba6B024BCC4D4aA0DdeaB2", "name": "ipsum", "description": "A user-defined object to help group documents." }, { "_id": "2Cc5f107f9eFeC1C6A5612bb", "name": "non labore voluptate in", "description": "A user-defined object to help group documents." } ] }, "edit": "Lorem", "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" ] } } } }