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": "4d2a84c395c66d66ba585a00", "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": "06df3b546df91b38fd3ef9cf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d360e8a5b4c22d525fdc8f05", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "fafd9339b488940094969f6b", "name": "sint nisi" } ] }, { "_id": "a012ec8b0a64a814f02da600", "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": "21959e4ea0a47bb38ac4014b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ec041c8775ca469611fe7e00", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "dfaf71ee79af874fd45aad8f", "name": "ut enim dolor ad voluptate" }, { "_id": "bd431015f3a829b33a8d9764", "name": "reprehenderit esse ea commodo fugiat" }, { "_id": "fe70da27e7807baf035dcb08", "name": "elit adipisicing" }, { "_id": "e99d674646c055ba157c019d", "name": "esse" } ] }, { "_id": "286ac668b42b3bf01f5d19ed", "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": "d184637d1b5dc02d2891e20c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "096d9bd0bc68d68d6aad525e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d155890aa02b75e81c9522fa", "name": "minim in" }, { "_id": "1265ff33d7379cdbd2ffdd89", "name": "quis voluptate dolor nisi adipisicing" }, { "_id": "eecbe2fca927b6e37ecd03a0", "name": "laboris tempor ut do" }, { "_id": "5635b9b21493c64f6d944cdd", "name": "Duis reprehenderit ut non do" } ] }, { "_id": "045523876c1da90e24514acc", "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": "d80a1d1f533ad58ea531dbd4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9cbe0ea969120b2af0981cc2", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "570962f35f58631c3657f81a", "name": "sunt" }, { "_id": "ac646709c9189aee7643cddb", "name": "veniam" }, { "_id": "706fc13aa41a1dbaa08e3b53", "name": "reprehenderit nisi dolore consectetur minim" } ] } ] }
{ "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": "quis ea ullamco velit", "original": { "_id": "954c06e848a92b87e1ac24ea", "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": "5b170477708313a741c85ab6", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "246f4f95c1d3628912920ffd", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c993271af1fef3e8452853cb", "name": "labore" }, { "_id": "bf69b6d2dc15b6a92230dded", "name": "tempor labore occaecat" }, { "_id": "e032ec04a864bc27d2c1860e", "name": "commodo enim dolor ullamco" }, { "_id": "04dcd42fd9a1a9703ac8bdc4", "name": "consequat ut et" }, { "_id": "7b328e3c39a3740170617bf0", "name": "exercitation in nostrud" } ] }, "created": null, "edit": null, "success": true }, { "message": "et adipisicing ex", "original": { "_id": "df7b60e07a87ecfcde44e240", "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": "182d8d93757f17d7810a9474", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ae88a8056875dee182ed8c42", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1213f749f6ecc28c218c42a7", "name": "quis ea minim" }, { "_id": "2f1bf9e96203bddb4e8e1d1c", "name": "adipisicing nisi proident laborum" }, { "_id": "46689fa536f73bc2b0866eff", "name": "ad aliqua" } ] }, "created": null, "edit": "sit Lorem ad", "success": true }, { "message": "dolore esse sint ad tempor", "original": { "_id": "027c2f3ab819063725a74971", "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": "887b1f780b1d52033f21f64d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "241f53ff0b2efa1455a4467c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a1928642ad55574e4eb4579c", "name": "esse in consequat occaecat laborum" } ] }, "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": "F4de8bB56Bf0Da7Bcfa27ceF", "createdBy": "BbFBe3adDE97DCaaf4daf0AB", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "33643A8D6BeeeF07C569AD1a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "aDaDcd6EAEdEbfd5a3Cc58AD", "name": "consectetur Duis exercitation ad" } ] }, "edit": "magna aliquip", "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" ] } } } }