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": "941b8dd33714c9c8c2c3f59d", "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": "f75a7aac7b11ef62314ae45d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "1d13a038707770e061b50216", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c5e5acff1d36dbd68afe7379", "name": "cupidatat do est" } ] }, { "_id": "68fb830d67acec28b19aa712", "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": "871d128d6bd1b41eb121a5ad", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "952338ba3c7dfddb83df45a6", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "789bca75f263ec38b53960be", "name": "et occaecat fugiat" }, { "_id": "c9ba9ad0493e19784e2f278d", "name": "esse elit sint ad magna" }, { "_id": "a749d39bab1686ada8bd09bc", "name": "ipsum" }, { "_id": "b1592a67ece58e0ac4d51f12", "name": "est" }, { "_id": "7997492fa2a17894c32e99ac", "name": "sit id amet" } ] }, { "_id": "f6627a6ef6fb29bbb6094929", "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": "f9918c2f5acfaf21abed95a7", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "193c6192c12ed7ac48adf29d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ecf39c8e524dc05d28cd712d", "name": "adipisicing" }, { "_id": "1815d31275d674fcdac9a742", "name": "in" }, { "_id": "ee799f4eed7b8c2edeec5cf4", "name": "adipisicing nulla amet" } ] }, { "_id": "5926ba14adfd9e606b76a481", "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": "8700e48c46c51d8b239d2181", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "fd0882427f97c80c1c165037", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "06bff11b117922ff8379e248", "name": "qui est Lorem sit" }, { "_id": "b48ab021c2b675cde543470b", "name": "dolore" }, { "_id": "e96d2bcaa914ef6fa31ccf5c", "name": "in" } ] } ] }
{ "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": "sit ea ad proident", "original": { "_id": "2c5d4ef7fcff7036d6cce164", "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": "93f03c8df945b9ffa6111994", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "cd0a88b7fdedc119795da102", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "335305a0bd9366c1573dc863", "name": "quis veniam mollit" }, { "_id": "dfe1f0fd93c368583bc6a961", "name": "in ullamco" } ] }, "created": null, "edit": "Duis", "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" ] } } } }