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": "0472aef66b154deb27777137", "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": "DcadFcBcD30aB4dC9a85Bf56", "createdBy": "cfad4c0b18a6a13f029256a3", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "58f752a10472354e16e3ff40", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "1de1e638a77c41c1851dff64", "name": "adipisicing" }, { "_id": "9fc461423ad7e3d7225304b0", "name": "sunt aliqua non proident minim" }, { "_id": "a53ba9029603bc3fbf4c9469", "name": "veniam laborum" } ] }, { "_id": "67bb19b6b92e59f13c0a2df0", "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": "64a89332f964fa71c021fd90", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "db5c8573653e4279d3d5d72b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a6bdc4f156f86ea60b21a825", "name": "Ut sit" }, { "_id": "80309ef73eef85e590496838", "name": "cillum" }, { "_id": "b0595fcadd9d399562a5f188", "name": "consequat" }, { "_id": "87d6a3e0f15fdc208680ce40", "name": "qui est adipisicing" }, { "_id": "4ac4c3908017c9d7e6e601c7", "name": "magna nostrud" } ] }, { "_id": "adcf3c28669dfda6213cf96b", "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": "6aE3CCDd4ED5CBacfa5de8fc", "createdBy": "5ecee7276ac9ad1381ece6b9", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a232eeff2c82f26923fa0187", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "8037f3001146fad45e2d3b4a", "name": "esse eiusmod officia amet in" }, { "_id": "a637e53236e9c246495eaa89", "name": "sed enim occaecat minim" }, { "_id": "6a9bad2b8f93b24e6c7cb772", "name": "officia dolor" }, { "_id": "6cf74a3b2285838742e4643d", "name": "ad sit" }, { "_id": "e073cc14478dd91ee2870fa3", "name": "labore minim anim commodo" } ] } ] }
{ "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": "commodo dolor dolor", "original": { "_id": "819908d86fde1c55dc0469a8", "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": "b7da0a22e6b23bb70595c31c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "597ed0a59ac1dc261cc8f428", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f0fc9c37a2ed04eec3463148", "name": "ut consectetur ea id" }, { "_id": "a5c9579abb76bf37b6c74d1a", "name": "sed quis commodo Excepteur" } ] }, "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": "b5ddB6bD33eA061b10ED1847", "namespace": { "type": "project", "name": "cillum incididunt laboris aliqua", "accessControl": { "read": [ "occaecat ex et" ], "write": [ "adipisicing" ], "execute": [ "Duis aliquip esse", "esse in id", "velit officia eiusmod", "nostrud nulla" ], "manage": [ "velit Ut quis" ] } }, "createdBy": "7a2457455eEEcB9eAF96791f", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "E3A79EFEA3Fc40cD84B8ea2B", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "BEAFEf4b0956e62BA91ce0cA", "name": "in" }, { "_id": "3e6b826C9F0DcAB2b48CbAFd", "name": "deserunt" }, { "_id": "43cF48410cA0b0cAFDDCd12d", "name": "eu" } ] }, "edit": "Excepteur incididunt quis", "success": true }, { "message": "Excepteur eiusmod", "original": { "_id": "b42a0683bf6207056d271595", "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": "a38a434bBE9aeAe1BdCcabc2", "createdBy": "e2d1fb03a29bcdee0d9e3c8d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1f8918db49461f0d13d7eb08", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5c7010415f1cdf70bbe4754f", "name": "in elit Ut amet occaecat" }, { "_id": "369f6fe979ecf9ecbe005997", "name": "Duis Excepteur ipsum dolor" }, { "_id": "f447a3ae1122d1cb47d515ca", "name": "sit non proident" }, { "_id": "5a775afa02e271a5c84a3903", "name": "eu amet" }, { "_id": "ee90786b68038a3c4b3b78fb", "name": "quis" } ] }, "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": "04e4867b7ffACB3bB04Dbddb", "namespace": { "type": "project", "name": "mollit Duis in minim qui", "accessControl": { "read": [ "esse ut nisi" ], "write": [ "in aute et nostrud" ], "execute": [ "in eiusmod id enim incididunt", "tempor occaecat Lorem", "cupidatat" ], "manage": [ "Duis ullamco", "culpa", "incididunt in ullamco mollit consequat", "Ut quis magna laborum", "aliqua culpa deserunt incididunt consequat" ] } }, "createdBy": "C4158EdF9Bc2bFBdd4aa3EeA", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "cB39cDC0bD8B57cB76cABCdb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "55ADc8346CfC0A7Df449e2bE", "name": "dolore" }, { "_id": "2CCceD44bcC4ab2548c471FF", "name": "aliquip" } ] }, "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" ] } } } }