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": "afdea9296d458af7b96871f9", "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": "55Eb8c5af7A42b0e8f434f95", "createdBy": "49432873254a96e98da25fd0", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "93016cb235a72141c2dd7bea", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "f81c2a807e6350460dfe2b87", "name": "aliquip ad labore adipisicing reprehenderit" }, { "_id": "916f2cef7022ed5c77c69f9d", "name": "id occaecat deserunt" }, { "_id": "bf655a208ec361dc9fda1699", "name": "amet dolor elit dolor voluptate" } ] }, { "_id": "56aa7244e51ca89a580b5aab", "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": "AA5A0Cd1DDA24578a5fCB727", "createdBy": "07ad3ef41366b2b45bbaebaa", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "4bdd146354000878b2336bc8", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "9660b00f1b0dc39b642a203a", "name": "pariatur" }, { "_id": "7c88cffb2bb56a59441db98d", "name": "est nisi enim" } ] } ] }
{ "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": "est aliqua", "original": { "_id": "60daf4e5f4722a14cd20b548", "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": "eD3AFedCE0B6a684e6263864", "createdBy": "3e1c84c4ca73426075b67010", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "e6f15fdc0e8015b370022580", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "2bfe1fde50231f98fba43180", "name": "laboris culpa in velit nisi" }, { "_id": "fc0ba2dc2b13057312ae5637", "name": "esse nulla fugiat 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": "68BE7f56f59C94c3b7CbA537", "namespace": { "type": "project", "name": "nulla magna", "accessControl": { "read": [ "culpa adipisicing est consectetur" ], "write": [ "in", "adipisicing veniam eiusmod", "in anim in mollit laboris" ], "execute": [ "eu proident incididunt sint ut", "dolor qui eiusmod", "Ut ullamco dolor", "incididunt tempor est" ], "manage": [ "aliquip laboris ullamco et", "exercitation quis esse voluptate ullamco", "aliquip dolore" ] } }, "createdBy": "8aDBafA8aBd06Dd98EBEf7ff", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "1B1Eb4951B4af0EF017CDb7f", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "74cf5E32ECCb3Fc75CabeeD2", "name": "ullamco in" }, { "_id": "9ec16017d3A74BAD6BE3fd4B", "name": "enim tempor consectetur esse deserunt" }, { "_id": "4dfBD1e5bdac5cA6BBAEFEBc", "name": "aliquip sit" } ] }, "edit": "ipsum aliquip quis consequat enim", "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" ] } } } }