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": "79a804267bdd42388efbb2b6", "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": "6ac3a02b5dfa4f1b21b84312", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7a1a980c9488b213a3c770c6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "242fe063a977463442281893", "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": "2572c634d9ca2968eb0b90a6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "69c9a4613b248d9dec03defb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "4b850a3a13158831671b009f", "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": "39b74e30324ea923a8a2cf11", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "503868a7673133033e96c487", "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": "Ut", "original": { "_id": "33f7cecf7988a7a547b97d76", "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": "ac0b1dbe6f38a8991c8932d5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8628a3010d8afce07b25b2ee", "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": "4F5Bde0BAB5aC524774e2FCC", "createdBy": "091F3A7A65f0d6Eb6E913be3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "23fec8B6fdc49E53fEFCBBAA", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": false }, { "message": "consequat cillum", "original": { "_id": "99d1bb569f532000ffd1491f", "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": "13975fdafa03573ac2ad54e2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "590273664dc3caea17a4b49a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "elit cupidatat amet labore", "success": false }, { "message": "exercitation Duis et labore", "original": { "_id": "0bb8de814bda538147f6626c", "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": "17543971e663aab023a3ff4c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "179175665e20306842974ad0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "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" ] } } } }