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": "3d26d8397bd0a77f0c4e5543", "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": "4caB2FdeF9f4D2EfaBeCbfCC", "createdBy": "4015311b248279f318781f7c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f9dabbf09f9d6bf95a369747", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "84193d368ac2c61d52872dae", "name": "ullamco dolore reprehenderit pariatur minim" }, { "_id": "8b046689e65cb16703c5a9c2", "name": "aliquip sit nostrud" }, { "_id": "92738441b4cc63ded0f368a0", "name": "labore sed mollit magna" }, { "_id": "9ebf47bad97ddae1b8ea10f3", "name": "aute ipsum commodo minim" } ] }, { "_id": "dbe2fe7bda4a00d6e1989a73", "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": "d3aF1AE60D5E20cEEdfb5CCF", "createdBy": "9ef8e14505e736bf8ed4ba64", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6b134516fd897e06eb6e87e0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f09117390b7a24a105aeef80", "name": "ex et est" }, { "_id": "67049a60f24698849c5c0350", "name": "irure" }, { "_id": "a59075368ddfaa0e8b313d97", "name": "do et anim reprehenderit" }, { "_id": "d502e2763ae8593e57c2f34f", "name": "enim laboris esse fugiat ut" } ] }, { "_id": "71b8e569cb892830b94870fe", "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": "9ca65ede66b5eda6ba03e436", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9e7c7acf57b474a6c9750953", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2e9990c9d82ee2c2ba8665f3", "name": "Ut in sunt pariatur" }, { "_id": "6d825d68b148474d1953b9aa", "name": "ea dolor in dolore" }, { "_id": "981be18f5ca4334143f46a79", "name": "exercitation anim" }, { "_id": "5ec19433624bf977cf220c25", "name": "fugiat occaecat" } ] }, { "_id": "90be1c2fa316fe4c3e6198a5", "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": "f06fc7870ae00cd203b3882e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "59e30904f580b132b602c069", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a8110be3056f19a4eae9d0d8", "name": "exercitation ad aliqua" } ] }, { "_id": "5b84e10851bd2cf13933d4df", "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": "33e73bc31e3b92704ee6c540", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "060cd5f4c201e67b8bdc1b82", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "bf01f36f718869e0aed143df", "name": "cillum" }, { "_id": "eb9b6aec8611eae22ed84dd9", "name": "exercitation quis" } ] } ] }
{ "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": "tempor ut culpa", "original": { "_id": "34435b0a81df069b09eef2c4", "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": "E7eaf7f7E1Fdc8D8dA4B6DeD", "createdBy": "52b8d0321c4d982355defd96", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "90dc91a65eb465be16bbc04b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a4fcf5a00b84f92f423b4b09", "name": "magna aute dolore" } ] }, "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": "E9ce0E6bcff7Cf2b55EDdf3D", "namespace": { "type": "project", "name": "magna sed irure", "accessControl": { "read": [ "in officia dolor sint aliqua", "esse dolor cillum", "fugiat nostrud sed" ], "write": [ "sit", "anim Duis ut officia id", "nostrud occaecat ad magna commodo", "in dolore Excepteur ut", "dolor" ], "execute": [ "in sunt Excepteur ex", "laboris id consectetur laborum culpa", "ea ut in minim" ], "manage": [ "ipsum magna in reprehenderit laboris" ] } }, "createdBy": "5f29bBb8AaAe9B3Cf8F1CF2D", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "94d0fE07D5B98AcC193F7967", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "58AEf2A1E6bDADfa8BBBDe9B", "name": "labore" }, { "_id": "f25DBd55c73f7ebacE81Dbfa", "name": "eiusmod ad cillum laboris in" }, { "_id": "61dc5E6Ee137fEE66BBE350A", "name": "aute adipisicing non" }, { "_id": "DDbB94482a3d7E5f51d301bf", "name": "veniam aliqua labore" } ] }, "edit": null, "success": true }, { "message": "enim", "original": { "_id": "dfbd801b2b340e83097a7f9b", "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": "1B2061bD8eecF7f07501daE6", "createdBy": "26879875f4ab222752713a6b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "06f7f8d50a4496c79ffff0a9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "b55aac0159b749df85ba2b7a", "name": "officia sint commodo ut ex" }, { "_id": "9ccb1a9b686798194be3140c", "name": "aliquip qui ad Lorem" } ] }, "created": null, "edit": "anim eiusmod ullamco sunt non", "success": true }, { "message": "Duis labore non proident irure", "original": { "_id": "7e7dd88f93a5a63705d814ac", "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": "4f8ff4bb4a2539f73b71479f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f66682c5d672729a6918900b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ea324601c391d7311a69b12c", "name": "sed laboris deserunt dolore sit" }, { "_id": "4e729b966db777a2e133f25f", "name": "elit" }, { "_id": "f89115da97a0fe33e0277961", "name": "dolor labore id Duis ullamco" }, { "_id": "ee5de0d47dba6e18f5a326d1", "name": "aliquip nostrud" }, { "_id": "374924f218a52263fa5bad40", "name": "in dolor dolor fugiat mollit" } ] }, "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": "C3d7fE6AcDC6cdbeDD4B557F", "namespace": { "type": "project", "name": "esse culpa quis reprehenderit est", "accessControl": { "read": [ "sed in quis reprehenderit" ], "write": [ "eiusmod elit", "voluptate dolore ut sunt et" ], "execute": [ "adipisicing officia", "labore do Lorem sunt" ], "manage": [ "id consequat pariatur est aliqua", "aute nisi", "exercitation id commodo laboris", "esse sit eiusmod sunt qui" ] } }, "createdBy": "eBFdFDf286AeB3f98BC9aDFB", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "DEA0475C51df74249F0bd240", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0dabAeAa00eB60D58443BaCb", "name": "in aute" }, { "_id": "8Ef0AfBa7f71eaBcA7d0CD90", "name": "aliquip Ut" }, { "_id": "9f786ebF1CEDD27aB6BeFFde", "name": "laboris elit labore occaecat" } ] }, "edit": "et sunt", "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" ] } } } }