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": "d3070374bd2ae4510c1f977b", "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": null, "createdBy": "d92c1f22050f2f203ec1e426", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c1340240393648bd27368009", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7458e4bd32fb69cd6fabf242", "name": "irure anim ipsum aliquip" }, { "_id": "9d61d4c1e98166e2d3c3ba95", "name": "dolore" }, { "_id": "7e6fb1136b59f353e6e7d165", "name": "magna veniam adipisicing" }, { "_id": "861d8d02c1f6d16bd4664bb5", "name": "dolor mollit ad eu ut" } ] }, { "_id": "dddc3d910740d478c2ba4869", "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": null, "createdBy": "b758e1eee86c22caf69987be", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0af64f22834ed18acc5d77bd", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "22356dd146f63fcb616117da", "name": "deserunt irure sit consequat in" } ] }, { "_id": "c87379b30f160410c64e505e", "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": "8d5ca06551ebd3c4b35f6e56", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "149f64e6966a98ad3ad45dd0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4547d2b84862e8e19a4a134f", "name": "et consequat" } ] } ] }
{ "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": "in", "original": { "_id": "779bd214b71a974dd1d8f6fb", "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": null, "createdBy": "d8c37715e600d340c0b085b1", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "240ffe9a4625061607a4bec2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "db99c87ef2e484d2fb45f22b", "name": "consectetur amet laborum Lorem" } ] }, "created": null, "edit": null, "success": false }, { "message": "pariatur nostrud", "original": { "_id": "f307c8980a6fc496a49ea025", "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": null, "createdBy": "e001e47f40c317d0dc593c89", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1d3982dbbca21231db0e55e3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1f8acb6d1faac23ca3145833", "name": "enim" }, { "_id": "96030e23b5c3c3ba48d73ee5", "name": "ad fugiat" }, { "_id": "bed509e566cebb4d8756b7b1", "name": "cillum occaecat anim in" }, { "_id": "e8617406b1e0f6920a804e44", "name": "veniam sit irure tempor minim" } ] }, "created": null, "edit": null, "success": true }, { "message": "tempor nisi ad nulla Ut", "original": { "_id": "7914390c23c6638ade3e9c6e", "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": "E4bDc9fA93d07aCe8FB91FFC", "createdBy": "541489412c4bfbc6a605a43e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1e4ebfa78bf12283c0e0e1cc", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "87f3e64bf4a938e789b385f5", "name": "veniam laboris aute" }, { "_id": "dbbd9f1511e6a3a022b206a6", "name": "quis minim" } ] }, "created": null, "edit": "ipsum adipisicing ullamco magna", "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" ] } } } }