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": "3760a2f0aa235e33ae13d164", "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": "20539687a6f70c5bcc67bf95", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e7b12c7020b689dafbaae6b8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "30225884e36d6eed9b81e84e", "name": "in" }, { "_id": "8ea596ed2fddfcaa5a41e10d", "name": "eiusmod proident aliqua" }, { "_id": "df7dcfa08b61fa6a02582e13", "name": "ullamco labore fugiat et" } ] } ] }
{ "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": "non qui cillum ut", "original": { "_id": "3e7294090de6c2314e626736", "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": "40A53d96d8aeD30BD77Fc5D5", "createdBy": "824d9be978670e40749821eb", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "07bb9a39768b48b6a6c1a76d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "19ff34f6a5f0c26e2fda1f8d", "name": "enim" }, { "_id": "0fe62f18e250919827fa7942", "name": "non consectetur dolor occaecat" }, { "_id": "7432f0085912832c4b2a4c84", "name": "veniam aliqua anim" }, { "_id": "c4e22b7f27e3d4305492a104", "name": "reprehenderit Ut nulla ut voluptate" }, { "_id": "ffb31c64e8f246dc14248f9f", "name": "anim irure sed veniam cillum" } ] }, "created": null, "edit": null, "success": false }, { "message": "laborum", "original": { "_id": "6b6eba182cefe3bae4bb5848", "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": "aeF6c07e8dEb1dAa53Ea43Fa", "createdBy": "2d5e8f6a602cd1c054cf0eb0", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ab9c5f68b03b1a6681bfb6bf", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e9787b67e760ec07f37f5d50", "name": "occaecat minim" }, { "_id": "2c4b3383e742bea5e08fd674", "name": "Ut exercitation" } ] }, "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": "aDB62FA1fd62ADbBDCc23c38", "namespace": { "type": "project", "name": "pariatur proident consectetur", "accessControl": { "read": [ "qui", "et" ], "write": [ "adipisicing culpa irure", "enim aute id qui" ], "execute": [ "in", "sit labore adipisicing in", "dolore ea consequat Ut sunt", "tempor in dolor in esse" ], "manage": [ "magna fugiat", "reprehenderit dolore ex esse", "velit voluptate" ] } }, "createdBy": "cCe0E0CD8caeeBBe82cF4AaC", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "A786AfFb09c590108DBCE4F1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5a47Ac83BdAba3FBD781ef18", "name": "nostrud occaecat quis" } ] }, "edit": null, "success": false }, { "message": "ut ex in Duis", "original": { "_id": "11cb901b8500acd73af51016", "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": "13f90b132d0507e054109a20", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "fa14c7e184619d8b6cc2688f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "a4f44e8aa5dc60a533fb56ce", "name": "irure ullamco" }, { "_id": "0ea6c0f0a9e94e3b77404731", "name": "ex occaecat nostrud pariatur" }, { "_id": "ee4b89ed9468506eb5dc2037", "name": "tempor dolor occaecat quis Lorem" } ] }, "created": null, "edit": "Duis sint et minim", "success": false }, { "message": "est incididunt occaecat", "original": { "_id": "f5a5ffe64c30e2898a39474c", "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": "07ee8c48bbcd50ba27ed492f", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f5f27bb8b6a650f5f563fcde", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e95cf19c458c5d45fd8e8f4d", "name": "proident nostrud magna eu cillum" }, { "_id": "77a1e65fa2400c031d016ffa", "name": "aliqua" }, { "_id": "50ee29456793b2a1ad76040d", "name": "exercitation incididunt" }, { "_id": "17061e506ebcac5b279514bd", "name": "sit laborum sunt" }, { "_id": "fcac89e2d10621c915530983", "name": "id nisi Lorem sed deserunt" } ] }, "created": null, "edit": null, "success": true }, { "message": "laboris magna est pariatur elit", "original": { "_id": "16e33e279ec5214af24f0f76", "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": "dcf12f98fd6c2022d5208220", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "76f6c94464a0fa796b1e0324", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9553d3f8825f51488c4b8c1e", "name": "magna amet ut commodo eiusmod" }, { "_id": "5a7007fac86d90c997bc4215", "name": "esse dolore ex labore" }, { "_id": "262dc3b3c4105ed106a13201", "name": "mollit et" } ] }, "created": null, "edit": "Lorem laboris officia aliqua", "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" ] } } } }