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": "9f6f3c7068e993971b638e1a", "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", "createdBy": "557efa324a92ad2fb7192cbb", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "177171cd07d613ce8f359d01", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "fdf9440fee3e83d35a804e2c", "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", "createdBy": "d4ec0dfd7e67eb76422339ec", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "505ad9f2d1f26cc93117deef", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 } ] }
{ "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": "nisi mollit magna", "original": { "_id": "ee2c6731d2c9fa2a0b6665d8", "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", "createdBy": "b0071b75a1e5cb7121f1ccac", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e7a7636a3269bc142d426202", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": false }, { "message": "voluptate pariatur tempor", "original": { "_id": "21397eee0226070ee7d395e4", "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", "createdBy": "6ff4eb77d244c09a92f6514b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "51e330f5b0560f91609ec242", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "sed esse adipisicing Excepteur Ut", "success": false }, { "message": "eu", "original": { "_id": "48006e42dfbc10e6fed38290", "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", "createdBy": "deb7ded49b1ea0f5cb9147e4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6a1b9053bca21069d0d4494c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "C9f0ebd3259cc7FDc8CBAf3F", "createdBy": "DAFfcC7d3be927998b3C9a05", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2efdE652Db9Eaab9C7e277FC", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": false }, { "message": "est laborum nulla ex", "original": { "_id": "3ec4273b2df5fec9dfdba246", "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", "createdBy": "c4215143a3cb9c0dbb37776b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7fa84cd3defdcaf1ba6d52df", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "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": "20ca016645FEDD2Fdd74AFF3", "createdBy": "cD8BC1913Ca2bDF78CE979fD", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "F95AefDaD26fFA7c53dbdFCa", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": "voluptate Lorem nisi fugiat", "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }