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": "135e6cb6269eb20d937ab8fc", "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": "78546eADE54DbD05d73A466A", "createdBy": "13a55ef68d6b96b03f33a714", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "205e987e3a2e7e771aa48ff5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "587a985eeb8f3b27b702d2ec", "name": "tempor non nisi" }, { "_id": "46b4c0f193080fb585f50eea", "name": "culpa esse veniam eiusmod nisi" }, { "_id": "4336d65ef9836d21c6c051fb", "name": "elit culpa ipsum minim aliquip" }, { "_id": "ab8602096acc2651d977c3a8", "name": "tempor" } ] }, { "_id": "78a7ddcef40ad9c093383d70", "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": "63df4e8ab2bac33e232fac41", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6b1c9bae200d3df91d7040aa", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "47ac6f3a9f33d46beeb009d5", "name": "ullamco reprehenderit irure ex" } ] }, { "_id": "87ef19c0871cb8815b653440", "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": "de4bdb568750ccee5196f78e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9e3f35c382d477c9d35d734f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "6af0e07928d325eb5ddabb87", "name": "Ut culpa sunt eiusmod" } ] }, { "_id": "0698527246ec40d09e7c044f", "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": "eB4FdC7Cd2B2204df48a8Ecf", "createdBy": "85c0807674b652ec36642036", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bd8223e5b6aa39736c35fe81", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5c4a7a0337296348c0ec5968", "name": "Duis enim labore et" }, { "_id": "d505a5f1300ceb4e4bd17717", "name": "Lorem elit consectetur Excepteur dolore" } ] }, { "_id": "8bb4e71f7b3bded27bbdac90", "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": "FF0AF4ECb5AdFAD7346CF36C", "createdBy": "4a81006c180e2054f0536bc2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "0ca2de7fb9f24795be357774", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "049e52eeb40247cc697374d8", "name": "dolor fugiat consequat consectetur" } ] } ] }
{ "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": "aute consequat", "original": { "_id": "4ff2ae7fa538fb834cd979a0", "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": "F75a884306e5cdD2fefb0fbA", "createdBy": "f2ff72a9b6b410e3be825cac", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4fe886f0dc5db258bc565139", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c9e3270fdea63691e844e431", "name": "fugiat Lorem Excepteur et commodo" } ] }, "created": null, "edit": "deserunt dolore ipsum do", "success": true }, { "message": "cupidatat dolor incididunt qui", "original": { "_id": "eb666edce482bfcc024f5fb6", "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": "88fA93cedE3f5E50068bBEAC", "createdBy": "8ebcb1df474d9fc54975b11e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a765c1c97a7f172f2ccc5460", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1f49f46b182ac0218cc33cf1", "name": "amet ipsum et cupidatat reprehenderit" }, { "_id": "a2b73a6420670df02d281ded", "name": "sunt" }, { "_id": "65311bbf15881681b30ac499", "name": "et dolore" }, { "_id": "31804e80960cdfb4eb084165", "name": "proident adipisicing nisi non" }, { "_id": "c037ede1bff35627d42d8b3f", "name": "mollit sint ad voluptate occaecat" } ] }, "created": null, "edit": null, "success": false }, { "message": "Lorem in proident veniam tempor", "original": { "_id": "a809c0c3a61a3b503cd3cfbf", "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": "FEa8FA5170EeA3d42c68AaE5", "createdBy": "af95fb1b3f5b6241b7ad8307", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "49a6b2f634eac01f164ca3e5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f8aa5f3239ec52aace8587bc", "name": "cillum" } ] }, "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": "7e9ba9EA0D64EcCF92Ae70EF", "namespace": { "type": "project", "name": "deserunt ipsum aliqua labore dolore", "accessControl": { "read": [ "esse aute officia aliqua", "deserunt cillum magna" ], "write": [ "qui sit aliquip sed esse", "officia", "enim non consectetur quis" ], "execute": [ "Lorem", "nostrud nulla", "ut officia amet" ], "manage": [ "dolore amet", "dolore", "eiusmod" ] } }, "createdBy": "76b3F5d4AEB3E4f2FB4a4c27", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "Fb3BEddBF2fE564901833CFb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "cDAc7287fEdAEc6f6394F4aD", "name": "minim voluptate Duis irure in" }, { "_id": "3E5EB8C9757d8ac504bafEd4", "name": "sed aliqua non" }, { "_id": "F2D165EAa9bFe5c227c8beb7", "name": "voluptate" }, { "_id": "0a5Dc9B962fE4Bef9a2D3d64", "name": "sint irure qui proident" }, { "_id": "8fff1ccae48df7bF64bcD6Ef", "name": "deserunt mollit velit cupidatat" } ] }, "edit": null, "success": false }, { "message": "adipisicing ipsum esse sunt", "original": { "_id": "85f254ccee4404eb7295227c", "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": "57988163f6bf47d63765ad01", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7e79d62dd228f48ce8909932", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b9250219b1da2db0e8e0e30c", "name": "eu" }, { "_id": "2846b559f67e3ca87cbd4810", "name": "consequat laborum irure adipisicing" }, { "_id": "849630b9509e1c18b3df1f74", "name": "exercitation dolore qui ut ad" } ] }, "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": "c3caD32610f09bD1b6e5Cf0F", "namespace": { "type": "project", "name": "Duis ullamco cupidatat aute sit", "accessControl": { "read": [ "nulla veniam do", "Ut aliquip cillum Excepteur", "Ut cillum", "eu consequat dolore cupidatat" ], "write": [ "non ut", "nostrud veniam esse", "Ut cupidatat commodo cillum", "sit aliqua culpa tempor", "nisi voluptate sint" ], "execute": [ "laboris in consectetur", "quis est" ], "manage": [ "aliquip labore aliqua ut" ] } }, "createdBy": "8Ae3D301da14BEe610fbEEbd", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "C7bFc761A4E90dEDAF74eCB7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "bc97a9efC70FF26C79AB04B4", "name": "dolor aliquip" }, { "_id": "0Ab4A3462FcBFF03E77Ef4b4", "name": "Excepteur quis dolore qui" } ] }, "edit": "sint esse magna veniam", "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" ] } } } }