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": "5ead852e5a50aaf6a198eefe", "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": "Aa6dD2bea2E21eAb0F271Ad4", "createdBy": "cd2f0c8502a060003852d5a7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "03f06d0828b7caa8478b6452", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "722dbca314008dd0e864e2c8", "name": "laborum reprehenderit cupidatat" }, { "_id": "8987e408dde85bf0e8bfb804", "name": "elit cillum sit nulla voluptate" } ] } ] }
{ "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": "fugiat ut in", "original": { "_id": "b1369b96381d354c01c7b28c", "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": "62a851affca818d2570a8689", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "726cf08efa37430981f44328", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9e10dc34cecae3a8f3d868d1", "name": "ut enim" }, { "_id": "fdc09980b5cf9a32319d0633", "name": "qui ullamco non in" }, { "_id": "eeb92ef2b780c361d7013771", "name": "do" }, { "_id": "8c2bc11f9d245ba511848639", "name": "magna dolore" }, { "_id": "f1e54f376ab8ff7a14e0f90a", "name": "mollit" } ] }, "created": null, "edit": null, "success": false }, { "message": "occaecat in veniam Excepteur", "original": { "_id": "4f3df74d5eecca6492042264", "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": "e95f9ad2e1cd12c8aed26927", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9d8582a162c18c99bbe2178a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "516a6ceb18ccaa3f63d5bf5e", "name": "aliqua" }, { "_id": "5a751c71936c856c89a876ea", "name": "consequat do" }, { "_id": "f2e8321cdf760d33b0569891", "name": "eu" }, { "_id": "acf67f748cbd6f35c3cb3333", "name": "ea ex" }, { "_id": "b5252c8cb5b11f6477070d8e", "name": "anim Ut occaecat 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": "AAE217f73ab29E856876c178", "namespace": { "type": "project", "name": "ex et", "accessControl": { "read": [ "ullamco dolor sint proident", "dolore ea commodo" ], "write": [ "exercitation" ], "execute": [ "ad dolor veniam eu", "eiusmod", "laboris et", "minim cillum anim" ], "manage": [ "ipsum tempor sed consectetur", "in nulla esse ut id", "cillum dolore proident cupidatat", "qui exercitation consectetur et cillum", "id" ] } }, "createdBy": "cA232740e0360e57ACd0B742", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "b508b35CCC2Fa6aed60B4362", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "Bac3eAEc7F3f9b11f7Cdf1Db", "name": "Ut" }, { "_id": "900dbEcB5F9fA25dFDccEdF6", "name": "ut consequat dolore fugiat ad" } ] }, "edit": "ea dolore officia ex sint", "success": true }, { "message": "ipsum qui anim dolor", "original": { "_id": "3b2e704f57d32b1ac9c420a5", "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": "c4A9b4dFce822d07bCAfe1EC", "createdBy": "a8b80a40f933309747c914e7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9c970df12c4340fb515058b5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c35f5a3d895de0ce52d17ee5", "name": "voluptate Ut dolor ipsum" }, { "_id": "3628e7caee0488f60fd7bf23", "name": "consectetur eu Lorem sit" }, { "_id": "1dcf0915d378e284e11bf9c1", "name": "sunt commodo" }, { "_id": "95f3efccb3e9f21ed790aaa0", "name": "esse eu" } ] }, "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": "EFcfAEBFFCfA611bA4CdADc8", "namespace": { "type": "project", "name": "officia ad occaecat", "accessControl": { "read": [ "ullamco aliquip Ut cupidatat veniam", "Lorem nulla Excepteur", "in elit voluptate", "dolore dolore ex" ], "write": [ "do eu ipsum" ], "execute": [ "laborum deserunt in", "in ullamco veniam ad mollit", "sed commodo culpa", "amet", "qui id labore culpa" ], "manage": [ "aute ullamco ut", "eiusmod Excepteur tempor", "fugiat in" ] } }, "createdBy": "0fC8534aca277e7253a05bE0", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "9B5EFdC92Da73AC6f22Ed374", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "85823cfC43EB9aF8F16Fe1c5", "name": "ipsum aliqua" }, { "_id": "Aba34652fbF13bcE3BB577f9", "name": "dolore" }, { "_id": "7CdC8379CE17291aE7dDcc69", "name": "magna consequat id officia sint" }, { "_id": "35eB3cAF624BFdCDCB964F16", "name": "dolor in" } ] }, "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" ] } } } }