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": "523f7166a81e2d90903c789f", "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": "4cd73875466fee6d30ec2152", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9ad28615359da8b83898515a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "2048497cc0a7c95d132533e5", "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": "5bc2480fbb2a29c2f5f61639", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "777cdb535cbda192c96ad942", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "c11c7a392be52f32b859da37", "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": "a8ab988821c1c8e3c2f2c027", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "126bfcc35e924230808e0137", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "ee8616579b86a8d4bb30d352", "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": "2675a5349864428a2ef869d9", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "269f4b0308137e235f2ab37a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "2ec0116afb38bb93a9c43e62", "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": "12a8d14c419f62c94b1bb70f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bff7b1a1bc7f68fa7c553332", "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": "consequat officia amet", "original": { "_id": "7b7bbe0c8c6e645a08ca03d0", "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": "ae7ead083a838946db34056b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5a33196f76bc390de05ce570", "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": "1aaC16f0b327d1caDa5cD316", "createdBy": "C35dCCbEF2eB4697fffeb87e", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "4BBFd1c5bfCA0BCe1749B3D8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0F1f9917F3Bfa374c9c6bfBe", "name": "fugiat anim Excepteur qui", "description": "A user-defined object to help group documents." }, { "_id": "d8e0BBc3529fCDbe6DDe9De1", "name": "incididunt do", "description": "A user-defined object to help group documents." } ] }, "edit": null, "success": false }, { "message": "occaecat voluptate tempor ex", "original": { "_id": "bd52407699c6437cc3034836", "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": "34f3b10cde87d5d81d851585", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1c0ed8aff2d4b02dc4e37262", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "reprehenderit tempor", "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" ] } } } }