Skip to content

Conversation

@benwtrent
Copy link
Member

This commit adjusts the following APIs so now they not only support an _all case, but wildcard patterned Ids as well.

  • GET _ml/calendars/<calendar_id>/events
  • GET _ml/calendars/<calendar_id>
  • GET _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>
  • DELETE _ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for all the tests

/**
* Helper function for adding OR type queries for a given identity field.
*
* This adds a new filter to the passed `boolQueryBuilder`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* This adds a new filter to the passed `boolQueryBuilder`.

return this;
}

public ResultsFilterBuilder resourceTokenFilers(String fieldName, String[] tokens) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public ResultsFilterBuilder resourceTokenFilers(String fieldName, String[] tokens) {
public ResultsFilterBuilder resourceTokenFilters(String fieldName, String[] tokens) {

pageParams = PageParams.defaultParams();
}
getCalendars(pageParams, listener);
final String[] calendarIds = Strings.splitStringByCommaToArray(request.getCalendarId());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GET request docs will need updating to add the standard description of a wildcard-able ID parameter

"comma-separated list of calendar Ids and wildcard expressions. You can get all by using _all, or * or by omitting the ID"

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent benwtrent merged commit a653a1c into elastic:master Sep 18, 2020
@benwtrent benwtrent deleted the feature/ml-unifying-api-id-behavior branch September 18, 2020 13:39
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Sep 18, 2020
…TE forecasts (elastic#62563)

This commit adjusts the following APIs so now they not only support an `_all` case, but wildcard patterned Ids as well.

- `GET _ml/calendars/<calendar_id>/events`
- `GET _ml/calendars/<calendar_id>`
- `GET _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>`
- `DELETE _ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>`
benwtrent added a commit that referenced this pull request Sep 18, 2020
…TE forecasts (#62563) (#62629)

This commit adjusts the following APIs so now they not only support an `_all` case, but wildcard patterned Ids as well.

- `GET _ml/calendars/<calendar_id>/events`
- `GET _ml/calendars/<calendar_id>`
- `GET _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>`
- `DELETE _ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants