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": "15b9d02c77ef5a5274207e51", "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": "8e01ec9cc4937008b131b1ed", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a7f1fadde6db7275f74139c3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 } ] }
{ "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": "ipsum", "original": { "_id": "3383a82ab1fdf51b46f2e818", "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": "70c6df0223fd8c8ab86944e2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b32df05d08e80403c5906dce", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "consectetur sunt", "success": true }, { "message": "id ipsum minim sit nisi", "original": { "_id": "fe0a78f9e31ea1ed072ae68d", "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": "549971100bc0523cbd2b38d3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "55d0be82a1cd8e3efec65e10", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "b1B3594e8DcAA56d36dD84Fa", "createdBy": "FdFE8CAdC8E0db2D0bF4c73d", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "ECEBdCeCFFdAcABEd09aE1DA", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "Ea0E71f3e7b9AB6B9aF2C5Ba", "name": "laborum", "description": "A user-defined object to help group documents." }, { "_id": "EA3Bc541dfcC72fF0f13f86b", "name": "aliqua dolore exercitation", "description": "A user-defined object to help group documents." }, { "_id": "Fae0fCBe09eFe80D2aCA39Da", "name": "anim in veniam", "description": "A user-defined object to help group documents." }, { "_id": "6bBB597DAEaA5b473cEeDBCc", "name": "esse ea tempor", "description": "A user-defined object to help group documents." } ] }, "edit": "Ut", "success": false }, { "message": "et consectetur Lorem", "original": { "_id": "e9290ce359af9dccaf0e9e45", "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": "e826580bc12b481a8cdb7c7d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1854497b8b2757d4e41af206", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "D3dDadfb4AA5B9Da007b06A5", "createdBy": "917Ca8ef68FC60Cf7FfE0d71", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "1BAf83ad95ba4cc1A9eC4C6E", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "dea70E3B70fe6cAdF7B3A22F", "name": "aliqua consectetur commodo dolor magna", "description": "A user-defined object to help group documents." }, { "_id": "7D6Fc3FfaaFa5Eec4481Fb82", "name": "exercitation officia sed", "description": "A user-defined object to help group documents." }, { "_id": "C21865E750fd1c8A11FcC190", "name": "adipisicing quis eu", "description": "A user-defined object to help group documents." }, { "_id": "EA27cCA6D7F46AbfDE2ee8bC", "name": "ut dolore officia amet enim", "description": "A user-defined object to help group documents." } ] }, "edit": "nostrud Duis do nisi", "success": true }, { "message": "ad reprehenderit aliqua", "original": { "_id": "d9aa5faa4b61c0eabf539278", "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": "468bbe0a128ed881d793fc90", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d14475cf175f79e589856159", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "CA15ee2aecb0D8D47cB9590e", "createdBy": "A34cEF0Ad9Af230603f69336", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "aFfAa9C2CAFcc1e4e9cEADd2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "FD46E2F8AA2aD38c61B03C45", "name": "qui in labore aliquip", "description": "A user-defined object to help group documents." } ] }, "edit": "laboris ut Ut proident", "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" ] } } } }