Skip to content

[FEATURE] Extension-local means to register handlers and act on them #102

@dbwiddis

Description

@dbwiddis

Is your feature request related to a problem?

In Plugins, the REST API is implemented as Action objects implementing the RestHandler interface. The routes() method is implemented to identify which REST requests the Action should handle.

Plugins have a public List<RestHandler> getRestHandlers() which provides these handlers to OpenSearch where they are registered with the RestController.

In the Extensions model, the API is communicated from the extension to OpenSearch, where all registered Routes for that extension are forwarded to the extension to handle. We need a local registry of the RestHandler implementations of an extension so we can:

  • generate the API list to send to OpenSearch
  • handle requests forwarded from OpenSearch

What solution would you like?

EIther an instance of the RestController or a new object with similar (but reduced) functionality to still correlate REST requests (method+URI) with an action.

What alternatives have you considered?

There is no specific need to continue to use the RestHandler interface for extensions; an entirely new API could be developed. However, re-using the RestHandler interface will speed the transition of existing plugins to extensions by allowing their existing Actions to be re-used with minimal alteration.

Do you have any additional context?

See comments here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions