Skip to content

[ML] Make get scheduled events endpoint and spec consistent with docs#78923

Closed
droberts195 wants to merge 1 commit intoelastic:masterfrom
droberts195:allow_post_instead_of_get_plus_body
Closed

[ML] Make get scheduled events endpoint and spec consistent with docs#78923
droberts195 wants to merge 1 commit intoelastic:masterfrom
droberts195:allow_post_instead_of_get_plus_body

Conversation

@droberts195
Copy link
Copy Markdown

The docs for the get scheduled events endpoint stated that the
arguments could be sent in a request body instead of in URL
arguments. The spec was inconsistent with this.

Additionally, GET endpoints that allow a request body need to
support POST too, for the benefit of clients that do not support
GETs with bodies.

This change adds the option to POST a get scheduled events
request and adjusts the spec to permit this.

Relates to elastic/elasticsearch-specification#852

The docs for the get scheduled events endpoint stated that the
arguments could be sent in a request body instead of in URL
arguments. The spec was inconsistent with this.

Additionally, GET endpoints that allow a request body need to
support POST too, for the benefit of clients that do not support
GETs with bodies.

This change adds the option to POST a get scheduled events
request and adjusts the spec to permit this.

Relates to elastic/elasticsearch-specification#852
@droberts195 droberts195 added >bug :ml Machine learning v8.0.0 Team:Clients Meta label for clients team v7.16.0 v7.15.2 labels Oct 11, 2021
@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Oct 11, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/clients-team (Team:Clients)

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/ml-core (Team:ML)

@@ -14,7 +14,8 @@
{
"path":"/_ml/calendars/{calendar_id}/events",
Copy link
Copy Markdown
Contributor

@sethmlarson sethmlarson Oct 11, 2021

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah, yes. I guess that is why having a POST option for this endpoint wasn't implemented in the first place.

So it's impossible to fix all the discrepancies.

All the functionality is available to the clients using a GET with URL arguments. There's nothing you can do with GET+body that you cannot do with GET+URL args.

It's just that we cannot adhere to the rule that GET+body always supports POST as well because of the POST endpoint that does something different, and we've already documented that GET+body is possible, so we cannot remove that option.

So we're left with an endpoint that doesn't obey all the conventions and cannot be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :ml Machine learning Team:Clients Meta label for clients team Team:ML Meta label for the ML team v7.15.2 v7.16.0 v8.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants