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": "d1fdb4545a84b14039645882", "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": "509a1571f9866adcfe6ab371", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e47b7146b686006f89235f10", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "449147dd391c57d1c9d295b8", "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": "d8f0d36d077fdfce2f0615c5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d441a19ed16f1890d5e78558", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "c277fe96e9c637f3a563434a", "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": "4d070089cf51efc5ab05f1e5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a2ae12ceb47da120b6bef0f4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "876c0592aab00d3806662eea", "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": "76fbc1de8bfe7969f86fe9a5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4974615f02894a75c2fdb1ff", "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": "ad irure cupidatat ea", "original": { "_id": "aabd61b6826e36e8cef403a1", "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": "83b622c8ba094fe85d050633", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9bcebbf4c60d5d3e986ffa20", "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": "Cbd6bfe4bF8bb2D0bd8ccB30", "createdBy": "aFF7e7cAd69BbDfa393CD301", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "72B224B3DCAfe5aE3b38C579", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "C3e0371eddADf6a292741C7b", "name": "minim aliquip exercitation pariatur", "description": "A user-defined object to help group documents." }, { "_id": "dbf27B9a4331e3627B52f0A3", "name": "Excepteur dolor", "description": "A user-defined object to help group documents." }, { "_id": "26AB1AAe56cA8B406E739B60", "name": "laboris dolor", "description": "A user-defined object to help group documents." }, { "_id": "5A20cb74cEffDE95cAdFbf8C", "name": "ex", "description": "A user-defined object to help group documents." }, { "_id": "1EAcebCBCA36F7d5ceD86d5E", "name": "aute esse ea Duis ut", "description": "A user-defined object to help group documents." } ] }, "edit": "ea id", "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" ] } } } }