Package org.opensearch.rest
Interface RestHandler
- All Known Implementing Classes:
AbstractCatAction
,BaseRestHandler
,BaseRestHandler.Wrapper
,DeprecationRestHandler
,RestAddIndexBlockAction
,RestAddVotingConfigExclusionAction
,RestAliasAction
,RestAllocationAction
,RestAnalyzeAction
,RestBulkAction
,RestCancelTasksAction
,RestCatAction
,RestCatRecoveryAction
,RestCatSegmentReplicationAction
,RestCleanupRepositoryAction
,RestClearIndicesCacheAction
,RestClearScrollAction
,RestClearVotingConfigExclusionsAction
,RestCloneSnapshotAction
,RestCloseIndexAction
,RestClusterAllocationExplainAction
,RestClusterDeleteWeightedRoutingAction
,RestClusterGetSettingsAction
,RestClusterGetWeightedRoutingAction
,RestClusterHealthAction
,RestClusterManagerAction
,RestClusterPutWeightedRoutingAction
,RestClusterRerouteAction
,RestClusterSearchShardsAction
,RestClusterStateAction
,RestClusterStatsAction
,RestClusterUpdateSettingsAction
,RestCountAction
,RestCountAction
,RestCreateDataStreamAction
,RestCreateIndexAction
,RestCreatePitAction
,RestCreateSnapshotAction
,RestDataStreamsStatsAction
,RestDecommissionAction
,RestDeleteAction
,RestDeleteComponentTemplateAction
,RestDeleteComposableIndexTemplateAction
,RestDeleteDanglingIndexAction
,RestDeleteDataStreamAction
,RestDeleteDecommissionStateAction
,RestDeleteIndexAction
,RestDeleteIndexTemplateAction
,RestDeletePipelineAction
,RestDeletePitAction
,RestDeleteRepositoryAction
,RestDeleteSearchPipelineAction
,RestDeleteSnapshotAction
,RestDeleteStoredScriptAction
,RestExplainAction
,RestFieldCapabilitiesAction
,RestFielddataAction
,RestFlushAction
,RestForceMergeAction
,RestGetAction
,RestGetAliasesAction
,RestGetAllPitsAction
,RestGetComponentTemplateAction
,RestGetComposableIndexTemplateAction
,RestGetDataStreamsAction
,RestGetDecommissionStateAction
,RestGetFieldMappingAction
,RestGetIndexTemplateAction
,RestGetIndicesAction
,RestGetMappingAction
,RestGetPipelineAction
,RestGetRepositoriesAction
,RestGetScriptContextAction
,RestGetScriptLanguageAction
,RestGetSearchPipelineAction
,RestGetSettingsAction
,RestGetSnapshotsAction
,RestGetSourceAction
,RestGetStoredScriptAction
,RestGetTaskAction
,RestHandler.Wrapper
,RestHealthAction
,RestImportDanglingIndexAction
,RestIndexAction
,RestIndexAction.AutoIdHandler
,RestIndexAction.CreateHandler
,RestIndexDeleteAliasesAction
,RestIndexPutAliasAction
,RestIndicesAction
,RestIndicesAliasesAction
,RestIndicesSegmentsAction
,RestIndicesShardStoresAction
,RestIndicesStatsAction
,RestInitializeExtensionAction
,RestListDanglingIndicesAction
,RestListTasksAction
,RestMainAction
,RestMasterAction
,RestMultiGetAction
,RestMultiSearchAction
,RestMultiTermVectorsAction
,RestNodeAttrsAction
,RestNodesAction
,RestNodesHotThreadsAction
,RestNodesInfoAction
,RestNodesStatsAction
,RestNodesUsageAction
,RestOpenIndexAction
,RestPendingClusterTasksAction
,RestPendingClusterTasksAction
,RestPitSegmentsAction
,RestPluginsAction
,RestPutComponentTemplateAction
,RestPutComposableIndexTemplateAction
,RestPutIndexTemplateAction
,RestPutMappingAction
,RestPutPipelineAction
,RestPutRepositoryAction
,RestPutSearchPipelineAction
,RestPutStoredScriptAction
,RestRecoveryAction
,RestRefreshAction
,RestReloadSecureSettingsAction
,RestRemoteClusterInfoAction
,RestRemoteStoreStatsAction
,RestRepositoriesAction
,RestResizeHandler
,RestResizeHandler.RestCloneIndexAction
,RestResizeHandler.RestShrinkIndexAction
,RestResizeHandler.RestSplitIndexAction
,RestResolveIndexAction
,RestRestoreRemoteStoreAction
,RestRestoreSnapshotAction
,RestRolloverIndexAction
,RestSearchAction
,RestSearchScrollAction
,RestSegmentsAction
,RestSendToExtensionAction
,RestShardsAction
,RestSimulateIndexTemplateAction
,RestSimulatePipelineAction
,RestSimulateTemplateAction
,RestSnapshotAction
,RestSnapshotsStatusAction
,RestSyncedFlushAction
,RestTasksAction
,RestTemplatesAction
,RestTermVectorsAction
,RestThreadPoolAction
,RestUpdateAction
,RestUpdateSettingsAction
,RestUpgradeAction
,RestUpgradeStatusAction
,RestValidateQueryAction
,RestVerifyRepositoryAction
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handler for REST requests
- Opensearch.api:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Represents an API that has been deprecated and is slated for removal.static class
Represents an API that has had itspath
ormethod
changed.static class
Route for the request.static class
Wrapper for a handler. -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Indicates if the RestHandler supports working with pooled buffers.default boolean
Controls whether requests handled by this class are allowed to to access system indices by default.default boolean
default List<RestHandler.DeprecatedRoute>
A list of routes handled by this RestHandler that are deprecated and do not have a direct replacement.void
handleRequest
(RestRequest request, RestChannel channel, NodeClient client) Handles a rest request.default List<RestHandler.ReplacedRoute>
A list of routes handled by this RestHandler that have had theirpath
and/ormethod
changed.static List<RestHandler.ReplacedRoute>
replaceRoutes
(List<RestHandler.Route> routes, String prefix, String deprecatedPrefix) Construct replaced routes using routes template and prefixes for new and deprecated pathsdefault List<RestHandler.Route>
routes()
The list ofRestHandler.Route
s that this RestHandler is responsible for handling.default boolean
Indicates if the RestHandler supports content as a stream.static RestHandler
wrapper
(RestHandler delegate)
-
Method Details
-
handleRequest
Handles a rest request.- Parameters:
request
- The request to handlechannel
- The channel to write the request response toclient
- A client to use to make internal requests on behalf of the original request- Throws:
Exception
-
canTripCircuitBreaker
default boolean canTripCircuitBreaker() -
supportsContentStream
default boolean supportsContentStream()Indicates if the RestHandler supports content as a stream. A stream would be multiple objects delineated byXContent.streamSeparator()
. If a handler returns true this will affect the types of content that can be sent to this endpoint. -
allowsUnsafeBuffers
default boolean allowsUnsafeBuffers()Indicates if the RestHandler supports working with pooled buffers. If the request handler will not escape the returnRestRequest.content()
or any buffers extracted from it then there is no need to make a copies of any pooled buffers in theRestRequest
instance before passing a request to this handler. If this instance does not support pooled/unsafe buffersRestRequest.ensureSafeBuffers()
should be called on any request before passing it tohandleRequest(org.opensearch.rest.RestRequest, org.opensearch.rest.RestChannel, org.opensearch.client.node.NodeClient)
.- Returns:
- true iff the handler supports requests that make use of pooled buffers
-
routes
The list ofRestHandler.Route
s that this RestHandler is responsible for handling. -
deprecatedRoutes
A list of routes handled by this RestHandler that are deprecated and do not have a direct replacement. If changing thepath
ormethod
of a route, usereplacedRoutes()
. -
replacedRoutes
A list of routes handled by this RestHandler that have had theirpath
and/ormethod
changed. The pre-existingroute
will be registered as deprecated alongside the updatedroute
. -
allowSystemIndexAccessByDefault
default boolean allowSystemIndexAccessByDefault()Controls whether requests handled by this class are allowed to to access system indices by default.- Returns:
true
if requests handled by this class should be allowed to access system indices.
-
wrapper
-
replaceRoutes
static List<RestHandler.ReplacedRoute> replaceRoutes(List<RestHandler.Route> routes, String prefix, String deprecatedPrefix) Construct replaced routes using routes template and prefixes for new and deprecated paths- Parameters:
routes
- routesprefix
- new prefixdeprecatedPrefix
- deprecated prefix- Returns:
- new list of API routes prefixed with the prefix string
-