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": "8d3572818b48fd3d29028b65", "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": "7a2b58fa692bd8089613c097", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ad0064e68a63e6b05dad7077", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2f16231620f45ddec8f7402a", "name": "adipisicing" }, { "_id": "debe99e28ddc3f3bf084ce30", "name": "Duis" }, { "_id": "be31d813c695f592f0185141", "name": "eu velit commodo" }, { "_id": "c6b5f84ccc0f201a1e47fcb1", "name": "amet dolor" }, { "_id": "f05c92d43b3fc5adb8cd4070", "name": "proident in ut fugiat" } ] }, { "_id": "8cf0aac58221653b5b5ad181", "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": "c91ed606525e24e90c8a5862", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1b45b9d7f6dd2c290d5bf208", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9587ff71ffc7f8c1a4890839", "name": "ipsum do" }, { "_id": "c516d1cb7b73da9e41838e40", "name": "commodo" }, { "_id": "0a81f18f7f8751aed4e51162", "name": "officia" }, { "_id": "80854db68a6132a61bd076c0", "name": "sint nostrud id" }, { "_id": "6850750b3afac38e91061367", "name": "Lorem non exercitation" } ] }, { "_id": "481a76d7842be5c309cc2e19", "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": "e989f26670d4b675297cf261", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "707cf285da6699b80e3f64e0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c1a616def030dbf69e6a8b95", "name": "ipsum sint laboris aliqua" }, { "_id": "d01c1f1e0d111068e00dad76", "name": "dolor consectetur eu" }, { "_id": "56db0feab9910adafb14192c", "name": "tempor consectetur quis" } ] }, { "_id": "175fa0cfb0a520f119b5006c", "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": "c294e3f6bf16964f475b71b7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ca30cca93d60b9771f8fe94c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d6f7ef21a2c8270104641fdc", "name": "officia sunt in elit" }, { "_id": "f1c068247bafa8208ec147e7", "name": "culpa amet fugiat ipsum et" } ] }, { "_id": "774f6a137a7c0f7c924ac970", "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": "71911665fadc3b75588608ae", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bcdb3d7497d4e150f59b9517", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6f453b4366de0abe9979e1e4", "name": "officia ut elit Duis" }, { "_id": "f6f3c523e6278dd32305116b", "name": "adipisicing laborum veniam" } ] } ] }
{ "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": "Duis adipisicing", "original": { "_id": "352ec42adf974e4216b30442", "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": "fac4d0f73ca64a00525f6ab6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "68566e35439105f893631da4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "70d0a382f686615d6e5b7450", "name": "occaecat est minim" }, { "_id": "2362490635ecbd56f1e73f4a", "name": "velit" }, { "_id": "f1b2fbfb8da1750d8d3682a1", "name": "proident in et aute ad" } ] }, "created": null, "edit": "officia veniam esse irure", "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.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }