Skip to content

[ML] ml.get_calendar_events API uses GET with an HTTP body without alternative method #79271

@sethmlarson

Description

@sethmlarson

Discovered in elastic/elasticsearch-specification#852 the ml.get_calendar_events API specifies a body and has a route with method: GET but unlike other Elasticsearch APIs doesn't provide an alternative method like POST or PUT which can cause issues for generated language clients as some cannot specify GET with a body.

The trouble is that we cannot add POST to the list of methods for the already defined path /_ml_calendars/{calendar_id}/events as it'd conflict with the path of the ml.post_calendar_events API.

My proposal is to add an additional path for the API (maybe /_ml/calendars/{calendar_id}/get_events?) that defines both GET and POST as is typical of most APIs. This wouldn't require explicitly deprecating the existing path but may require a documentation update to list the new path for others to use?

cc @lcawl @droberts195

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Core/Infra/REST APIREST infrastructure and utilities:mlMachine learning>bugTeam:ClientsMeta label for clients teamTeam:Core/InfraMeta label for core/infra teamTeam:MLMeta label for the ML team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions