-
Notifications
You must be signed in to change notification settings - Fork 25.6k
REST API compatiblity documentation #83487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
feac71c
initial stab at compat api docs
jakelandis be39b51
fix build error
jakelandis 0a47ad3
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis 08423a4
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis f77fed3
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis db7b284
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis a02b6b0
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis cdc889f
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis 1033656
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis 90bb1cb
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis b0fedbf
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis f2e0a98
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis fdd4e57
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis e9591c8
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis f5df150
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis 8cf35fb
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis a39d973
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis 7f4cb69
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis 3b6b5cc
Update docs/reference/migration/migrate_8_0/rest-api-changes.asciidoc
jakelandis 802e21b
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis 4ae22d8
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis 45da4c8
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis 4cf9bd7
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis 1713dc5
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis a838243
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis 367c860
line breaks
jakelandis 9c248e4
remove whitespace
jakelandis e51189b
added todo to fix broken link
jakelandis ed669b3
Revert "added todo to fix broken link"
jakelandis 17f423f
Update docs/reference/rest-api/rest-api-compatibility.asciidoc
jakelandis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| [[rest-api-compatibility]] | ||
| == REST API compatibility | ||
|
|
||
| To help REST clients mitigate the impact of non-compatible (breaking) | ||
| API changes, {es} provides a per-request, opt-in API compatibility mode. | ||
|
|
||
| {es} REST APIs are generally stable across versions. However, some | ||
| improvements require changes that are not compatible with previous versions. | ||
| For example, {es} 7.x supported custom mapping types in many URL paths, | ||
| but {es} 8.0+ does not (see <<removal-of-types>>). Specifying a custom type | ||
| in a request sent to {es} 8.0+ returns an error. However, if you request | ||
| REST API compatibility, {es} accepts the request even though mapping types | ||
| are no longer supported. | ||
|
|
||
| When an API is targeted for removal or is going to be changed in a | ||
| non-compatible way, the original API is deprecated for one or more releases. | ||
| Using the original API triggers a deprecation warning in the logs. | ||
| This enables you to review the deprecation logs and take the appropriate actions | ||
| before upgrading. However, in some cases it is difficult to | ||
| identify all places where deprecated APIs are being used. This is where REST API | ||
| compatibility can help. | ||
|
|
||
| When you request REST API compatibility, {es} attempts to honor the previous | ||
| REST API version. {es} attempts to apply the most compatible URL, request body, | ||
| response body, and HTTP parameters. | ||
|
|
||
| For compatible APIs, this has no effect--it only impacts calls to APIs | ||
| that have breaking changes from the previous version. An error can still be | ||
| returned in compatibility mode if {es} cannot automatically resolve the incompatibilities. | ||
|
|
||
| IMPORTANT: REST API compatibility does not guarantee the same behavior | ||
| as the prior version. It instructs {es} to automatically resolve any | ||
| incompatibilities so the request can be processed instead of returning an error. | ||
|
|
||
|
|
||
| REST API compatibility should be a bridge to smooth out the upgrade process, | ||
| not a long term strategy. REST API compatibility is only honored across one | ||
| major version: honor 7.x requests/responses from 8.x. | ||
|
|
||
| When you submit requests using REST API compatibility and {es} resolves | ||
| the incompatibility, a message is written to the deprecation log with | ||
| the category "compatible_api". Review the deprecation log to identify | ||
| any gaps in usage and fully supported features. | ||
|
|
||
|
|
||
| For information about specific breaking changes and the impact of requesting | ||
| compatibility mode, see <<breaking_80_rest_api_changes, REST API changes>> | ||
| in the migration guide. | ||
|
|
||
| [discrete] | ||
| [[request-rest-api-compatibility]] | ||
| === Requesting REST API compatibility | ||
|
|
||
| REST API compatibility is implemented per request via the Accept | ||
| and/or Content-Type headers. | ||
|
|
||
| For example: | ||
|
|
||
| [source, text] | ||
| ------------------------------------------------------------ | ||
| Accept: "application/vnd.elasticsearch+json;compatible-with=7" | ||
| Content-Type: "application/vnd.elasticsearch+json;compatible-with=7" | ||
| ------------------------------------------------------------ | ||
|
|
||
| The Accept header is always required and the Content-Type header is | ||
| only required when a body is sent with the request. The following values are | ||
| valid when communicating with a 7.x or 8.x {es} server: | ||
| [source, text] | ||
| ------------------------------------------------------------ | ||
| "application/vnd.elasticsearch+json;compatible-with=7" | ||
| "application/vnd.elasticsearch+yaml;compatible-with=7" | ||
| "application/vnd.elasticsearch+smile;compatible-with=7" | ||
| "application/vnd.elasticsearch+cbor;compatible-with=7" | ||
| ------------------------------------------------------------ | ||
| The https://www.elastic.co/guide/en/elasticsearch/client/index.html[officially supported {es} clients] | ||
| can enable REST API compatibility for all requests. | ||
|
|
||
| To enable REST API compatibility for all requests received | ||
| by {es} set the environment variable `ELASTIC_CLIENT_APIVERSIONING` to true. | ||
|
|
||
| [discrete] | ||
| === REST API compatibility workflow | ||
|
|
||
| To leverage REST API compatibility during an upgrade from 7.17 to {version}: | ||
|
|
||
| 1. Upgrade your https://www.elastic.co/guide/en/elasticsearch/client/index.html[{es} clients] | ||
| to the latest 7.x version and enable REST API compatibility. | ||
| 2. Use the {kibana-ref}/upgrade-assistant.html[Upgrade Assistant] | ||
| to review all critical issues and explore the deprecation logs. | ||
| Some critical issues might be mitigated by REST API compatibility. | ||
| 3. Resolve all critical issues before proceeding with the upgrade. | ||
| 4. Upgrade Elasticsearch to {version}. | ||
| 5. Review the deprecation logs for entries with the category `compatible_api`. | ||
| Review the workflow associated with the requests that relied on compatibility mode. | ||
| 6. Upgrade your {es} clients to 8.x and resolve compatibility issues manually where needed. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.