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": "918cab7cdefddc3f6512c6d9", "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": "a1fdc9a31b85e28ff0efe627", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "653d2309badb7eb83a281ce7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "953724917f1427d32cc00004", "name": "Lorem consectetur Excepteur Ut eiusmod" } ] }, { "_id": "b5693b95fb5eafa85806c314", "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": "db3119ad48ea79a4cd73c06a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "2e3e007a7d88ec2b6f6bd57e", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e2867dbd4d14a15b97711c74", "name": "velit dolore non voluptate dolore" }, { "_id": "0e9dcb300c6e1961fa3bbade", "name": "dolore minim sed reprehenderit nulla" }, { "_id": "5fcdff29354b2ee8b82f8d68", "name": "culpa officia aliqua laboris deserunt" }, { "_id": "80be597d2060f85313569b76", "name": "minim" } ] } ] }
{ "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": "laborum elit", "original": { "_id": "1dc692c3c040fb0b2951de6b", "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": "df3b04022ef1eb180db07fd0", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "9267c38e31ac6ac1db0a6d2b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "174986f5c7341ed68e742b31", "name": "dolor in velit do" }, { "_id": "3fb9d845632b0dae7b58f4f5", "name": "sed reprehenderit magna" } ] }, "created": null, "edit": null, "success": false }, { "message": "eiusmod", "original": { "_id": "31d488a86a0a89e562c24ae9", "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": "79cb2c4831a7db544aafdead", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "ba12458efc2d4001c9c4219b", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "32ec4efb149202620a0404dc", "name": "ut eiusmod et eu est" }, { "_id": "0683fcb4a920234c5f5aeae7", "name": "sit pariatur laborum nisi" }, { "_id": "d41bc1e4b778657577d1124f", "name": "incididunt adipisicing velit ea consectetur" }, { "_id": "25576dd984f26f45454d500d", "name": "eiusmod" }, { "_id": "833de1d60fa73d7412d49680", "name": "Duis eu" } ] }, "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": "eD5C43a42Ca34e4A9f9b525a", "createdBy": "eAabCFAB06B452fa4DC573E6", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "BC4a313eBCBFB5975dA7F2Bb", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "5dC3aCFC7eFfb324e92FD9Aa", "name": "veniam aute aliqua sed ullamco", "description": "A user-defined object to help group documents." }, { "_id": "dF2Ea42d52B8bF2330cD4b9B", "name": "ut sed", "description": "A user-defined object to help group documents." }, { "_id": "F0478a4Eb8f1daD960BE0663", "name": "in enim mollit", "description": "A user-defined object to help group documents." }, { "_id": "7E97cbC247CafaEeB07ee343", "name": "enim", "description": "A user-defined object to help group documents." }, { "_id": "3404bE8af562Fa3cC31B407b", "name": "nisi", "description": "A user-defined object to help group documents." } ] }, "edit": null, "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.", "type": [ "string", "null" ] } }, "required": [ "status", "message", "original", "created", "edit" ] } } } }