diff --git a/sense/app/kb/api_1_0/aggregations.js b/sense/app/kb/api_1_0/aggregations.js index b701bf67bdedd3..dd182c6c2c0aef 100644 --- a/sense/app/kb/api_1_0/aggregations.js +++ b/sense/app/kb/api_1_0/aggregations.js @@ -52,6 +52,7 @@ define(function () { }, "field": "{field}", "script": "_value", + "script_id": "", "params": {}, "lang": "groovy" }, @@ -88,6 +89,7 @@ define(function () { }, "min_doc_count": 10, "script": "_value", + "script_id": "", "params": {}, "lang": "groovy", // TODO: these also support regex - extend! @@ -136,6 +138,7 @@ define(function () { ], "keyed": { __one_of: [true, false]}, "script": "_value", + "script_id": "", "params": {}, "lang": "groovy" }, @@ -153,6 +156,7 @@ define(function () { ], "keyed": { __one_of: [true, false]}, "script": "_value", + "script_id": "", "params": {}, "lang": "groovy" }, @@ -170,6 +174,7 @@ define(function () { ], "keyed": { __one_of: [true, false]}, "script": "_value", + "script_id": "", "params": {}, "lang": "groovy" }, @@ -257,6 +262,7 @@ define(function () { __any_of: [] }, "script": "_value", + "script_id": "", "params": {}, "lang": "groovy", "compression": 100 @@ -268,6 +274,7 @@ define(function () { "precision_threshold": 100, "rehash": true, "script": "_value", + "script_id": "", "params": {}, "lang": "groovy" }, diff --git a/sense/app/kb/api_1_0/document.js b/sense/app/kb/api_1_0/document.js index 830ddf4dedbdf6..a79ec90d08c6c9 100644 --- a/sense/app/kb/api_1_0/document.js +++ b/sense/app/kb/api_1_0/document.js @@ -136,6 +136,7 @@ define(function () { }, data_autocomplete_rules: { "script": "", + "script_id": "", "lang": "groovy", "params": {}, "doc": {}, @@ -145,5 +146,23 @@ define(function () { }); + api.addEndpointDescription('_put_script', { + methods: [ 'POST', 'PUT'], + patterns: [ + "_scripts/{lang}/{id}", + "_scripts/{lang}/{id}/_create" + ], + url_components: { + "lang": [ + "groovy", + "expressions" + ] + }, + data_autocomplete_rules: { + "script": "" + } + }); + + } }); \ No newline at end of file diff --git a/sense/app/kb/api_1_0/query.js b/sense/app/kb/api_1_0/query.js index 8d4664f921536d..8b2f054011d572 100644 --- a/sense/app/kb/api_1_0/query.js +++ b/sense/app/kb/api_1_0/query.js @@ -59,6 +59,7 @@ define(["_"], function (_) { "script": "_score * doc['f'].value" }, "script": "", + "script_id": "", "lang": "groovy", "params": { diff --git a/sense/app/kb/api_1_0/search.js b/sense/app/kb/api_1_0/search.js index 937a4b3aefc5cb..0a42f2dfc58906 100644 --- a/sense/app/kb/api_1_0/search.js +++ b/sense/app/kb/api_1_0/search.js @@ -184,9 +184,38 @@ define(function () { "_search/template" ], data_autocomplete_rules: { - __scope_link: "_search" + "template": { + __one_of: [ + {__scope_link: "_search"}, + { "file": "" }, + { "id": ""} + ] + }, + "params": { + + } } }); + + api.addEndpointDescription('_get_delete_search_template', { + methods: ['GET', 'DELETE'], + patterns: [ + "_search/template/{id}" + ] + }); + + api.addEndpointDescription('_put_search_template', { + methods: ['PUT'], + patterns: [ + "_search/template/{id}" + ], + data_autocomplete_rules: { + "template": { + __scope_link: "_search" + } + } + }); + }; });