...
ID | IEP-87 | ||||||||
Author | |||||||||
Sponsor | |||||||||
Created |
| ||||||||
Status |
|
Table of Contents |
---|
...
any other module that wants to expose an enpoint:
...
Info | ||
---|---|---|
| ||
Note that an Open API spec has a version field itself. This field is the specification file version but not the API version. The minor value should be incremented when any backward compatible change is introduced. The major value should be incremented when the breaking change is introduced. |
Example of API evolution:
/api/v1
. API version 1, openapi.yaml#version: 1.0./api/v1
. API version 1, openapi.yaml#version: 1.1/api/v1
, so introduce /api/v2.
API version 2, openapi-v2.yaml#version: 2.0, openapi.yaml#version: 1.1....
"build time" means that the micronaut annotation processor will discover classes annotated with io.micronaut.http.annotation.Controller
and register them as request handlers at server bootstrap.
This is done by default but it is always possible to register request handlers at runtime.
Here is a discussion about adding 3rd party dependencies (micronaut and swagger). The main advantages of micronaut:
The last point is important. Ignite 3 will definitely need to implement security protocols and strategies. Micronaut already has implementations for the most popular ones (OAuth2/OpenID, LDAP, etc), they are tested in production by a community and have a little chance to introduce a vulnerability to the server compering with our own implementation. All these standards are going to be implemented in Ignite 3.
Code Block | ||||
---|---|---|---|---|
| ||||
@OpenAPIDefinition( info = @Info( title = "Ignite REST module", version = "3.0.0-alpha", license = @License(name = "Apache 2.0", url = "https://ignite.apache.org"), contact = @Contact(email = "dev@ignite.apache.org") ) ) @OpenAPIInclude(classes = {ClusterConfigurationController.class, NodeConfigurationController.class}) // include to openapi specification public class RestComponent implements IgniteComponent { // ... public RestComponent(List<MicronautFactory> micronautFactories, RestConfiguration restConfiguration) { // register all factories in micronaut context } @Override public void start() { // start REST server } |
...
Method | Path | Parameters | Description |
---|---|---|---|
GET | /management/v1/configuration/node/ | Return node configuration in HOCON format | |
GET | /management/v1/configuration/node/{configPath} |
| Return node configuration subtree in HOCON format specified with configPath parameter. |
PATCH | /management/v1/configuration/node/ |
| Update Patch node configuration with a given body. |
GET | /management/v1/configuration/cluster/ | Return cluster configuration in HOCON format. | |
GET | /management/v1/configuration/cluster/{configPath} |
| Return cluster configuration subtree in HOCON format specified with configPath parameter. |
PATCH | /management/v1/configuration/cluster/ |
| Update Patch cluster configuration with a given body. |
...
Method | Path | Parameters | Description |
---|---|---|---|
POST | /management/v1/cluster/init/ |
| Initialize cluster |
...
Method | Path | Parameters | Description |
---|---|---|---|
GET | /management/v1/topology/physical | Return physical cluster topology information(consistent ID, ID, address, status). |
Method | Path | Parameters | Description |
---|---|---|---|
GET | /management/v1/topology/logical | Return logical cluster topology information(consistent ID, ID, address, status). |
Provide the build version for the node.
Method | Path | Parameters | Description |
---|---|---|---|
GET | /management/v1/node/version/ | Return node build version in semver format. |
...