Skip to content

Commit

Permalink
[ML] Settings: Increase number of items that can be paged in calendar…
Browse files Browse the repository at this point in the history
…s and filters lists (#61842) (#61970)

* set size limit to 1000 for calendars/filters get routes

* update comment

* update default size comment
  • Loading branch information
alvarezmelissa87 authored Mar 31, 2020
1 parent aac0b69 commit 813f42a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions x-pack/plugins/ml/server/client/elasticsearch_ml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any)
needBody: true,
method: 'POST',
});

// 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: [
{
Expand All @@ -526,7 +526,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any)
},
},
{
fmt: '/_ml/calendars/',
fmt: '/_ml/calendars?size=1000',
},
],
method: 'GET',
Expand Down Expand Up @@ -671,7 +671,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any)
},
method: 'DELETE',
});

// 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: [
{
Expand All @@ -683,7 +683,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any)
},
},
{
fmt: '/_ml/filters/',
fmt: '/_ml/filters?size=1000',
},
],
method: 'GET',
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/ml/server/routes/calendars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/routes/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 813f42a

Please sign in to comment.