[ML] Settings: Increase number of items that can be paged in calendars and filters lists (#61842)

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

* update comment

* update default size comment
This commit is contained in:
Melissa Alvarez 2020-03-31 09:14:56 -04:00 committed by GitHub
parent 241a7a620a
commit f1866b331e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View file

@ -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: [
{
@ -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',
});
// 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: [
{
@ -683,7 +683,7 @@ export const elasticsearchJsPlugin = (Client: any, config: any, components: any)
},
},
{
fmt: '/_ml/filters/',
fmt: '/_ml/filters?size=1000',
},
],
method: 'GET',

View file

@ -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',

View file

@ -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.
*