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": "10a06f86df9e9ee628948717", "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": "a799a6350c75b959286d4469", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "387e0a6cfa64aeeb9527907f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "de65657ac9ad4fd56cda3560", "name": "Ut ad sit" }, { "_id": "d0e90673d869852fb728a64f", "name": "eiusmod anim Duis cillum ad" } ] }, { "_id": "fc8d503bd13082a1835eeaf2", "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": null, "createdBy": "adf79d25b4b438b7b5d11abb", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7989995a3a307355bb57b224", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "dc44921d883a0fcda998e53e", "name": "dolor in" }, { "_id": "683fc4883247c252f857453f", "name": "officia" }, { "_id": "4648e61db849bf78bdf5ddae", "name": "sit voluptate in non sint" } ] } ] }
{ "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": "dolor commodo fugiat in non", "original": { "_id": "b798f8eee6e8002a212c31f1", "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": "577D85B216a4ba851AC798c7", "createdBy": "45557646e5fd533144221641", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e2a4fa0ba440ff5ff0cdce6c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "c9c3b91adad90b17d02d7799", "name": "ipsum dolor" }, { "_id": "9bb0510b9b47336d121e98e6", "name": "mollit" }, { "_id": "9d90098b11cba28e39d3dc01", "name": "est elit" }, { "_id": "188db03551ccf079dfb5e637", "name": "aliqua occaecat" }, { "_id": "d31857c45368d5dd07a8f513", "name": "in quis" } ] }, "created": null, "edit": null, "success": false }, { "message": "exercitation ullamco cupidatat do", "original": { "_id": "7e6804a60b8d1ead243f91fa", "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": "2dcca04F96d02AbecbBDDdDC", "createdBy": "54207029d0db598fca7617f9", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ecddaca60d0dbb998031ff4d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e2e5eaf5355a548a1b615372", "name": "nisi ex minim eu sint" } ] }, "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": "3be9c0aFbdDcb01bFff3182D", "namespace": { "type": "project", "name": "minim ut labore", "accessControl": { "read": [ "veniam eu velit reprehenderit incididunt", "velit in aliqua commodo", "officia in" ], "write": [ "in dolore", "quis", "officia eu nulla" ], "execute": [ "cupidatat ut occaecat et aliquip", "consequat", "elit" ], "manage": [ "velit culpa", "et", "ad do dolore exercitation", "aute proident sed mollit", "tempor eu" ] } }, "createdBy": "EfeeA30d0511abc98aC4E109", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "4BC7DABA7d48F24ef5ef5E4e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "20C1aE6F33Ca5e7c74aBFEdD", "name": "quis aliquip do fugiat" }, { "_id": "CeFD8a5A812aa6b58bd4C5eF", "name": "sunt Excepteur ut" }, { "_id": "160EBDBd3FEcCdc74A58279A", "name": "laboris in Excepteur quis" } ] }, "edit": "culpa", "success": false }, { "message": "voluptate", "original": { "_id": "7da977f97bf0a83a9b05786c", "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": "cB56824A4FF1583e5fd23a3a", "createdBy": "f1d5906afe193bc5f642bf52", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f98b7380c9a5197074e18c5a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "acdd2d8ebffe70ad808ef51a", "name": "do Lorem dolore aliquip" }, { "_id": "54a2686f6f7fa85a89cda175", "name": "cupidatat minim" }, { "_id": "1ae475a1ddcf44ccd4655217", "name": "irure" } ] }, "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": "B552D22C1FE6ca0BFCbeAa14", "namespace": { "type": "project", "name": "Ut tempor proident sit magna", "accessControl": { "read": [ "non", "velit magna anim in laborum", "labore sint dolor dolore id", "id", "ipsum in in esse sunt" ], "write": [ "incididunt officia", "esse cillum", "aliqua eiusmod ad", "magna ut Lorem labore non", "est eiusmod incididunt esse proident" ], "execute": [ "ex qui occaecat sunt", "in Excepteur est", "elit exercitation do", "dolor sed" ], "manage": [ "est ex" ] } }, "createdBy": "47aeCd54Baaf25bfe30A2Fee", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "f72dbcd4Eb8A38529F19D35A", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "Fb63eb4367CCE3797Fb1f6fc", "name": "Lorem sit elit" }, { "_id": "C6A3AF7e0AF839F71BBf95dD", "name": "ut aliqua nisi" }, { "_id": "8a6938BA73f96DdcB3A37F2C", "name": "occaecat ea Excepteur" }, { "_id": "3Ee5a4a6bbA8f8bB26FCf9C8", "name": "fugiat" }, { "_id": "C6841cc9cda8E8d18Fa35656", "name": "ad incididunt" } ] }, "edit": "officia minim commodo", "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.", "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }