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": "61e7ef1cff69268f706d72a2", "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": "a398ead08d38183f893ca674", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e35bb334d3f766d2cc2dde9b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "bcd396e5080202730bf057d8", "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": "cd65258f63209b07fc1b7dc4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "98a2226b77734965eccd8b8c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "0808772139a57c6e376c39a2", "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": "2ba0c75ebfeedd56c0528c99", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3d0e081fac5c03c249ed31ae", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "e19c223479a901d99c46e948", "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": "528797cddba7dfa19818fc35", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2b01cfa538df36566338c23c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "73a27af76cd6431d99b95cd4", "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": "27c85ad92727c41a3a81e541", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "589327c56612c1e6ea14bab1", "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": "dolore cillum enim consectetur", "original": { "_id": "73a1b19fb470f41bd585c2e7", "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": "93e265e314368a11bf6e4b8a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "39183252c4855af2888806b3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": false }, { "message": "mollit incididunt Ut magna ex", "original": { "_id": "5578ea3b413a77c80f7f4056", "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": "e3eb6c27b2323dce8f5a5d63", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "76d4cea928b183c63aaacc48", "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": "88BC307b1aCd0edAfC07Eb75", "createdBy": "6D6dB3382cE170Fc2a2965F4", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "ddC709DfC1f09A20ad28FFB8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "eAF62d2880FaB4bdF4be6D3f", "name": "voluptate officia labore nisi ex", "description": "A user-defined object to help group documents." }, { "_id": "aa16d4f72BbEAc80FFe0aBD1", "name": "velit ex Excepteur labore", "description": "A user-defined object to help group documents." }, { "_id": "eAA35b6BD67ab94Cfe2fcb0f", "name": "aute nulla mollit magna ad", "description": "A user-defined object to help group documents." }, { "_id": "7CbE5C8Ea8891d7C4666c8A3", "name": "pariatur sed", "description": "A user-defined object to help group documents." }, { "_id": "bF1D7c82a19dbb0c7E72DCca", "name": "in commodo enim", "description": "A user-defined object to help group documents." } ] }, "edit": null, "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" ] } } } }