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": "5290aa6aabeedaeb45291ae5", "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": "5973bcf38bf68908c2ea6c31", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f87087a389eb7a28ef31f771", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "044159c96ebb19db28bf097d", "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": "9343c54d5e4625733d71842c", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6a649e68dd7b6d036e2c38f6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "61bf7a8db7796ab38cca0ee7", "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": "11fbcddfee18b82d30098798", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "be70aaa341b52231050666f9", "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": "mollit irure in fugiat", "original": { "_id": "3ad7181bd8dd631c66540061", "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": "bfe23f8a0bedb5ea1434d449", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "c7b7f3c9b9fba38870b3c00e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": true }, { "message": "reprehenderit cupidatat velit", "original": { "_id": "307f0bfc2c2d4dd20a6ea65b", "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": "d1c94249c41c350f6d45f06b", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "98bf6822aaf3da758effaa2e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "est fugiat irure", "success": false }, { "message": "nisi et sunt cupidatat laboris", "original": { "_id": "ae6fdc816980f0c644913837", "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": "7c5bac749cfa1a6c8e2b4a41", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cb69f7c393e19b340e4b27b3", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "aliquip", "success": false }, { "message": "pariatur laboris in", "original": { "_id": "6984dc6cd7fcf2c368733722", "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": "86ec1a0b8f87c183927bf3fc", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cc263f534d70ab9977ee3c15", "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": "e14bbe295a1CFB89fcb1A147", "createdBy": "761fCd21beFFBc0FCCf45a38", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "e2F33169aDd214eED2bA1aB1", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": null, "success": false }, { "message": "laboris consectetur reprehenderit", "original": { "_id": "535fb3270a0b38524bfc9774", "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": "01d181e35d345abf11fe09a9", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e45b5c619dc0b44363502bae", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "proident velit", "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" ] } } } }