From 715a314d2c00bde30d488fc37b0ff7277c264fcb Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Mon, 30 Mar 2020 11:54:05 -0400 Subject: [PATCH 1/3] set size limit to 1000 for calendars/filters get routes --- x-pack/plugins/ml/server/client/elasticsearch_ml.ts | 8 ++++---- x-pack/plugins/ml/server/routes/calendars.ts | 1 + x-pack/plugins/ml/server/routes/filters.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/ml/server/client/elasticsearch_ml.ts b/x-pack/plugins/ml/server/client/elasticsearch_ml.ts index ed4dc64cde3bd..3fd0842f0dc7b 100644 --- a/x-pack/plugins/ml/server/client/elasticsearch_ml.ts +++ b/x-pack/plugins/ml/server/client/elasticsearch_ml.ts @@ -514,7 +514,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) needBody: true, method: 'POST', }); - + // Calendars default size limit is 100 so explicitly set to 1000 for now. ml.calendars = ca({ urls: [ { @@ -526,7 +526,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) }, }, { - fmt: '/_ml/calendars/', + fmt: '/_ml/calendars?size=1000', }, ], method: 'GET', @@ -671,7 +671,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) }, method: 'DELETE', }); - + // Filters default size limit is 10 so explicitly set to 1000 for now. ml.filters = ca({ urls: [ { @@ -683,7 +683,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) }, }, { - fmt: '/_ml/filters/', + fmt: '/_ml/filters?size=1000', }, ], method: 'GET', diff --git a/x-pack/plugins/ml/server/routes/calendars.ts b/x-pack/plugins/ml/server/routes/calendars.ts index 63984728a18dd..34950c6ed79f7 100644 --- a/x-pack/plugins/ml/server/routes/calendars.ts +++ b/x-pack/plugins/ml/server/routes/calendars.ts @@ -42,6 +42,7 @@ function getCalendarsByIds(context: RequestHandlerContext, calendarIds: string) } export function calendars({ router, mlLicense }: RouteInitialization) { + // Gets calendars - size limit has been explicitly set to 1000 router.get( { path: '/api/ml/calendars', diff --git a/x-pack/plugins/ml/server/routes/filters.ts b/x-pack/plugins/ml/server/routes/filters.ts index 2f823d79a8e53..e827ed96b12af 100644 --- a/x-pack/plugins/ml/server/routes/filters.ts +++ b/x-pack/plugins/ml/server/routes/filters.ts @@ -47,7 +47,7 @@ export function filtersRoutes({ router, mlLicense }: RouteInitialization) { /** * @apiGroup Filters * - * @api {get} /api/ml/filters Gets filters + * @api {get} /api/ml/filters Gets filters - size limit has been explicitly set to 1000 * @apiName GetFilters * @apiDescription Retrieves the list of filters which are used for custom rules in anomaly detection. * From 919f7a35fd3d0be553e9ac41b59de4e27b5c3e0d Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Mon, 30 Mar 2020 13:57:01 -0400 Subject: [PATCH 2/3] update comment --- x-pack/plugins/ml/server/client/elasticsearch_ml.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/server/client/elasticsearch_ml.ts b/x-pack/plugins/ml/server/client/elasticsearch_ml.ts index 3fd0842f0dc7b..7258626befa07 100644 --- a/x-pack/plugins/ml/server/client/elasticsearch_ml.ts +++ b/x-pack/plugins/ml/server/client/elasticsearch_ml.ts @@ -514,7 +514,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) needBody: true, method: 'POST', }); - // Calendars default size limit is 100 so explicitly set to 1000 for now. + // Currently the endpoint uses a default size of 100 unless a size is supplied. So until paging is supported in the UI, explicitly supply a size of 1000 ml.calendars = ca({ urls: [ { @@ -671,7 +671,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) }, method: 'DELETE', }); - // Filters default size limit is 10 so explicitly set to 1000 for now. + // Currently the endpoint uses a default size of 10 unless a size is supplied. So until paging is supported in the UI, explicitly supply a size of 1000 ml.filters = ca({ urls: [ { From f0c78b91c0cceab52e9587136d6df7af4c891b35 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Mon, 30 Mar 2020 14:49:59 -0400 Subject: [PATCH 3/3] update default size comment --- x-pack/plugins/ml/server/client/elasticsearch_ml.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/server/client/elasticsearch_ml.ts b/x-pack/plugins/ml/server/client/elasticsearch_ml.ts index 7258626befa07..caedaed92e5b1 100644 --- a/x-pack/plugins/ml/server/client/elasticsearch_ml.ts +++ b/x-pack/plugins/ml/server/client/elasticsearch_ml.ts @@ -671,7 +671,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any) }, method: 'DELETE', }); - // Currently the endpoint uses a default size of 10 unless a size is supplied. So until paging is supported in the UI, explicitly supply a size of 1000 + // Currently the endpoint uses a default size of 100 unless a size is supplied. So until paging is supported in the UI, explicitly supply a size of 1000 ml.filters = ca({ urls: [ {