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": "e8ffef614be7f12ff5396ee3", "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": "cB0aA9e1A9e3aCaD7Ad20e07", "createdBy": "d99256d9ed3209dd93e19dec", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b4c832fa7fd7f2971923d84a", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "4147c8262653851b128a25c4", "name": "laborum nostrud do aliqua elit" }, { "_id": "651035ee66d8c5db5ad67086", "name": "occaecat eiusmod sunt reprehenderit" } ] }, { "_id": "06be688120bb71a12e9eea0e", "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": "7DCC4ADaA20AFD4AaB499bcD", "createdBy": "56085fd98f881cf8a3a2f5a9", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "6c09406ad3c1fa43e976a029", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "0ddaade3902a9b32d9c857ab", "name": "in in" } ] }, { "_id": "dbf9447c8ef4b809ae2650bb", "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": "F6de0BC0e5c9Bb32DFDf1C79", "createdBy": "bd0e4815d8e740341b6b0576", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "f93469fa60d93f0001969ea9", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "593f7f143c56bdfd8a1d870e", "name": "enim ea" }, { "_id": "897d88cc70121c67198f951a", "name": "id dolor eiusmod dolore proident" }, { "_id": "e9e4221ce1ee86fd1a835586", "name": "nostrud non" }, { "_id": "be87372932e055754c1123d2", "name": "aute" }, { "_id": "f1072cfb35efc5b190bbde4e", "name": "esse non in magna" } ] }, { "_id": "661ed7c8884b56a2aed19c22", "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": "7a399f69deBBB2D1FcDf116B", "createdBy": "b417f0d088d8d21572dce0d2", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "8eb5a8172f5ebc6b4ba205da", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "027c8e355a0701e2df468f7e", "name": "labore" } ] }, { "_id": "c3b9cb713c542a4f3d5aaa54", "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": "3680c08a4e5d6349ff47806a", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "7096762802f12c3e324ce14c", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "e49af0e5ae8b738d3a64a769", "name": "magna nisi" }, { "_id": "881096da9983ebb2cd5f7b11", "name": "adipisicing et eiusmod" }, { "_id": "cb08f776745256259b21649d", "name": "aute non sint adipisicing pariatur" }, { "_id": "b4cef7fd8c0201a077c6b3a1", "name": "id ut nisi" }, { "_id": "923d15b1f2cd4be97dfa2189", "name": "sit minim tempor ad labore" } ] } ] }
{ "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": "in dolore veniam elit et", "original": { "_id": "4650283d76225cf3f6d1c277", "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": "85c57e4320aaa4a1fb986839", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "21118c66297dff2dbbf4d0b7", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "7890f7b52231f27dd2cf28ed", "name": "veniam ut Ut dolor elit" } ] }, "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": "7c0933F6ee3CdFAe5Ad41AAF", "namespace": { "type": "project", "name": "aliquip dolor labore exercitation proident", "accessControl": { "read": [ "consectetur ad" ], "write": [ "id cillum proident ut fugiat", "sed ipsum nulla incididunt", "minim laboris cillum ut nostrud", "sit veniam enim" ], "execute": [ "tempor non eiusmod eu" ], "manage": [ "et velit nisi sunt pariatur", "occaecat quis pariatur laboris", "dolor incididunt voluptate tempor", "irure dolore occaecat" ] } }, "createdBy": "43588Facc8F8bBB3FaCEEfE4", "created": "2019-11-25T22:51:39.201Z", "lastUpdatedBy": "c83DabF99a72b80C6dA62c38", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "Ea42AF4F1D77DAAf209c6162", "name": "in ullamco occaecat commodo" } ] }, "edit": "labore", "success": true }, { "message": "incididunt ut nostrud eu", "original": { "_id": "545080713a98e1236d834020", "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": "db1afDC8A3Ddb2EdaD221eCa", "createdBy": "a2213677d131d531320d46ff", "created": "2019-11-25T22:51:39.201Z", "lastModifiedBy": "b0dd383b8d0f027ebbf7755d", "lastUpdated": "2019-11-25T22:51:39.201Z", "version": 1, "tags": [ { "_id": "491abd6495186187174b09af", "name": "laborum in dolore" }, { "_id": "bb83416a6a3427574264e779", "name": "consectetur" }, { "_id": "b842e9d75e9c1b241e8e0d2e", "name": "occaecat pariatur laborum" }, { "_id": "981562accfd14b17de963d4d", "name": "est laboris id" }, { "_id": "36aef9c2ed2d538910a7e480", "name": "magna ut elit adipisicing do" } ] }, "created": null, "edit": null, "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" ] } } } }