java.lang.Object
org.elasticsearch.rest.RestHandler.Route.RouteBuilder
- Enclosing class:
RestHandler.Route
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
deprecateAndKeep
(String deprecationMessage) Marks that the route being built has been deprecated (for some reason -- the deprecationMessage), but will not be removed.deprecatedForRemoval
(String deprecationMessage, RestApiVersion lastFullySupportedVersion) Marks that the route being built has been deprecated (for some reason -- the deprecationMessage) for removal.replaces
(RestRequest.Method replacedMethod, String replacedPath, RestApiVersion lastFullySupportedVersion) Marks that the route being built replaces another route, and notes the last major version in which the path is fully supported without compatibility headers.
-
Method Details
-
deprecatedForRemoval
public RestHandler.Route.RouteBuilder deprecatedForRemoval(String deprecationMessage, RestApiVersion lastFullySupportedVersion) Marks that the route being built has been deprecated (for some reason -- the deprecationMessage) for removal. Notes the last major version in which the path is fully supported without compatibility headers. If this path is being replaced by another then usereplaces(Method, String, RestApiVersion)
instead.For example:
Route.builder(GET, "_upgrade") .deprecatedForRemoval("The _upgrade API is no longer useful and will be removed.", RestApiVersion.V_7) .build()
- Parameters:
deprecationMessage
- the user-visible explanation of this deprecationlastFullySupportedVersion
- the lastRestApiVersion
(i.e. 7) for which this route is fully supported. The next major version (i.e. 8) will require compatibility header(s). (;compatible-with=7) The next major version (i.e. 9) will have no support whatsoever for this route.- Returns:
- a reference to this object.
-
replaces
public RestHandler.Route.RouteBuilder replaces(RestRequest.Method replacedMethod, String replacedPath, RestApiVersion lastFullySupportedVersion) Marks that the route being built replaces another route, and notes the last major version in which the path is fully supported without compatibility headers.For example:
Route.builder(GET, "/_security/user/") .replaces(GET, "/_xpack/security/user/", RestApiVersion.V_7).build()
- Parameters:
replacedMethod
- the method being replacedreplacedPath
- the path being replacedlastFullySupportedVersion
- the lastRestApiVersion
(i.e. 7) for which this route is fully supported. The next major version (i.e. 8) will require compatibility header(s). (;compatible-with=7) The next major version (i.e. 9) will have no support whatsoever for this route.- Returns:
- a reference to this object.
-
deprecateAndKeep
Marks that the route being built has been deprecated (for some reason -- the deprecationMessage), but will not be removed.For example:
Route.builder(GET, "_upgrade") .deprecateAndKeep("The _upgrade API is no longer useful but will not be removed.") .build()
- Parameters:
deprecationMessage
- the user-visible explanation of this deprecation- Returns:
- a reference to this object.
-
build
-