[8.8] [ML] Increasing calendar events request limit (#158726) (#158812)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[ML] Increasing calendar events request limit
(#158726)](https://github.com/elastic/kibana/pull/158726)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2023-06-01T10:24:59Z","message":"[ML]
Increasing calendar events request limit (#158726)\n\nFixes
https://github.com/elastic/kibana/issues/158712\r\n\r\nIncreasing the
limit for getting all events, the default is `100`, which\r\ncan easily
be passed.\r\nAlso increasing the size for getting all calendars, for
consistency.","sha":"e4be75943757c382fb42bf11c974cc6f260fb902","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix",":ml","Feature:Anomaly
Detection","v8.9.0","v8.8.1"],"number":158726,"url":"https://github.com/elastic/kibana/pull/158726","mergeCommit":{"message":"[ML]
Increasing calendar events request limit (#158726)\n\nFixes
https://github.com/elastic/kibana/issues/158712\r\n\r\nIncreasing the
limit for getting all events, the default is `100`, which\r\ncan easily
be passed.\r\nAlso increasing the size for getting all calendars, for
consistency.","sha":"e4be75943757c382fb42bf11c974cc6f260fb902"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/158726","number":158726,"mergeCommit":{"message":"[ML]
Increasing calendar events request limit (#158726)\n\nFixes
https://github.com/elastic/kibana/issues/158712\r\n\r\nIncreasing the
limit for getting all events, the default is `100`, which\r\ncan easily
be passed.\r\nAlso increasing the size for getting all calendars, for
consistency.","sha":"e4be75943757c382fb42bf11c974cc6f260fb902"}},{"branch":"8.8","label":"v8.8.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: James Gowdy <jgowdy@elastic.co>
This commit is contained in:
Kibana Machine 2023-06-01 07:33:22 -04:00 committed by GitHub
parent cc69e5ba15
commit 458be9f229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -47,7 +47,7 @@ export class CalendarManager {
}
async getAllCalendars() {
const body = await this._mlClient.getCalendars({ body: { page: { from: 0, size: 1000 } } });
const body = await this._mlClient.getCalendars({ body: { page: { from: 0, size: 10000 } } });
const events: ScheduledEvent[] = await this._eventManager.getAllEvents();
const calendars: Calendar[] = body.calendars as Calendar[];

View file

@ -28,6 +28,7 @@ export class EventManager {
const body = await this._mlClient.getCalendarEvents({
calendar_id: calendarId,
job_id: jobId,
size: 10000,
});
return body.events;