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": "de464c1ddaeb663d8325d745", "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": "80cf4c8657314a007b2759e7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "26471e3be2cf3f44b9547959", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "55807214d0309f1c2063bcb0", "name": "deserunt labore" }, { "_id": "fa60a7f9ffcb13396a541a73", "name": "adipisicing" }, { "_id": "7b21d518ad09044c3a0b48e8", "name": "elit veniam dolor fugiat" }, { "_id": "21ea3efd680da7032bc70ae3", "name": "sit sint sunt eiusmod" } ] } ] }
{ "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": "sed commodo velit sunt Excepteur", "original": { "_id": "2922aef1b1714d6fc65eb934", "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": "2f65cf594cfad2f8d0483fe7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0ed173e6da97a4976e4522d9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "83ff3d64db4106e5e8a04904", "name": "officia ut irure est" }, { "_id": "d5734652f583f84428fe2947", "name": "ut quis" } ] }, "created": null, "edit": null, "success": false }, { "message": "consequat et", "original": { "_id": "1e0edab98963c52bd119905d", "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": "c1a2a9e076b8fe968a4648dd", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ed37c59c65bb33c9c67cd4e3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "cc490765a1a1d0e255e2dd76", "name": "in quis" }, { "_id": "e1d7bf7b32f5f790bdaed71f", "name": "in" }, { "_id": "717ee6c2c75bd67abc7a2997", "name": "aliqua in voluptate occaecat" }, { "_id": "d300312c549c820cb5bcd294", "name": "deserunt" }, { "_id": "cc76c3fae32da1f09d6b1f12", "name": "do laborum quis" } ] }, "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": "95CBe78dAebfdDF436bfc43e", "createdBy": "0ec2f23b0bbda7E8fbFdC2aB", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "71fb13fDF74f4dfC229AD7bf", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "116a5c8bb3DaBc8AB7c817ce", "name": "ut ut", "description": "A user-defined object to help group documents." }, { "_id": "db3CFd99e65C10Abc04F9B0a", "name": "incididunt exercitation ut ex et", "description": "A user-defined object to help group documents." } ] }, "edit": null, "success": false }, { "message": "sit eu cupidatat", "original": { "_id": "15ea7b72d7f3538334eee24e", "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": "b3049b7410fe6d615d5f8c68", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1c837e9dabfa59462055c779", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ad8b27dfd6401cad7fbbffd2", "name": "aute aliqua adipisicing qui ea" } ] }, "created": null, "edit": null, "success": true }, { "message": "officia est velit", "original": { "_id": "7224207cc04dcf93c1fd1e9e", "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": "2fd0cd6f76e1bbcd6923269a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "de12c38240f29bec54cedae4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2d9fe21581156a2af699f9c0", "name": "ullamco Lorem non mollit sed" } ] }, "created": null, "edit": "laborum", "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" ] } } } }