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": "b224f99ad7044d7325ed31d7", "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": "a3A96a1AF4bcD855A8BbA375", "createdBy": "a28dc1c2c1f644aef42daf04", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "59630b2d7c019f19b7e26112", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "fd4b77d113b089ed5bde2620", "name": "aliqua commodo quis incididunt culpa" } ] }, { "_id": "a144835db98e9d0a8f8c29f6", "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": "e81d423837b38cbba099e61e", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2dd14eb9c16a06aa38055539", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "485e41b574ce31968966f4fa", "name": "proident tempor id ex elit" }, { "_id": "6536ee19a92ccda3b349f3a8", "name": "irure" }, { "_id": "c66d500e1fb67715d5d62ebf", "name": "in dolore" }, { "_id": "2d927bad8a9af591f0831e14", "name": "Lorem dolore non culpa" }, { "_id": "4fa3dbeaae05834378217fc7", "name": "aute sed eu in ea" } ] }, { "_id": "ee0567c24e42afaf267e2147", "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": "15b290dfb66bce2e9d1917bf", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "bf4b2351484b87639df3ec47", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f360f34ed657c36e9c4c9031", "name": "elit nostrud quis" }, { "_id": "2405b6214b5c76f5c394bdf7", "name": "consequat sed cupidatat" }, { "_id": "d3e879c8009e33da6704720f", "name": "et irure ipsum velit" }, { "_id": "aa5cb96ba74ebd21cd8b5bf2", "name": "reprehenderit" } ] } ] }
{ "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": "dolor anim", "original": { "_id": "80e199dc64519f55402273f8", "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": "FF0BAA9D18FAF08eFEEeEd2e", "createdBy": "3d125e5cc4e0e0bd23867483", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f8a1355121bdf7c216a9c038", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a764003cc4dd99ee9ac72ba1", "name": "in" }, { "_id": "4176d5f29c6653e2c2d83813", "name": "mollit aliqua exercitation proident" }, { "_id": "4433ff30cf21cdf1063a9907", "name": "magna" }, { "_id": "ae7abcb9274236d44f189021", "name": "dolore officia culpa amet magna" } ] }, "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": "Dcd86E2A283bD327eD4abEFD", "namespace": { "type": "project", "name": "in occaecat", "accessControl": { "read": [ "eiusmod nostrud", "voluptate ipsum et" ], "write": [ "quis", "officia Lorem occaecat" ], "execute": [ "fugiat cillum", "tempor deserunt consequat adipisicing occaecat", "in ea laborum nostrud proident", "deserunt" ], "manage": [ "est" ] } }, "createdBy": "9AACcfad29e94C3ef54e6c8F", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "D6aC373D6dE9aeE321EA5b6E", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2f02a9BaFdee04ddcb278D71", "name": "commodo aliquip officia consequat" }, { "_id": "0C6F8a42FB386f5AAbCBDc33", "name": "eu irure officia" }, { "_id": "a02Fef6Fd6bFEB3EDBcEe4ef", "name": "tempor reprehenderit irure exercitation culpa" }, { "_id": "BbdA0B20eFc5f1bafdACf1D2", "name": "voluptate" } ] }, "edit": "elit officia est incididunt ut", "success": true }, { "message": "Duis cupidatat eu id", "original": { "_id": "4f410879ed04a271f18c2043", "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": "6BAA5Dc0FA93781d3FF5A2Fe", "createdBy": "366b8233b9a1921d8eecfc8b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1498d3b782ed6afb0d7e7052", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9700011371822bbe21d357f3", "name": "sit fugiat" }, { "_id": "eb6035dfd709f254393f8183", "name": "ut elit magna" }, { "_id": "cab8524209ee93686128b85a", "name": "dolore id" }, { "_id": "115a3e4b78a7f60a9c0a6fbb", "name": "incididunt aliqua consectetur adipisicing" }, { "_id": "b4e5ebb3f783e3c14c1f107c", "name": "Lorem sint sunt enim esse" } ] }, "created": null, "edit": null, "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" ] } } } }