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": "dfc442b3d91726e1eebc9cee", "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", "projectId": "3Ac2E26a2B7bfbD7fDcdaC3c", "createdBy": "597928a145af1c2a1171e5d3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "fe4c6d2a85f60f4dd5d5be7f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "855f6ab65d0772a21ba60d16", "name": "ut eu sed" }, { "_id": "8b6a2a5bc1143d63d6dd290b", "name": "id officia veniam" } ] }, { "_id": "a273f26522cb334a853d995c", "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", "projectId": null, "createdBy": "2206b54b48fb779dfb2f2145", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "5105f1a9511b2e915e1af2be", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8b9b60a4c6ed322738cad9b6", "name": "dolore aliquip laborum sint exercitation" } ] } ] }
{ "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": "minim et magna sunt", "original": { "_id": "5194e5178183eb1d31f289b7", "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", "projectId": null, "createdBy": "24106f9bb13daa44758f6114", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "3c8739e66f1974c4714194d8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "cdf8eafe9cc595f4207af017", "name": "anim eiusmod quis" }, { "_id": "27799691174624360c2066e3", "name": "nostrud velit" }, { "_id": "d7e56ada571fd63f8547406f", "name": "consequat amet velit tempor mollit" }, { "_id": "1dd76f3305cba38852348382", "name": "occaecat eu incididunt Excepteur" } ] }, "created": null, "edit": null, "success": false }, { "message": "qui elit sed ut", "original": { "_id": "dfa699594aec80223dbf3ac6", "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", "projectId": null, "createdBy": "9d482a768e21b82fccc73ba3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "349e2801098249fb76ef5f99", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5637391ab944f84ed52ef25f", "name": "nulla in consectetur labore in" }, { "_id": "12b447e83f8a9cc1a579fe61", "name": "Excepteur consequat" } ] }, "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": "ceEbEb69602bd16B847bEaEd", "namespace": { "type": "project", "name": "laborum in occaecat consequat eiusmod", "accessControl": { "read": [ "non nulla in ex exercitation", "dolore sunt", "voluptate esse aute", "officia sunt commodo sint" ], "write": [ "dolor reprehenderit", "aliquip minim", "magna pariatur anim sed amet" ], "execute": [ "culpa qui ad", "Excepteur eu consequat", "ipsum commodo", "ut eiusmod irure sit sunt" ], "manage": [ "Duis sunt pariatur eiusmod dolore" ] } }, "createdBy": "7Deb76AaDad118Cef1C1D35B", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "C53dBFfCb005CDeC9d9c74FB", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "Fd7DBC0DA131bedBf5aBBD56", "name": "deserunt dolor velit nisi amet" }, { "_id": "fdFBDFb72E00A30A0AEBB907", "name": "do" }, { "_id": "FBB7299CcbBDae1ddBb1d282", "name": "dolore" }, { "_id": "D6fdDDD2Db8d8B9Cd3cdB6d8", "name": "exercitation officia adipisicing" }, { "_id": "06F4Ef48c6B2Bfbd198AE87A", "name": "do dolor culpa mollit occaecat" } ] }, "edit": "in reprehenderit non anim", "success": true }, { "message": "minim", "original": { "_id": "b3e579a5b88ffe89a6365349", "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", "projectId": "1Cca8A9E73fa10EbfD714F1b", "createdBy": "9e21656a6bcb6c78c7af096e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f846bb603b6fd58cb7c2ef78", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "712502fdd4e3e4fada881362", "name": "enim in et eu cupidatat" } ] }, "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": "cBEFfFf675aF21deaa1C3DFe", "namespace": { "type": "project", "name": "consectetur sed", "accessControl": { "read": [ "reprehenderit", "fugiat quis incididunt ut dolore", "quis id dolore", "ipsum deserunt", "sit" ], "write": [ "enim nisi", "eiusmod Excepteur", "dolore" ], "execute": [ "sit voluptate eiusmod" ], "manage": [ "proident labore dolore eu", "deserunt", "est" ] } }, "createdBy": "dEF83dBA5b212Cc98DF4AF2D", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "8afa29fdfbEdf0E37EDa3490", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e5aa468Ab00d4fF16ec3162a", "name": "culpa occaecat sunt" }, { "_id": "A7fB39A0f3B29c2f2c9d3AFE", "name": "veniam ullamco commodo in" }, { "_id": "c0CA8e5AeaffbF3F4Ec7aCE3", "name": "sit esse" } ] }, "edit": null, "success": true }, { "message": "dolor quis", "original": { "_id": "3549a6ca5b7c7c2ce40a2878", "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", "projectId": "dBdDcD470bCbBF1C4BE7A5d8", "createdBy": "10d30bcbe9aaca0acb0b42d5", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "79105767242e1314a1ce8d5d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9c646b9c8da14f6277d6daa9", "name": "dolore amet ut magna" }, { "_id": "558ad995229107875cf49ced", "name": "voluptate elit est dolore" }, { "_id": "687ae4cbdb25778086dc0f55", "name": "nostrud ad aliquip" } ] }, "created": null, "edit": null, "success": false }, { "message": "labore nostrud deserunt quis", "original": { "_id": "00d312af68c2318cd1496dcb", "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", "projectId": null, "createdBy": "97afa38eff6a5df6fd9d8888", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "26b53580ed9d8ce48cd9632c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "d3a19529ad66e66a4da9b326", "name": "est incididunt irure" }, { "_id": "c632d25b1b013498163b0dc0", "name": "irure officia" }, { "_id": "2187f0682772a24a52d347d5", "name": "reprehenderit do quis ut mollit" }, { "_id": "33e98b3c75cecf7c2da3bef2", "name": "commodo nostrud id" } ] }, "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.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }