## What is the purpose of the change

This PR adds a versioning scheme to the REST API.

Versions are represented as a simple prefix (e.g. `v1`) that is prefixed to the 
request, like `/v1/foo/bar`.

Supported versions are encoded in the `MessageHeaders`, and used by the 
`RestServerEndpoint` to register handlers for specific versioned URLs.
Additionally handlers are also registered for the _unversioned_ URLs 
effectively adding a default version to every request, which is the oldest 
supported one. What this means is that users working against unversioned URLs 
will for the time being always work against version 1, even when new versions 
are added.

## Brief change log

* [hotfix] Update error handling for `*FileServerHandlers` to be in-line with 
other handlers

* added `RestAPIVersion` enum
* added `RestHandlerSpecification#getSupportedAPIVersions`
* `RestClient#sendRequest` now accepts an optional `RestAPIVersion` argument; 
default is latest supported version

`RestServerEndpoint`:
* modified sorting logic so that newer versions are registered first, to ensure 
that the oldest version is the default (since they override previous 
registrations)
* additionally register handlers for versioned URLs

* updated the `RestAPIDocsGenerator` to create separate tables for each version
* updated REST documentation to include information about versioning
* reworked REST API docs layout to better separate versioned and legacy APIs

![untitled](https://user-images.githubusercontent.com/5725237/44462438-e0732780-a614-11e8-96c0-b49244bb68e8.png)

## Verifying this change

This change added tests and can be verified as follows:

* RestServerEndpointITCase#testVersioning
* RestAPIVersionTest



[ Full content available at: https://github.com/apache/flink/pull/6602 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to