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": "11d3e8d07548428f3e825315", "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": "DE71847cC2691a483AFC4b8F", "createdBy": "ac9d973e96eb0d906f8fda25", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "20fe10f6f5d06fbfaf4ffb68", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9507bc09b08af502c4e51319", "name": "do" }, { "_id": "30e1846d201be0e8e50ad1f8", "name": "in" }, { "_id": "a4ff83a3e1105cc580dca4b7", "name": "cillum officia Excepteur sint" }, { "_id": "0f539f9ca482823a60ba8468", "name": "ut sed occaecat irure" }, { "_id": "fc39b48e3ad98913d241fc42", "name": "amet in enim aliqua cillum" } ] }, { "_id": "75975c4ed0b33ae203f520b4", "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": "5177eDDAD5Bd28e342BB6b3f", "createdBy": "20170a8bacead0a87c1c71dc", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "974de308911efcb8ec935676", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "3551a3d81345869694e9bc7d", "name": "proident aute in ea" }, { "_id": "50a63cd9cb957702243f3c4d", "name": "ipsum consequat veniam aliqua" }, { "_id": "1bbf88db2a1d9508703b6c0c", "name": "laboris ut sunt" }, { "_id": "a0acdaf0e821db13dea8355f", "name": "ex cupidatat pariatur aliquip officia" } ] }, { "_id": "f61e23607d7f1677409e5f67", "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": "e91181a53e33acc7526367a5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5f3b6a0562feeda6a9c40ca3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c67e11e0158d008dfc92006c", "name": "in ut consectetur Duis dolor" } ] }, { "_id": "f01351d5db7c7742fee6e8ed", "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": "f1AcadEedEDfd3cEfd85c765", "createdBy": "980ddda4a1fa12c91a3236e1", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d906b7d4db7b19c2dbd37740", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7f23cf2c122e95deac23b8fe", "name": "aliqua enim Lorem voluptate" }, { "_id": "e812bfb37de14369ced7b5a8", "name": "ut ea ad" }, { "_id": "9253241ee8a22f52ae57eb6f", "name": "nulla" } ] } ] }
{ "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 ut", "original": { "_id": "414136621681022b0e555cda", "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": "eBd39bCEd9C1FD6C4aBdbB5e", "createdBy": "44b1c541d1b78f237bb35b16", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "45752de9a387d39ea1eec8ad", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "029f3699b00f10413bc3b21c", "name": "aute adipisicing consequat" } ] }, "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": "18be51b369B491C002A6bED8", "namespace": { "type": "project", "name": "laborum Lorem qui", "accessControl": { "read": [ "in Ut velit", "labore Lorem", "est et amet", "Excepteur labore velit eu", "occaecat est pariatur qui cillum" ], "write": [ "enim dolor laboris non veniam", "reprehenderit ea Ut aliquip dolor", "sint" ], "execute": [ "dolore ex Lorem" ], "manage": [ "ipsum", "culpa", "exercitation", "adipisicing ut veniam qui" ] } }, "createdBy": "6F1a4feDf5AfCA06f33CaD8c", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "7Ba64e4a9dEb0cf2E8d3eafb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b12EA28ECE8fA657Ca436A3A", "name": "sunt tempor pariatur ipsum" }, { "_id": "AfbfF993a9A8Ce3D7CcC3173", "name": "laborum enim fugiat reprehenderit ut" }, { "_id": "6EcEDba89e3532204EF59eb5", "name": "voluptate ad" }, { "_id": "8F23400c2eD9d2b2cAfeCB51", "name": "Excepteur exercitation dolor dolore mollit" }, { "_id": "5310d4ECEe7fEab14594A6bf", "name": "Excepteur ipsum magna" } ] }, "edit": "aute esse minim", "success": true }, { "message": "nulla", "original": { "_id": "caa94abea04f50f3179aae50", "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": "c808f2084c89da9357b6e0af", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8e48874c4eb0885d1c6b3796", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f029fd1a2f6ccc156bf17df3", "name": "et fugiat" } ] }, "created": null, "edit": "esse", "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" ] } } } }