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": "291de814e98a92c3578bf828", "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": "9a8deafa81f5c0e774ee4072", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4f092a5c8df14909a84282e8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "3747bfd289e5661de646b510", "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": "c6f442905a31dbe875251375", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4602339f8e93d44aa4644993", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "3c3feffe6e43349457acb323", "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": "bda8d6e6410c21a79620d800", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "23853d62c450ef2491a9fda0", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, { "_id": "b87c9033b4bb4a172476da43", "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": "45b1fe541fd511cd9cc11c66", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "29a33769f1feaa5f8337f37c", "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": "Duis", "original": { "_id": "7b4b3434f80eef028d7a65bd", "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": "6767462cddf385f3ab09f292", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "641786cdbf7528347acae29a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": null, "success": false }, { "message": "nulla et irure", "original": { "_id": "694d1829a8c3338832e5be54", "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": "2a3f9918a0c4fb02fd114612", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b5fe4fb228a45863511e4a3f", "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": "2F6Aa8fE58c37db36948A849", "createdBy": "c87bB5aD473EeFAA5c7F5ede", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a6dce3f2CF6a1BfdB5e4327f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "edit": "officia", "success": true }, { "message": "anim quis ut aliqua laborum", "original": { "_id": "6ff9ce3bdf5181f2907b0ff3", "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": "139e1c183b068fcf08f4a35d", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "859c3f18ebc815d2a87f67a4", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "ipsum anim id tempor", "success": false }, { "message": "occaecat sint", "original": { "_id": "ebdda7b0077d222256b54b19", "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": "6421da4e02c6f8261f067449", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6449607f4605d6415e73c1e5", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1 }, "created": null, "edit": "nisi dolore quis", "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" ] } } } }