Skip to content
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

Introduce stability description to the REST API specification #38413

Merged
merged 17 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"scripts_painless_context": {
"stability": "experimental",
"methods": ["GET"],
"url": {
"paths": ["/_scripts/painless/_context"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.example": {
"documentation": "",
"stability" : "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/example"],
Expand Down
21 changes: 21 additions & 0 deletions rest-api-spec/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Example for the ["Create Index"](http://www.elastic.co/guide/en/elasticsearch/re
{
"indices.create": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html",
"stability": "stable",
"methods": ["PUT", "POST"],
"url": {
"paths": ["/{index}"],
Expand Down Expand Up @@ -38,10 +39,30 @@ The specification contains:

* The _name_ of the API (`indices.create`), which usually corresponds to the client calls
* Link to the documentation at <http://elastic.co>
* `stability` indicating the state of the API, has to be declared explicitly or YAML tests will fail
* `experimental` highly likely to break in the near future (minor/path), no bwc guarantees.
Possibly removed in the future.
* `beta` less likely to break or be removed but still reserve the right to do so
* `stable` No backwards breaking changes in a minor
* List of HTTP methods for the endpoint
* URL specification: path, parts, parameters
* Whether body is allowed for the endpoint or not and its description

**NOTE**
If an API is stable but it response should be treated as an arbitrary map of key values please notate this as followed

```json
{
"api.name": {
"stability" : "stable",
"response": {
"treat_json_as_key_value" : true
}
}
}
```


The `methods` and `url.paths` elements list all possible HTTP methods and URLs for the endpoint;
it is the responsibility of the developer to use this information for a sensible API on the target platform.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"bulk": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html",
"stability": "stable",
"methods": ["POST", "PUT"],
"url": {
"paths": ["/_bulk", "/{index}/_bulk", "/{index}/{type}/_bulk"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.aliases": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/aliases", "/_cat/aliases/{name}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.allocation": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/allocation", "/_cat/allocation/{node_id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.count": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/count", "/_cat/count/{index}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.fielddata": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/fielddata", "/_cat/fielddata/{fields}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.health": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/health"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.help": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.indices": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/indices", "/_cat/indices/{index}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.master": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/master"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.nodeattrs": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/nodeattrs"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.nodes": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/nodes"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.pending_tasks": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/pending_tasks"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.plugins": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/plugins"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.recovery": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/recovery", "/_cat/recovery/{index}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.repositories": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/repositories"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.segments": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/segments", "/_cat/segments/{index}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.shards": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/shards", "/_cat/shards/{index}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.snapshots": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.tasks": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/tasks"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.templates": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/templates", "/_cat/templates/{name}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.thread_pool": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cat/thread_pool","/_cat/thread_pool/{thread_pool_patterns}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"clear_scroll": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html",
"stability": "stable",
"methods": ["DELETE"],
"url": {
"paths": [ "/_search/scroll"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.allocation_explain": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html",
"stability": "stable",
"methods": ["GET", "POST"],
"url": {
"paths": ["/_cluster/allocation/explain"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.get_settings": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cluster/settings"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.health": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cluster/health", "/_cluster/health/{index}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.pending_tasks": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cluster/pending_tasks"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.put_settings": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html",
"stability": "stable",
"methods": ["PUT"],
"url": {
"paths": ["/_cluster/settings"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.remote_info": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_remote/info"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.reroute": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html",
"stability": "stable",
"methods": ["POST"],
"url": {
"paths": ["/_cluster/reroute"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.state": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html",
"stability" : "stable",
"methods": ["GET"],
"url": {
"paths": [
Expand Down Expand Up @@ -56,6 +57,9 @@
}
}
},
"body": null
"body": null,
"response": {
"treat_json_as_key_value" : true
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster.stats": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html",
"stability": "stable",
"methods": ["GET"],
"url": {
"paths": ["/_cluster/stats", "/_cluster/stats/nodes/{node_id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"count": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html",
"stability": "stable",
"methods": ["POST", "GET"],
"url": {
"paths": ["/_count", "/{index}/_count"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"create": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html",
"stability": "stable",
"methods": ["PUT","POST"],
"url": {
"paths": ["/{index}/_create/{id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"delete": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html",
"stability": "stable",
"methods": ["DELETE"],
"url": {
"paths": ["/{index}/_doc/{id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"delete_by_query": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html",
"stability": "stable",
"methods": ["POST"],
"url": {
"paths": ["/{index}/_delete_by_query"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"delete_by_query_rethrottle": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html",
"stability": "stable",
"methods": ["POST"],
"url": {
"paths": ["/_delete_by_query/{task_id}/_rethrottle"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"delete_script": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html",
"stability": "stable",
"methods": ["DELETE"],
"url": {
"paths": [ "/_scripts/{id}" ],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"exists": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html",
"stability": "stable",
"methods": ["HEAD"],
"url": {
"paths": ["/{index}/_doc/{id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"exists_source": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html",
"stability": "stable",
"methods": ["HEAD"],
"url": {
"paths": ["/{index}/_source/{id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"explain": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html",
"stability": "stable",
"methods": ["GET", "POST"],
"url": {
"paths": ["/{index}/_explain/{id}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"field_caps": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html",
"stability": "stable",
"methods": ["GET", "POST"],
"url": {
"paths": [
Expand Down
Loading