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": "43c6d3830814bdc066edb55d", "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": "b31d2269e79244ae2e311689", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cac96812b9e61e8675bdecf9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "140715245b4a5906bbbe8616", "name": "velit" }, { "_id": "0c80283a70742d30da7e7feb", "name": "proident minim" }, { "_id": "72fc74dad18134c32b9aa3f5", "name": "do elit" }, { "_id": "d40a674bbdbfeb8f453c557e", "name": "adipisicing enim ut in" }, { "_id": "629eea81e08ab898fa655674", "name": "fugiat elit" } ] } ] }
{ "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": "adipisicing laboris anim", "original": { "_id": "825706d0e54d03e234489213", "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": "aefe31d8eaeceef47e8b3145", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d857a4fb81e3211c8f775fde", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6d08c95d30c003258709c13e", "name": "ex dolore mollit" }, { "_id": "42930af2bbbfe66b84bed941", "name": "cupidatat id cillum et" }, { "_id": "2f097c56293a167bb3d798d5", "name": "reprehenderit sint laboris eu ut" } ] }, "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": "E7C8C5C3397ffeD1D3Fd7b5e", "createdBy": "4efb9C5FbcdbA1FC3cC4D2ea", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "bA5BB7202dfBbCCee5CFD95A", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7B36efF78ac63DeF8De1717b", "name": "voluptate ex irure adipisicing eiusmod" }, { "_id": "f9FBA5171CaD7B10d1eACec2", "name": "laborum elit Lorem ut et" }, { "_id": "1d2EEc2B00FC1FeADDe6edf9", "name": "laborum aliquip dolor dolore" }, { "_id": "95BCDAc2FE0A460B8d6e8EFE", "name": "occaecat ea pariatur veniam" } ] }, "edit": null, "success": true }, { "message": "et id dolor", "original": { "_id": "c0d3df75bd805544d7e7f60c", "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": "9917aa3afa7f1ab938fedc63", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0176f546f11d44254bc1d586", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1fccb61821252f8585e89b75", "name": "sunt ut Duis reprehenderit" }, { "_id": "a13f3ef15472ed7bede2a2ae", "name": "cillum" }, { "_id": "c6a2fad62c57e4136554f0b2", "name": "dolor sunt et reprehenderit" }, { "_id": "54b7c292a1a89111dc2d9cb0", "name": "in" }, { "_id": "7fbd58dea24725fc5bc84590", "name": "dolor consequat mollit occaecat eiusmod" } ] }, "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": "a13fc74Bfa799a2e83B0e99a", "createdBy": "15F0BC2e7cfb95A375F6Ab2D", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "e99Bb2EBD0FCa48Cfd2B0fbe", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ceDac0dDebcB8952B12cA86a", "name": "aliquip ipsum" } ] }, "edit": "ea dolor ipsum", "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" ] } } } }