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": "5ed3c30316e52954b56535f8", "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": "99dFFD3c1DEeD5DeeF42EFa7", "createdBy": "5b1959e253b03dfcf14e6846", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "a93235142c8aae3d8e63dc67", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "ae3f8c3edeb977d5cef655ed", "name": "ut consequat aliqua id sit" }, { "_id": "e259f2289590c32992a55c4c", "name": "sit cupidatat" } ] }, { "_id": "de53be003bff028a7c5a3d34", "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": "dd8c2B7E7AF2A9Bc4dD59dB0", "createdBy": "07f1ef5ba482d3a0fa32f7c4", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "d52fa63753367a5a07724bfe", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "af4120f03434f4752101cc07", "name": "occaecat laborum dolore" }, { "_id": "f6ed8a89400dab8120b82ffb", "name": "laborum voluptate" }, { "_id": "6adc4a4c3f06308801f78e6b", "name": "est irure adipisicing laborum nisi" }, { "_id": "42d1571b6337391fb830f413", "name": "amet Duis veniam" } ] } ] }
{ "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": "minim dolore pariatur aliquip", "original": { "_id": "e9a38efd312148ecc5d8904e", "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": "8e21bcb3183b65316b293f01", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "050b3f2e639dfb1c32f1edf9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "303cd55321726275fe1af586", "name": "quis" }, { "_id": "daeee9707468da38a6ed3dd6", "name": "aliqua aliquip et culpa velit" }, { "_id": "776377114492afc289c97144", "name": "labore qui" }, { "_id": "433bbbc8c7a1d646cd917096", "name": "quis esse officia" } ] }, "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": "74cB62d26D68F524f95cFFbd", "namespace": { "type": "project", "name": "consectetur consequat ut occaecat reprehenderit", "accessControl": { "read": [ "dolore", "non aliqua", "quis id dolor esse", "id eu incididunt pariatur irure", "mollit" ], "write": [ "commodo", "cupidatat officia consectetur labore" ], "execute": [ "ea pariatur elit", "pariatur irure magna officia", "ullamco sint cillum laborum" ], "manage": [ "velit sint aliquip", "commodo pariatur ipsum", "et quis nostrud eiusmod ullamco", "consequat et", "in mollit cupidatat" ] } }, "createdBy": "D397f6702EaC34e3F45fc66C", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "C92951Be2Fbfe0B4DcD45EfD", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "aaeD45dd8B987Be6C505C9f8", "name": "est dolor incididunt" } ] }, "edit": "fugiat", "success": false }, { "message": "incididunt Excepteur ex", "original": { "_id": "3586e3f5c632499bf76d675d", "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": "Bffa6D2DBF1B144c4bceB8B5", "createdBy": "4ca1a8a693a28ee710586474", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b5eb3c227ebcf1a01fefb72a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "10245dc0d73cd9605baefe11", "name": "ad nisi" }, { "_id": "4563fe47c5580824477fcacb", "name": "velit dolore" }, { "_id": "113a304c4b7d70782c719fb8", "name": "ut labore elit aute ad" }, { "_id": "c43281c821c2cff6c90f5c84", "name": "consectetur proident" }, { "_id": "541db939a85e6ed29c9a5b28", "name": "adipisicing" } ] }, "created": null, "edit": "sit aliqua pariatur", "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" ] } } } }