From ce990f2abd2b23c1f382242a90eff5b60f856f56 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 22 Jul 2019 16:55:07 +0200 Subject: [PATCH 1/2] Update the REST API specification This patch updates the REST API spefication in JSON files to better encode deprecated entities, to improve specification of URL paths, and to open up the schema for future extensions. Notably, it changes the `paths` from a list of strings to a list of objects, where each particular object encodes all the information for this particular path: the `parts` and the `methods`. Among the benefits of this approach is eg. encoding the difference between using the `PUT` and `POST` methods in the Index API, to either use a specific document ID, or let Elasticsearch generate one. Also `documentation` becomes an object that supports an `url` and also a `description` which is a new field. --- .../rest-api-spec/api/cat.example.json | 14 +- rest-api-spec/README.markdown | 101 +++-- .../resources/rest-api-spec/api/bulk.json | 144 +++--- .../rest-api-spec/api/cat.aliases.json | 100 +++-- .../rest-api-spec/api/cat.allocation.json | 122 +++-- .../rest-api-spec/api/cat.count.json | 100 +++-- .../rest-api-spec/api/cat.fielddata.json | 130 +++--- .../rest-api-spec/api/cat.health.json | 96 ++-- .../resources/rest-api-spec/api/cat.help.json | 44 +- .../rest-api-spec/api/cat.indices.json | 151 ++++--- .../rest-api-spec/api/cat.master.json | 86 ++-- .../rest-api-spec/api/cat.nodeattrs.json | 86 ++-- .../rest-api-spec/api/cat.nodes.json | 94 ++-- .../rest-api-spec/api/cat.pending_tasks.json | 86 ++-- .../rest-api-spec/api/cat.plugins.json | 84 ++-- .../rest-api-spec/api/cat.recovery.json | 114 +++-- .../rest-api-spec/api/cat.repositories.json | 88 ++-- .../rest-api-spec/api/cat.segments.json | 106 +++-- .../rest-api-spec/api/cat.shards.json | 122 +++-- .../rest-api-spec/api/cat.snapshots.json | 104 +++-- .../rest-api-spec/api/cat.tasks.json | 102 +++-- .../rest-api-spec/api/cat.templates.json | 100 +++-- .../rest-api-spec/api/cat.thread_pool.json | 117 +++-- .../rest-api-spec/api/clear_scroll.json | 53 ++- .../api/cluster.allocation_explain.json | 43 +- .../api/cluster.get_settings.json | 59 +-- .../rest-api-spec/api/cluster.health.json | 162 ++++--- .../api/cluster.pending_tasks.json | 42 +- .../api/cluster.put_settings.json | 52 ++- .../api/cluster.remote_info.json | 24 +- .../rest-api-spec/api/cluster.reroute.json | 85 ++-- .../rest-api-spec/api/cluster.state.json | 157 ++++--- .../rest-api-spec/api/cluster.stats.json | 56 ++- .../resources/rest-api-spec/api/count.json | 173 ++++---- .../resources/rest-api-spec/api/create.json | 150 ++++--- .../resources/rest-api-spec/api/delete.json | 153 ++++--- .../rest-api-spec/api/delete_by_query.json | 335 +++++++------- .../api/delete_by_query_rethrottle.json | 47 +- .../rest-api-spec/api/delete_script.json | 51 ++- .../resources/rest-api-spec/api/exists.json | 163 ++++--- .../rest-api-spec/api/exists_source.json | 157 ++++--- .../resources/rest-api-spec/api/explain.json | 182 ++++---- .../rest-api-spec/api/field_caps.json | 98 ++-- .../main/resources/rest-api-spec/api/get.json | 163 ++++--- .../rest-api-spec/api/get_script.json | 47 +- .../rest-api-spec/api/get_source.json | 157 ++++--- .../resources/rest-api-spec/api/index.json | 212 ++++++--- .../rest-api-spec/api/indices.analyze.json | 53 ++- .../api/indices.clear_cache.json | 113 +++-- .../rest-api-spec/api/indices.clone.json | 62 +-- .../rest-api-spec/api/indices.close.json | 92 ++-- .../rest-api-spec/api/indices.create.json | 68 +-- .../rest-api-spec/api/indices.delete.json | 84 ++-- .../api/indices.delete_alias.json | 74 +-- .../api/indices.delete_template.json | 51 ++- .../rest-api-spec/api/indices.exists.json | 94 ++-- .../api/indices.exists_alias.json | 94 ++-- .../api/indices.exists_template.json | 59 +-- .../api/indices.exists_type.json | 87 ++-- .../rest-api-spec/api/indices.flush.json | 91 ++-- .../api/indices.flush_synced.json | 81 ++-- .../rest-api-spec/api/indices.forcemerge.json | 97 ++-- .../rest-api-spec/api/indices.get.json | 106 +++-- .../rest-api-spec/api/indices.get_alias.json | 109 +++-- .../api/indices.get_field_mapping.json | 164 ++++--- .../api/indices.get_mapping.json | 143 +++--- .../api/indices.get_settings.json | 138 ++++-- .../api/indices.get_template.json | 76 ++-- .../api/indices.get_upgrade.json | 73 +-- .../rest-api-spec/api/indices.open.json | 92 ++-- .../rest-api-spec/api/indices.put_alias.json | 79 ++-- .../api/indices.put_mapping.json | 249 ++++++++--- .../api/indices.put_settings.json | 108 +++-- .../api/indices.put_template.json | 89 ++-- .../rest-api-spec/api/indices.recovery.json | 66 +-- .../rest-api-spec/api/indices.refresh.json | 75 ++-- .../rest-api-spec/api/indices.rollover.json | 95 ++-- .../rest-api-spec/api/indices.segments.json | 83 ++-- .../api/indices.shard_stores.json | 88 ++-- .../rest-api-spec/api/indices.shrink.json | 70 +-- .../rest-api-spec/api/indices.split.json | 70 +-- .../rest-api-spec/api/indices.stats.json | 213 ++++++--- .../api/indices.update_aliases.json | 45 +- .../rest-api-spec/api/indices.upgrade.json | 89 ++-- .../api/indices.validate_query.json | 184 +++++--- .../resources/rest-api-spec/api/info.json | 27 +- .../api/ingest.delete_pipeline.json | 51 ++- .../api/ingest.get_pipeline.json | 50 ++- .../api/ingest.processor_grok.json | 27 +- .../api/ingest.put_pipeline.json | 56 ++- .../rest-api-spec/api/ingest.simulate.json | 60 ++- .../resources/rest-api-spec/api/mget.json | 138 +++--- .../resources/rest-api-spec/api/msearch.json | 118 +++-- .../rest-api-spec/api/msearch_template.json | 98 ++-- .../rest-api-spec/api/mtermvectors.json | 179 ++++---- .../rest-api-spec/api/nodes.hot_threads.json | 183 +++++--- .../rest-api-spec/api/nodes.info.json | 109 +++-- .../api/nodes.reload_secure_settings.json | 50 ++- .../rest-api-spec/api/nodes.stats.json | 275 +++++++++--- .../rest-api-spec/api/nodes.usage.json | 96 ++-- .../resources/rest-api-spec/api/ping.json | 27 +- .../rest-api-spec/api/put_script.json | 82 ++-- .../rest-api-spec/api/rank_eval.json | 82 ++-- .../resources/rest-api-spec/api/reindex.json | 102 +++-- .../rest-api-spec/api/reindex_rethrottle.json | 47 +- .../api/render_search_template.json | 43 +- .../api/scripts_painless_execute.json | 31 +- .../resources/rest-api-spec/api/scroll.json | 79 ++-- .../resources/rest-api-spec/api/search.json | 420 ++++++++++-------- .../rest-api-spec/api/search_shards.json | 99 +++-- .../rest-api-spec/api/search_template.json | 169 ++++--- .../rest-api-spec/api/snapshot.create.json | 66 +-- .../api/snapshot.create_repository.json | 63 +-- .../rest-api-spec/api/snapshot.delete.json | 54 ++- .../api/snapshot.delete_repository.json | 51 ++- .../rest-api-spec/api/snapshot.get.json | 68 +-- .../api/snapshot.get_repository.json | 56 ++- .../rest-api-spec/api/snapshot.restore.json | 65 +-- .../rest-api-spec/api/snapshot.status.json | 74 ++- .../api/snapshot.verify_repository.json | 55 ++- .../rest-api-spec/api/tasks.cancel.json | 64 +-- .../rest-api-spec/api/tasks.get.json | 51 ++- .../rest-api-spec/api/tasks.list.json | 90 ++-- .../rest-api-spec/api/termvectors.json | 183 ++++---- .../resources/rest-api-spec/api/update.json | 173 +++++--- .../rest-api-spec/api/update_by_query.json | 349 ++++++++------- .../api/update_by_query_rethrottle.json | 47 +- .../api/ccr.delete_auto_follow_pattern.json | 31 +- .../rest-api-spec/api/ccr.follow.json | 49 +- .../rest-api-spec/api/ccr.follow_info.json | 30 +- .../rest-api-spec/api/ccr.follow_stats.json | 31 +- .../api/ccr.forget_follower.json | 37 +- .../api/ccr.get_auto_follow_pattern.json | 36 +- .../rest-api-spec/api/ccr.pause_follow.json | 31 +- .../api/ccr.put_auto_follow_pattern.json | 37 +- .../rest-api-spec/api/ccr.resume_follow.json | 37 +- .../rest-api-spec/api/ccr.stats.json | 22 +- .../rest-api-spec/api/ccr.unfollow.json | 31 +- ...ata_frame.delete_data_frame_transform.json | 48 +- .../data_frame.get_data_frame_transform.json | 70 +-- ..._frame.get_data_frame_transform_stats.json | 64 +-- ...ta_frame.preview_data_frame_transform.json | 26 +- .../data_frame.put_data_frame_transform.json | 44 +- ...data_frame.start_data_frame_transform.json | 46 +- .../data_frame.stop_data_frame_transform.json | 64 +-- .../rest-api-spec/api/graph.explore.json | 80 ++-- .../api/ilm.delete_lifecycle.json | 34 +- .../api/ilm.explain_lifecycle.json | 42 +- .../rest-api-spec/api/ilm.get_lifecycle.json | 40 +- .../rest-api-spec/api/ilm.get_status.json | 24 +- .../rest-api-spec/api/ilm.move_to_step.json | 38 +- .../rest-api-spec/api/ilm.put_lifecycle.json | 37 +- .../rest-api-spec/api/ilm.remove_policy.json | 34 +- .../rest-api-spec/api/ilm.retry.json | 34 +- .../rest-api-spec/api/ilm.start.json | 24 +- .../resources/rest-api-spec/api/ilm.stop.json | 24 +- .../rest-api-spec/api/indices.freeze.json | 93 ++-- .../api/indices.reload_search_analyzers.json | 71 +-- .../rest-api-spec/api/indices.unfreeze.json | 91 ++-- .../rest-api-spec/api/license.delete.json | 22 +- .../rest-api-spec/api/license.get.json | 33 +- .../api/license.get_basic_status.json | 28 +- .../api/license.get_trial_status.json | 28 +- .../rest-api-spec/api/license.post.json | 35 +- .../api/license.post_start_basic.json | 33 +- .../api/license.post_start_trial.json | 41 +- .../api/migration.deprecations.json | 40 +- .../rest-api-spec/api/ml.close_job.json | 65 +-- .../rest-api-spec/api/ml.delete_calendar.json | 33 +- .../api/ml.delete_calendar_event.json | 42 +- .../api/ml.delete_calendar_job.json | 42 +- .../api/ml.delete_data_frame_analytics.json | 35 +- .../rest-api-spec/api/ml.delete_datafeed.json | 46 +- .../api/ml.delete_expired_data.json | 21 +- .../rest-api-spec/api/ml.delete_filter.json | 33 +- .../rest-api-spec/api/ml.delete_forecast.json | 76 ++-- .../rest-api-spec/api/ml.delete_job.json | 54 ++- .../api/ml.delete_model_snapshot.json | 43 +- .../api/ml.evaluate_data_frame.json | 28 +- .../api/ml.find_file_structure.json | 155 ++++--- .../rest-api-spec/api/ml.flush_job.json | 77 ++-- .../rest-api-spec/api/ml.forecast.json | 53 ++- .../rest-api-spec/api/ml.get_buckets.json | 130 +++--- .../api/ml.get_calendar_events.json | 75 ++-- .../rest-api-spec/api/ml.get_calendars.json | 60 ++- .../rest-api-spec/api/ml.get_categories.json | 74 +-- .../api/ml.get_data_frame_analytics.json | 75 ++-- .../ml.get_data_frame_analytics_stats.json | 75 ++-- .../api/ml.get_datafeed_stats.json | 54 ++- .../rest-api-spec/api/ml.get_datafeeds.json | 54 ++- .../rest-api-spec/api/ml.get_filters.json | 54 ++- .../rest-api-spec/api/ml.get_influencers.json | 98 ++-- .../rest-api-spec/api/ml.get_job_stats.json | 54 ++- .../rest-api-spec/api/ml.get_jobs.json | 54 ++- .../api/ml.get_model_snapshots.json | 106 +++-- .../api/ml.get_overall_buckets.json | 94 ++-- .../rest-api-spec/api/ml.get_records.json | 98 ++-- .../resources/rest-api-spec/api/ml.info.json | 21 +- .../rest-api-spec/api/ml.open_job.json | 42 +- .../api/ml.post_calendar_events.json | 36 +- .../rest-api-spec/api/ml.post_data.json | 55 ++- .../api/ml.preview_datafeed.json | 34 +- .../rest-api-spec/api/ml.put_calendar.json | 36 +- .../api/ml.put_calendar_job.json | 42 +- .../api/ml.put_data_frame_analytics.json | 38 +- .../rest-api-spec/api/ml.put_datafeed.json | 37 +- .../rest-api-spec/api/ml.put_filter.json | 36 +- .../rest-api-spec/api/ml.put_job.json | 37 +- .../api/ml.revert_model_snapshot.json | 54 ++- .../api/ml.set_upgrade_mode.json | 39 +- .../api/ml.start_data_frame_analytics.json | 48 +- .../rest-api-spec/api/ml.start_datafeed.json | 65 +-- .../api/ml.stop_data_frame_analytics.json | 66 +-- .../rest-api-spec/api/ml.stop_datafeed.json | 64 +-- .../rest-api-spec/api/ml.update_datafeed.json | 37 +- .../rest-api-spec/api/ml.update_filter.json | 36 +- .../rest-api-spec/api/ml.update_job.json | 37 +- .../api/ml.update_model_snapshot.json | 48 +- .../rest-api-spec/api/ml.validate.json | 27 +- .../api/ml.validate_detector.json | 27 +- .../rest-api-spec/api/monitoring.bulk.json | 80 ++-- .../rest-api-spec/api/rollup.delete_job.json | 31 +- .../rest-api-spec/api/rollup.get_jobs.json | 37 +- .../api/rollup.get_rollup_caps.json | 37 +- .../api/rollup.get_rollup_index_caps.json | 31 +- .../rest-api-spec/api/rollup.put_job.json | 37 +- .../api/rollup.rollup_search.json | 87 ++-- .../rest-api-spec/api/rollup.start_job.json | 31 +- .../rest-api-spec/api/rollup.stop_job.json | 51 ++- .../api/security.authenticate.json | 26 +- .../api/security.change_password.json | 64 ++- .../api/security.clear_cached_realms.json | 48 +- .../api/security.clear_cached_roles.json | 36 +- .../api/security.create_api_key.json | 42 +- .../api/security.delete_privileges.json | 61 +-- .../api/security.delete_role.json | 52 ++- .../api/security.delete_role_mapping.json | 52 ++- .../api/security.delete_user.json | 52 ++- .../api/security.disable_user.json | 53 ++- .../api/security.enable_user.json | 53 ++- .../api/security.get_api_key.json | 56 +-- .../api/security.get_builtin_privileges.json | 26 +- .../api/security.get_privileges.json | 63 ++- .../rest-api-spec/api/security.get_role.json | 43 +- .../api/security.get_role_mapping.json | 43 +- .../rest-api-spec/api/security.get_token.json | 31 +- .../rest-api-spec/api/security.get_user.json | 43 +- .../api/security.get_user_privileges.json | 26 +- .../api/security.has_privileges.json | 50 ++- .../api/security.invalidate_api_key.json | 27 +- .../api/security.invalidate_token.json | 31 +- .../api/security.put_privileges.json | 47 +- .../rest-api-spec/api/security.put_role.json | 56 ++- .../api/security.put_role_mapping.json | 56 ++- .../rest-api-spec/api/security.put_user.json | 56 ++- .../api/slm.delete_lifecycle.json | 29 +- .../api/slm.execute_lifecycle.json | 35 +- .../rest-api-spec/api/slm.get_lifecycle.json | 41 +- .../rest-api-spec/api/slm.put_lifecycle.json | 38 +- .../rest-api-spec/api/sql.clear_cursor.json | 27 +- .../rest-api-spec/api/sql.query.json | 40 +- .../rest-api-spec/api/sql.translate.json | 34 +- .../rest-api-spec/api/ssl.certificates.json | 26 +- .../rest-api-spec/api/watcher.ack_watch.json | 54 ++- .../api/watcher.activate_watch.json | 35 +- .../api/watcher.deactivate_watch.json | 35 +- .../api/watcher.delete_watch.json | 34 +- .../api/watcher.execute_watch.json | 56 ++- .../rest-api-spec/api/watcher.get_watch.json | 35 +- .../rest-api-spec/api/watcher.put_watch.json | 70 +-- .../rest-api-spec/api/watcher.start.json | 26 +- .../rest-api-spec/api/watcher.stats.json | 71 ++- .../rest-api-spec/api/watcher.stop.json | 26 +- .../rest-api-spec/api/xpack.info.json | 32 +- .../rest-api-spec/api/xpack.usage.json | 32 +- 275 files changed, 11864 insertions(+), 8130 deletions(-) diff --git a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json b/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json index 2aa5edd4d5ae1..d293db804f625 100644 --- a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json +++ b/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json @@ -1,11 +1,17 @@ { "cat.example": { - "documentation": "", + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html", + "description": "Example" + }, "stability" : "stable", - "methods": ["GET"], "url": { - "paths": ["/_cat/example"], - "parts": {}, + "paths": [ + { + "path" : "/_cat/example", + "methods" : ["GET"] + } + ], "params": { "help": { "type": "boolean", diff --git a/rest-api-spec/README.markdown b/rest-api-spec/README.markdown index 241433d8c5cc4..8092546fd5a30 100644 --- a/rest-api-spec/README.markdown +++ b/rest-api-spec/README.markdown @@ -9,23 +9,28 @@ Example for the ["Create Index"](http://www.elastic.co/guide/en/elasticsearch/re ```json { "indices.create": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html", + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html" + }, "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/{index}"], - "parts": { - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" - } - }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + "url":{ + "paths":[ + { + "path":"/{index}", + "method":"PUT", + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } } + ] + }, + "params": { + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" } }, "body": { @@ -38,17 +43,17 @@ Example for the ["Create Index"](http://www.elastic.co/guide/en/elasticsearch/re The specification contains: * The _name_ of the API (`indices.create`), which usually corresponds to the client calls -* Link to the documentation at +* Link to the documentation at the website * `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. + * `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 + * `stable` No backwards breaking changes in a minor +* Request URL: HTTP method, path and parts +* Request parameters +* Request body specification -**NOTE** +**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 @@ -62,28 +67,23 @@ If an API is stable but it response should be treated as an arbitrary map of key } ``` +## Backwards compatibility -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. - -## Backwards compatibility +The specification follows the same backward compatibility guarantees as Elasticsearch. -The specification follows the same backward compatibility guarantees as Elasticsearch. - -- Within a Major, additions only. - - If an item has been documented wrong it should be deprecated instead as removing these might break downstream clients. +- Within a Major, additions only. +- If an item has been documented wrong it should be deprecated instead as removing these might break downstream clients. - Major version change, may deprecate pieces or simply remove them given enough deprecation time. ## Deprecations -The spec allows for deprecations of: +The specification schema allows to codify API deprecations, either for an entire API, or for specific parts of the API, such as paths or parameters. #### Entire API: ```json { "api" : { - "documentation": "...", "deprecated" : { "version" : "7.0.0", "description" : "Reason API is being deprecated" @@ -92,19 +92,35 @@ The spec allows for deprecations of: } ``` -#### Specific paths: +#### Specific paths and their parts: ```json { "api": { - "documentation": "", "url": { - "paths": ["/_monitoring/bulk"], - "deprecated_paths" : [ + "paths": [ { - "version" : "7.0.0", - "path" : "/_monitoring/{type}/bulk", - "description" : "Specifying types in urls has been deprecated" + "path":"/{index}/{type}/{id}/_create", + "method":"PUT", + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } ] } @@ -112,16 +128,11 @@ The spec allows for deprecations of: } ``` -Here `paths` describes the preferred paths and `deprecated_paths` indicates `paths` that will still work but are now -deprecated. - -#### Parameters +#### Parameters ```json { "api": { - "documentation": "", - "methods": ["GET"], "url": { "params": { "stored_fields": { diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json b/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json index 054e182b0ba9e..b235868a2c433 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json @@ -1,64 +1,98 @@ { - "bulk": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html", - "stability": "stable", - "methods": ["POST", "PUT"], - "url": { - "paths": ["/_bulk", "/{index}/_bulk", "/{index}/{type}/_bulk"], - "parts": { - "index": { - "type" : "string", - "description" : "Default index for items which don't provide one" - }, - "type": { - "type" : "string", - "description" : "Default document type for items which don't provide one" - } - }, - "params": { - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "type": { - "type" : "string", - "description" : "Default document type for items which don't provide one" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request" - }, - "_source_excludes": { - "type" : "list", - "description" : "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" + "bulk":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html", + "description":"Allows to perform multiple index/update/delete operations in a single request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_bulk", + "methods":[ + "POST", + "PUT" + ] }, - "_source_includes": { - "type" : "list", - "description" : "Default list of fields to extract and return from the _source field, can be overridden on each sub-request" + { + "path":"/{index}/_bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Default index for items which don't provide one" + } + } }, - "pipeline" : { - "type" : "string", - "description" : "The pipeline id to preprocess incoming documents with" + { + "path":"/{index}/{type}/_bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Default index for items which don't provide one" + }, + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one" + } + } } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request" + }, + "_source_excludes":{ + "type":"list", + "description":"Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" + }, + "_source_includes":{ + "type":"list", + "description":"Default list of fields to extract and return from the _source field, can be overridden on each sub-request" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" } }, - "body": { - "description" : "The operation definition and data (action-data pairs), separated by newlines", - "required" : true, - "serialize" : "bulk" + "body":{ + "description":"The operation definition and data (action-data pairs), separated by newlines", + "required":true, + "serialize":"bulk" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.aliases.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.aliases.json index a1e7a57395852..0f49d3a8b74bc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.aliases.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.aliases.json @@ -1,49 +1,63 @@ { - "cat.aliases": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/aliases", "/_cat/aliases/{name}"], - "parts": { - "name": { - "type" : "list", - "description" : "A comma-separated list of alias names to return" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.aliases":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html", + "description":"Shows information about currently configured aliases to indices including filter and routing infos." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/aliases", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/aliases/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json index 45d4a289e251d..7b3dc70b03c38 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json @@ -1,54 +1,80 @@ { - "cat.allocation": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/allocation", "/_cat/allocation/{node_id}"], - "parts": { - "node_id": { - "type": "list", - "description": "A comma-separated list of node IDs or names to limit the returned information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "bytes": { - "type": "enum", - "description" : "The unit in which to display byte values", - "options": [ "b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb" ] - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.allocation":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html", + "description":"Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/allocation", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/allocation/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.count.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.count.json index 43dd51ce5d993..807e108e78863 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.count.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.count.json @@ -1,49 +1,63 @@ { - "cat.count": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/count", "/_cat/count/{index}"], - "parts": { - "index": { - "type" : "list", - "description": "A comma-separated list of index names to limit the returned information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.count":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html", + "description":"Provides quick access to the document count of the entire cluster, or individual indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/count", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/count/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.fielddata.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.fielddata.json index b623354ccc03e..a3d05537f8183 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.fielddata.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.fielddata.json @@ -1,58 +1,84 @@ { - "cat.fielddata": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/fielddata", "/_cat/fielddata/{fields}"], - "parts": { - "fields": { - "type": "list", - "description": "A comma-separated list of fields to return the fielddata size" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "bytes": { - "type": "enum", - "description" : "The unit in which to display byte values", - "options": [ "b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb" ] - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.fielddata":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html", + "description":"Shows how much heap memory is currently being used by fielddata on every data node in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/fielddata", + "methods":[ + "GET" + ] }, - "fields": { - "type": "list", - "description": "A comma-separated list of fields to return in the output" + { + "path":"/_cat/fielddata/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return the fielddata size" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return in the output" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.health.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.health.json index efc7e100ff0f8..e7989ef5f96fc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.health.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.health.json @@ -1,50 +1,56 @@ { - "cat.health": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/health"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "ts": { - "type": "boolean", - "description": "Set to false to disable timestamping", - "default": true - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.health":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html", + "description":"Returns a concise representation of the cluster health." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/health", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "ts":{ + "type":"boolean", + "description":"Set to false to disable timestamping", + "default":true + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.help.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.help.json index 3393f31981f5c..54ab6d6e5168c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.help.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.help.json @@ -1,24 +1,30 @@ { - "cat.help": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat"], - "parts": { - }, - "params": { - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.help":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html", + "description":"Returns help for the Cat APIs." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json index 726902c4f56c0..f4aa15344c5e1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json @@ -1,70 +1,93 @@ { - "cat.indices": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/indices", "/_cat/indices/{index}"], - "parts": { - "index": { - "type" : "list", - "description": "A comma-separated list of index names to limit the returned information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "bytes": { - "type": "enum", - "description" : "The unit in which to display byte values", - "options": [ "b", "k", "m", "g" ] - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "health": { - "type" : "enum", - "options" : ["green","yellow","red"], - "default" : null, - "description" : "A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "pri" : { - "type": "boolean", - "description": "Set to true to return stats only for primary shards", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.indices":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html", + "description":"Returns information about indices: number of primaries and replicas, document counts, disk size, ..." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/indices", + "methods":[ + "GET" + ] }, - "include_unloaded_segments": { - "type": "boolean", - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory", - "default": false + { + "path":"/_cat/indices/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "m", + "g" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "health":{ + "type":"enum", + "options":[ + "green", + "yellow", + "red" + ], + "default":null, + "description":"A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "pri":{ + "type":"boolean", + "description":"Set to true to return stats only for primary shards", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "include_unloaded_segments":{ + "type":"boolean", + "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json index 68903adadb0ed..63fe159ee56b8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json @@ -1,45 +1,51 @@ { - "cat.master": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/master"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.master":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html", + "description":"Returns information about the master node." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/master", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json index d4b084931431e..e688e23cab089 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json @@ -1,45 +1,51 @@ { - "cat.nodeattrs": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/nodeattrs"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.nodeattrs":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html", + "description":"Returns information about custom node attributes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/nodeattrs", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodes.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodes.json index c59c203f19704..10e9aea80fa96 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodes.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodes.json @@ -1,49 +1,55 @@ { - "cat.nodes": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/nodes"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "full_id": { - "type" : "boolean", - "description" : "Return the full node ID instead of the shortened version (default: false)" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.nodes":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html", + "description":"Returns basic statistics about performance of cluster nodes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/nodes", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "full_id":{ + "type":"boolean", + "description":"Return the full node ID instead of the shortened version (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json index 72094f8467630..31de2e00569a3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json @@ -1,45 +1,51 @@ { - "cat.pending_tasks": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/pending_tasks"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.pending_tasks":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html", + "description":"Returns a concise representation of the cluster pending tasks." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/pending_tasks", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json index 97b67a3041866..d5346c6d9e7b4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json @@ -1,43 +1,51 @@ { - "cat.plugins": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/plugins"], - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.plugins":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html", + "description":"Returns information about installed plugins across nodes node." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/plugins", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.recovery.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.recovery.json index b3433436dc9d4..3cd4904438232 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.recovery.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.recovery.json @@ -1,50 +1,76 @@ { - "cat.recovery": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/recovery", "/_cat/recovery/{index}"], - "parts": { - "index": { - "type" : "list", - "description": "A comma-separated list of index names to limit the returned information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "bytes": { - "type": "enum", - "description" : "The unit in which to display byte values", - "options": [ "b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb" ] - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.recovery":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html", + "description":"Returns information about index shard recoveries, both on-going completed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/recovery", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/recovery/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json index d02d4c3a75944..84d9965907ff3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json @@ -1,46 +1,52 @@ { - "cat.repositories": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/repositories"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node", - "default": false - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.repositories":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html", + "description":"Returns information about snapshot repositories registered in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/repositories", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json index e9195471263d1..472ef7fd22eee 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json @@ -1,46 +1,72 @@ { - "cat.segments": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/segments", "/_cat/segments/{index}"], - "parts": { - "index": { - "type" : "list", - "description": "A comma-separated list of index names to limit the returned information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "bytes": { - "type": "enum", - "description" : "The unit in which to display byte values", - "options": [ "b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb" ] - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.segments":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html", + "description":"Provides low-level information about the segments in the shards of an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/segments", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/segments/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json index 1e10d7a7b917e..6315570e4e965 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json @@ -1,54 +1,80 @@ { - "cat.shards": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/shards", "/_cat/shards/{index}"], - "parts": { - "index": { - "type" : "list", - "description": "A comma-separated list of index names to limit the returned information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "bytes": { - "type": "enum", - "description" : "The unit in which to display byte values", - "options": [ "b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb" ] - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.shards":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html", + "description":"Provides a detailed view of shard allocation on nodes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/shards", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/shards/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json index 96d0657bb28cb..e720f53d430a5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json @@ -1,52 +1,64 @@ { - "cat.snapshots": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ - "/_cat/snapshots", - "/_cat/snapshots/{repository}"], - "parts": { - "repository": { - "type" : "list", - "description": "Name of repository from which to fetch the snapshot information" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "ignore_unavailable": { - "type": "boolean", - "description": "Set to true to ignore unavailable snapshots", - "default": false - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.snapshots":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html", + "description":"Returns all snapshots in a specific repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/snapshots", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/snapshots/{repository}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"Name of repository from which to fetch the snapshot information" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Set to true to ignore unavailable snapshots", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.tasks.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.tasks.json index 1c7901db5a35e..20e846ce65114 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.tasks.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.tasks.json @@ -1,53 +1,59 @@ { - "cat.tasks": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/tasks"], - "parts": { - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "node_id": { - "type": "list", - "description": "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions": { - "type": "list", - "description": "A comma-separated list of actions that should be returned. Leave empty to return all." - }, - "detailed": { - "type": "boolean", - "description": "Return detailed task information (default: false)" - }, - "parent_task": { - "type" : "number", - "description" : "Return tasks with specified parent task id. Set to -1 to return all." - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + "cat.tasks":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Returns information about the tasks currently executing on one or more nodes in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/tasks", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be returned. Leave empty to return all." + }, + "detailed":{ + "type":"boolean", + "description":"Return detailed task information (default: false)" + }, + "parent_task":{ + "type":"number", + "description":"Return tasks with specified parent task id. Set to -1 to return all." + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json index cba6a9f1c6117..53fc872b5dae2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json @@ -1,49 +1,63 @@ { - "cat.templates": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cat/templates", "/_cat/templates/{name}"], - "parts": { - "name": { - "type" : "string", - "description" : "A pattern that returned template names must match" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.templates":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html", + "description":"Returns information about existing templates." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/templates", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/templates/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"string", + "description":"A pattern that returned template names must match" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json index 2d0524c7f544c..d2ce7ed665d5a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json @@ -1,54 +1,75 @@ { - "cat.thread_pool": { - "documentation": "https://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}"], - "parts": { - "thread_pool_patterns": { - "type": "list", - "description": "A comma-separated list of regular-expressions to filter the thread pools in the output" - } - }, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - }, - "size": { - "type": "enum", - "description" : "The multiplier in which to display values", - "options": [ "", "k", "m", "g", "t", "p" ] - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "h": { - "type": "list", - "description" : "Comma-separated list of column names to display" - }, - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "s": { - "type": "list", - "description" : "Comma-separated list of column names or column aliases to sort by" + "cat.thread_pool":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html", + "description":"Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/thread_pool", + "methods":[ + "GET" + ] }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": false + { + "path":"/_cat/thread_pool/{thread_pool_patterns}", + "methods":[ + "GET" + ], + "parts":{ + "thread_pool_patterns":{ + "type":"list", + "description":"A comma-separated list of regular-expressions to filter the thread pools in the output" + } + } } - } + ] }, - "body": null + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "size":{ + "type":"enum", + "description":"The multiplier in which to display values", + "options":[ + "", + "k", + "m", + "g", + "t", + "p" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json b/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json index 451b758f51334..fc83866f10eb6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json @@ -1,27 +1,40 @@ { - "clear_scroll": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": [ "/_search/scroll"], - "deprecated_paths" : [ + "clear_scroll":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll", + "description":"Explicitly clears the search context for a scroll." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/_search/scroll/{scroll_id}", - "description" : "A scroll id can be quite large and should be specified as part of the body" - } - ], - "parts": { - "scroll_id": { - "type" : "list", - "description" : "A comma-separated list of scroll IDs to clear" + "path":"/_search/scroll", + "methods":[ + "DELETE" + ] + }, + { + "path":"/_search/scroll/{scroll_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "scroll_id":{ + "type":"list", + "description":"A comma-separated list of scroll IDs to clear", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"A scroll id can be quite large and should be specified as part of the body" + } } - }, - "params": {} + ] }, - "body": { - "description": "A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" + "params":{}, + "body":{ + "description":"A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.allocation_explain.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.allocation_explain.json index 44a1f8b36f76b..e46218a781e1b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.allocation_explain.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.allocation_explain.json @@ -1,24 +1,33 @@ { - "cluster.allocation_explain": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_cluster/allocation/explain"], - "parts": {}, - "params": { - "include_yes_decisions": { - "type": "boolean", - "description": "Return 'YES' decisions in explanation (default: false)" - }, - "include_disk_info": { - "type": "boolean", - "description": "Return information about disk usage and shard sizes (default: false)" + "cluster.allocation_explain":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html", + "description":"Provides explanations for shard allocations in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/allocation/explain", + "methods":[ + "GET", + "POST" + ] } + ] + }, + "params":{ + "include_yes_decisions":{ + "type":"boolean", + "description":"Return 'YES' decisions in explanation (default: false)" + }, + "include_disk_info":{ + "type":"boolean", + "description":"Return information about disk usage and shard sizes (default: false)" } }, - "body": { - "description": "The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" + "body":{ + "description":"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json index 919f38dd45bee..6f91fbbedf5de 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json @@ -1,31 +1,38 @@ { - "cluster.get_settings": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cluster/settings"], - "parts": {}, - "params": { - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "include_defaults": { - "type": "boolean", - "description": "Whether to return all default clusters setting.", - "default": false + "cluster.get_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", + "description":"Returns cluster settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/settings", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default clusters setting.", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json index cb8a362d925fc..7911a8e244218 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json @@ -1,70 +1,104 @@ { - "cluster.health": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cluster/health", "/_cluster/health/{index}"], - "parts": { - "index": { - "type" : "list", - "description" : "Limit the information returned to a specific index" - } - }, - "params": { - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "all", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "level": { - "type" : "enum", - "options" : ["cluster","indices","shards"], - "default" : "cluster", - "description" : "Specify the level of detail for returned information" - }, - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Wait until the specified number of shards is active" - }, - "wait_for_nodes": { - "type" : "string", - "description" : "Wait until the specified number of nodes is available" - }, - "wait_for_events": { - "type" : "enum", - "options" : ["immediate", "urgent", "high", "normal", "low", "languid"], - "description" : "Wait until all currently queued events with the given priority are processed" - }, - "wait_for_no_relocating_shards": { - "type" : "boolean", - "description" : "Whether to wait until there are no relocating shards in the cluster" - }, - "wait_for_no_initializing_shards": { - "type" : "boolean", - "description" : "Whether to wait until there are no initializing shards in the cluster" + "cluster.health":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html", + "description":"Returns basic information about the health of the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/health", + "methods":[ + "GET" + ] }, - "wait_for_status": { - "type" : "enum", - "options" : ["green","yellow","red"], - "default" : null, - "description" : "Wait until cluster is in a specific state" + { + "path":"/_cluster/health/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"Limit the information returned to a specific index" + } + } } - } + ] }, - "body": null + "params":{ + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "level":{ + "type":"enum", + "options":[ + "cluster", + "indices", + "shards" + ], + "default":"cluster", + "description":"Specify the level of detail for returned information" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Wait until the specified number of shards is active" + }, + "wait_for_nodes":{ + "type":"string", + "description":"Wait until the specified number of nodes is available" + }, + "wait_for_events":{ + "type":"enum", + "options":[ + "immediate", + "urgent", + "high", + "normal", + "low", + "languid" + ], + "description":"Wait until all currently queued events with the given priority are processed" + }, + "wait_for_no_relocating_shards":{ + "type":"boolean", + "description":"Whether to wait until there are no relocating shards in the cluster" + }, + "wait_for_no_initializing_shards":{ + "type":"boolean", + "description":"Whether to wait until there are no initializing shards in the cluster" + }, + "wait_for_status":{ + "type":"enum", + "options":[ + "green", + "yellow", + "red" + ], + "default":null, + "description":"Wait until cluster is in a specific state" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json index 479a754c25698..d940adf9aef5d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json @@ -1,23 +1,29 @@ { - "cluster.pending_tasks": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cluster/pending_tasks"], - "parts": { - }, - "params": { - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type": "time", - "description": "Specify timeout for connection to master" + "cluster.pending_tasks":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html", + "description":"Returns a list of any cluster-level changes (e.g. create index, update mapping,\nallocate or fail shard) which have not yet been executed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/pending_tasks", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json index 8b81c73766536..f6b9a0863380e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json @@ -1,29 +1,37 @@ { - "cluster.put_settings": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", - "stability": "stable", - "methods": ["PUT"], - "url": { - "paths": ["/_cluster/settings"], - "parts": {}, - "params": { - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + "cluster.put_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", + "description":"Updates the cluster settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/settings", + "methods":[ + "PUT" + ] } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } }, - "body": { - "description": "The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", - "required" : true + "body":{ + "description":"The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.remote_info.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.remote_info.json index 60ac408a337a4..4eac0b55ce6f1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.remote_info.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.remote_info.json @@ -1,12 +1,20 @@ { - "cluster.remote_info": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_remote/info"], - "params": {} + "cluster.remote_info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html", + "description":"Returns the information about configured remote clusters." }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_remote/info", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json index 057d5cc8cf81f..b0e8054fc9e53 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json @@ -1,42 +1,57 @@ { - "cluster.reroute": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_cluster/reroute"], - "parts": { - }, - "params": { - "dry_run": { - "type" : "boolean", - "description" : "Simulate the operation only and return the resulting state" - }, - "explain": { - "type" : "boolean", - "description" : "Return an explanation of why the commands can or cannot be executed" - }, - "retry_failed": { - "type" : "boolean", - "description" : "Retries allocation of shards that are blocked due to too many subsequent allocation failures" - }, - "metric": { - "type": "list", - "options": ["_all", "blocks", "metadata", "nodes", "routing_table", "master_node", "version"], - "description": "Limit the information returned to the specified metrics. Defaults to all but metadata" - }, - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + "cluster.reroute":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html", + "description":"Allows to manually change the allocation of individual shards in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/reroute", + "methods":[ + "POST" + ] } + ] + }, + "params":{ + "dry_run":{ + "type":"boolean", + "description":"Simulate the operation only and return the resulting state" + }, + "explain":{ + "type":"boolean", + "description":"Return an explanation of why the commands can or cannot be executed" + }, + "retry_failed":{ + "type":"boolean", + "description":"Retries allocation of shards that are blocked due to too many subsequent allocation failures" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics. Defaults to all but metadata" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } }, - "body": { - "description" : "The definition of `commands` to perform (`move`, `cancel`, `allocate`)" + "body":{ + "description":"The definition of `commands` to perform (`move`, `cancel`, `allocate`)" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json index 6dbfbf019d040..d6f0e9ababc6d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json @@ -1,65 +1,108 @@ { - "cluster.state": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html", - "stability" : "stable", - "methods": ["GET"], - "url": { - "paths": [ - "/_cluster/state", - "/_cluster/state/{metric}", - "/_cluster/state/{metric}/{index}" - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "metric" : { - "type" : "list", - "options" : ["_all", "blocks", "metadata", "nodes", "routing_table", "routing_nodes", "master_node", "version"], - "description" : "Limit the information returned to the specified metrics" - } - }, - "params": { - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout": { - "type": "time", - "description": "Specify timeout for connection to master" - }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "wait_for_metadata_version": { - "type": "number", - "description": "Wait for the metadata version to be equal or greater than the specified metadata version" - }, - "wait_for_timeout" : { - "type": "time", - "description": "The maximum time to wait for wait_for_metadata_version before timing out" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" + "cluster.state":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html", + "description":"Returns a comprehensive information about the state of the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/state", + "methods":[ + "GET" + ] }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + { + "path":"/_cluster/state/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics" + } + } }, - "expand_wildcards":{ - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/_cluster/state/{metric}/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics" + } + } } - } + ] }, - "body": null, - "response": { - "treat_json_as_key_value" : true + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "wait_for_metadata_version":{ + "type":"number", + "description":"Wait for the metadata version to be equal or greater than the specified metadata version" + }, + "wait_for_timeout":{ + "type":"time", + "description":"The maximum time to wait for wait_for_metadata_version before timing out" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.stats.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.stats.json index b54fd535eeb49..f36db0979f4f7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.stats.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.stats.json @@ -1,27 +1,41 @@ { - "cluster.stats": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_cluster/stats", "/_cluster/stats/nodes/{node_id}"], - "parts": { - "node_id": { - "type" : "list", - "description" : "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "params": { - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" + "cluster.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html", + "description":"Returns high-level overview of cluster statistics." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/stats", + "methods":[ + "GET" + ] }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + { + "path":"/_cluster/stats/nodes/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } } - } + ] }, - "body": null + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/count.json b/rest-api-spec/src/main/resources/rest-api-spec/api/count.json index 7b290e20b7ff5..4084d3be608a4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/count.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/count.json @@ -1,85 +1,106 @@ { - "count": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html", - "stability": "stable", - "methods": ["POST", "GET"], - "url": { - "paths": ["/_count", "/{index}/_count"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of indices to restrict the results" + "count":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html", + "description":"Returns number of documents matching a query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_count", + "methods":[ + "POST", + "GET" + ] }, - "type": { - "type" : "list", - "description" : "A comma-separated list of types to restrict the results" + { + "path":"/{index}/_count", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to restrict the results" + } + } } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled": { - "type" : "boolean", - "description" : "Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "min_score": { - "type" : "number", - "description" : "Include only documents with a specific `_score` value in the result" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "terminate_after" : { - "type" : "number", - "description" : "The maximum count for each shard, upon reaching which the query execution will terminate early" - } + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "min_score":{ + "type":"number", + "description":"Include only documents with a specific `_score` value in the result" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum count for each shard, upon reaching which the query execution will terminate early" } }, - "body": { - "description" : "A query to restrict the results specified with the Query DSL (optional)" + "body":{ + "description":"A query to restrict the results specified with the Query DSL (optional)" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json index 6796b032898cd..0a96ebf5ecde5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json @@ -1,69 +1,101 @@ { - "create": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", - "stability": "stable", - "methods": ["PUT","POST"], - "url": { - "paths": ["/{index}/_create/{id}"], - "deprecated_paths" : [ + "create":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", + "description":"Creates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}/_create", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "Document ID" - }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "path":"/{index}/_create/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "type": { - "type" : "string", - "description" : "The type of the document" + { + "path":"/{index}/{type}/{id}/_create", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" }, - "params": { - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - }, - "pipeline" : { - "type" : "string", - "description" : "The pipeline id to preprocess incoming documents with" - } + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" } }, - "body": { - "description" : "The document", - "required" : true + "body":{ + "description":"The document", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json index 90134b5ccbdc7..abf9c2d330829 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json @@ -1,70 +1,99 @@ { - "delete": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/{index}/_doc/{id}"], - "deprecated_paths" : [ + "delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html", + "description":"Removes a document from the index." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The document ID" - }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "path":"/{index}/_doc/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "type": { - "type" : "string", - "description" : "The type of the document" + { + "path":"/{index}/{type}/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" }, - "params": { - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "if_seq_no" : { - "type" : "number", - "description" : "only perform the delete operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term" : { - "type" : "number", - "description" : "only perform the delete operation if the last operation that has changed the document has the specified primary term" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - } + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the delete operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the delete operation if the last operation that has changed the document has the specified primary term" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json index d4aadea8b3d80..e326e4312b16e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json @@ -1,165 +1,186 @@ { - "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"], - "comment": "most things below this are just copied from search.json", - "parts": { - "index": { - "required" : true, - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + "delete_by_query":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html", + "description":"Deletes documents matching the provided query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_delete_by_query", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" }, - "params": { - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "from": { - "type" : "number", - "description" : "Starting offset (default: 0)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "conflicts": { - "note": "This is not copied from search", - "type" : "enum", - "options": ["abort", "proceed"], - "default": "abort", - "description" : "What to do when the delete by query hits version conflicts?" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "dfs_query_then_fetch"], - "description" : "Search operation type" - }, - "search_timeout": { - "type" : "time", - "description" : "Explicit timeout for each search request. Defaults to no timeout." - }, - "max_docs": { - "type" : "number", - "description" : "Maximum number of documents to process (default: all documents)" - }, - "sort": { - "type" : "list", - "description" : "A comma-separated list of : pairs" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "terminate_after": { - "type" : "number", - "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats": { - "type" : "list", - "description" : "Specific 'tag' of the request for logging and statistical purposes" - }, - "version": { - "type" : "boolean", - "description" : "Specify whether to return document version as part of a hit" - }, - "request_cache": { - "type" : "boolean", - "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "refresh": { - "type" : "boolean", - "description" : "Should the effected indexes be refreshed?" - }, - "timeout": { - "type" : "time", - "default": "1m", - "description" : "Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "scroll_size": { - "type": "number", - "defaut_value": 100, - "description": "Size on the scroll request powering the delete by query" - }, - "wait_for_completion": { - "type" : "boolean", - "default": true, - "description" : "Should the request should block until the delete by query is complete." - }, - "requests_per_second": { - "type": "number", - "default": 0, - "description": "The throttle for this request in sub-requests per second. -1 means no throttle." - }, - "slices": { - "type": "number", - "default": 1, - "description": "The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." - } + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "conflicts":{ + "note":"This is not copied from search", + "type":"enum", + "options":[ + "abort", + "proceed" + ], + "default":"abort", + "description":"What to do when the delete by query hits version conflicts?" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "search_timeout":{ + "type":"time", + "description":"Explicit timeout for each search request. Defaults to no timeout." + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "refresh":{ + "type":"boolean", + "description":"Should the effected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "scroll_size":{ + "type":"number", + "defaut_value":100, + "description":"Size on the scroll request powering the delete by query" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the delete by query is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle for this request in sub-requests per second. -1 means no throttle." + }, + "slices":{ + "type":"number", + "default":1, + "description":"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." } }, - "body": { - "description": "The search definition using the Query DSL", - "required": true + "body":{ + "description":"The search definition using the Query DSL", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query_rethrottle.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query_rethrottle.json index 1104af560239d..112bfc8a7d2e0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query_rethrottle.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query_rethrottle.json @@ -1,25 +1,32 @@ { - "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"], - "parts": { - "task_id": { - "type": "string", - "required" : true, - "description": "The task id to rethrottle" - } - }, - "params": { - "requests_per_second": { - "type": "number", - "required": true, - "description": "The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + "delete_by_query_rethrottle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html", + "description":"Changes the number of requests per second for a particular Delete By Query operation." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_delete_by_query/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } } - } + ] }, - "body": null + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json index a425f7ffd5b43..b38b97ae57c2e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json @@ -1,28 +1,35 @@ { - "delete_script": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": [ "/_scripts/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Script ID", - "required" : true + "delete_script":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "description":"Deletes a script." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params" : { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json index cfbb11b86beeb..09042376a256b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json @@ -1,77 +1,102 @@ { - "exists": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "stability": "stable", - "methods": ["HEAD"], - "url": { - "paths": ["/{index}/_doc/{id}"], - "deprecated_paths" : [ + "exists":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns information about whether a document exists in an index." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The document ID" - }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "path":"/{index}/_doc/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "type": { - "type" : "string", - "description" : "The type of the document (use `_all` to fetch the first document matching the ID across all types)" + { + "path":"/{index}/{type}/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document (use `_all` to fetch the first document matching the ID across all types)", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" }, - "params": { - "stored_fields": { - "type": "list", - "description" : "A comma-separated list of stored fields to return in the response" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime": { - "type" : "boolean", - "description" : "Specify whether to perform the operation in realtime or search mode" - }, - "refresh": { - "type" : "boolean", - "description" : "Refresh the shard containing the document before performing the operation" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - } + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json index 902a56ae135a0..8008509b45b7b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json @@ -1,74 +1,99 @@ { - "exists_source": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "stability": "stable", - "methods": ["HEAD"], - "url": { - "paths": ["/{index}/_source/{id}"], - "deprecated_paths" : [ + "exists_source":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns information about whether a document source exists in an index." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}/_source", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The document ID" - }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "path":"/{index}/_source/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "type": { - "type" : "string", - "required" : false, - "description" : "The type of the document; deprecated and optional starting with 7.0" + { + "path":"/{index}/{type}/{id}/_source", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "required":false, + "description":"The type of the document; deprecated and optional starting with 7.0", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" }, - "params": { - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime": { - "type" : "boolean", - "description" : "Specify whether to perform the operation in realtime or search mode" - }, - "refresh": { - "type" : "boolean", - "description" : "Refresh the shard containing the document before performing the operation" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - } + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json index d96d61f373bb6..c7c393a6a1cba 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json @@ -1,88 +1,114 @@ { - "explain": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/{index}/_explain/{id}"], - "deprecated_paths" : [ + "explain":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html", + "description":"Returns information about why a specific matches (or doesn't match) a query." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}/_explain", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The document ID" + "path":"/{index}/_explain/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" - }, - "type": { - "type" : "string", - "description" : "The type of the document" + { + "path":"/{index}/{type}/{id}/_explain", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)" }, - "params": { - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)" - }, - "analyzer": { - "type" : "string", - "description" : "The analyzer for the query string query" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The default field for query string query (default: _all)" - }, - "stored_fields": { - "type": "list", - "description" : "A comma-separated list of stored fields to return in the response" - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - } + "analyzer":{ + "type":"string", + "description":"The analyzer for the query string query" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The default field for query string query (default: _all)" + }, + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" } }, - "body": { - "description" : "The query definition using the Query DSL" + "body":{ + "description":"The query definition using the Query DSL" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/field_caps.json b/rest-api-spec/src/main/resources/rest-api-spec/api/field_caps.json index e30471141c22f..eed6f8bf082a2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/field_caps.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/field_caps.json @@ -1,45 +1,63 @@ { - "field_caps": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": [ - "/_field_caps", - "/{index}/_field_caps" - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "fields": { - "type" : "list", - "description" : "A comma-separated list of field names" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + "field_caps":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html", + "description":"Returns the information about the capabilities of fields among multiple indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_field_caps", + "methods":[ + "GET", + "POST" + ] }, - "include_unmapped": { - "type": "boolean", - "default": false, - "description": "Indicates whether unmapped fields should be included in the response." + { + "path":"/{index}/_field_caps", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of field names" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "include_unmapped":{ + "type":"boolean", + "default":false, + "description":"Indicates whether unmapped fields should be included in the response." + } + } } -} \ No newline at end of file +} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json index 495db5ef0049b..0c8d62d6d1d34 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json @@ -1,77 +1,102 @@ { - "get": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/{index}/_doc/{id}"], - "deprecated_paths" : [ + "get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns a document." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The document ID" - }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "path":"/{index}/_doc/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "type": { - "type" : "string", - "description" : "The type of the document (use `_all` to fetch the first document matching the ID across all types)" + { + "path":"/{index}/{type}/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document (use `_all` to fetch the first document matching the ID across all types)", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" }, - "params": { - "stored_fields": { - "type": "list", - "description" : "A comma-separated list of stored fields to return in the response" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime": { - "type" : "boolean", - "description" : "Specify whether to perform the operation in realtime or search mode" - }, - "refresh": { - "type" : "boolean", - "description" : "Refresh the shard containing the document before performing the operation" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - } + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json index 6099d7baa0bbe..14307bea2ef0b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json @@ -1,24 +1,31 @@ { - "get_script": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ "/_scripts/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Script ID", - "required" : true - } - }, - "params" : { - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" + "get_script":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "description":"Returns a script." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } } -} \ No newline at end of file +} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json index 0653491d9bffe..e8da013fd9462 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json @@ -1,74 +1,99 @@ { - "get_source": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/{index}/_source/{id}"], - "deprecated_paths" : [ + "get_source":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns the source of a document." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}/_source", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The document ID" - }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "path":"/{index}/_source/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "type": { - "type" : "string", - "required" : false, - "description" : "The type of the document; deprecated and optional starting with 7.0" + { + "path":"/{index}/{type}/{id}/_source", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "required":false, + "description":"The type of the document; deprecated and optional starting with 7.0", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" }, - "params": { - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime": { - "type" : "boolean", - "description" : "Specify whether to perform the operation in realtime or search mode" - }, - "refresh": { - "type" : "boolean", - "description" : "Refresh the shard containing the document before performing the operation" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - } + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json index e972df213a288..6796c0bc3eb4f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json @@ -1,87 +1,151 @@ { - "index": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", - "stability": "stable", - "methods": ["POST", "PUT"], - "url": { - "paths": ["/{index}/_doc/{id}", "/{index}/_doc"], - "deprecated_paths" : [ + "index":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", + "description":"Creates or updates a document in an index." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}", - "description" : "Specifying types in urls has been deprecated" + "path":"/{index}/_doc/{id}", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type" : "string", - "description" : "Document ID" + "path":"/{index}/_doc", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + { + "path":"/{index}/{type}", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, - "type": { - "type" : "string", - "description" : "The type of the document" + { + "path":"/{index}/{type}/{id}", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" }, - "params": { - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "op_type": { - "type" : "enum", - "options" : ["index", "create"], - "default" : "index", - "description" : "Explicit operation type" - }, - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" - }, - "if_seq_no" : { - "type" : "number", - "description" : "only perform the index operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term" : { - "type" : "number", - "description" : "only perform the index operation if the last operation that has changed the document has the specified primary term" - }, - "pipeline" : { - "type" : "string", - "description" : "The pipeline id to preprocess incoming documents with" - } + "op_type":{ + "type":"enum", + "options":[ + "index", + "create" + ], + "default":"index", + "description":"Explicit operation type" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the index operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the index operation if the last operation that has changed the document has the specified primary term" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" } }, - "body": { - "description" : "The document", - "required" : true + "body":{ + "description":"The document", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.analyze.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.analyze.json index 05e2ccfbaad6a..aa8e84c1985d6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.analyze.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.analyze.json @@ -1,25 +1,42 @@ { - "indices.analyze": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_analyze", "/{index}/_analyze"], - "parts": { - "index": { - "type" : "string", - "description" : "The name of the index to scope the operation" - } - }, - "params": { - "index": { - "type" : "string", - "description" : "The name of the index to scope the operation" + "indices.analyze":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html", + "description":"Performs the analysis process on a text and return the tokens breakdown of the text." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_analyze", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_analyze", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to scope the operation" + } + } } + ] + }, + "params":{ + "index":{ + "type":"string", + "description":"The name of the index to scope the operation" } }, - "body": { - "description" : "Define analyzer/tokenizer parameters and the text on which the analysis should be performed" + "body":{ + "description":"Define analyzer/tokenizer parameters and the text on which the analysis should be performed" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clear_cache.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clear_cache.json index 5db4fcbf38885..b1b1d8214c47d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clear_cache.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clear_cache.json @@ -1,53 +1,72 @@ { - "indices.clear_cache": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_cache/clear", "/{index}/_cache/clear"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index name to limit the operation" - } - }, - "params": { - "fielddata": { - "type" : "boolean", - "description" : "Clear field data" - }, - "fields": { - "type" : "list", - "description" : "A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)" - }, - "query": { - "type" : "boolean", - "description" : "Clear query caches" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "index": { - "type" : "list", - "description" : "A comma-separated list of index name to limit the operation" + "indices.clear_cache":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html", + "description":"Clears all or specific caches for one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cache/clear", + "methods":[ + "POST" + ] }, - "request": { - "type" : "boolean", - "description" : "Clear request cache" + { + "path":"/{index}/_cache/clear", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index name to limit the operation" + } + } } - } + ] }, - "body": null + "params":{ + "fielddata":{ + "type":"boolean", + "description":"Clear field data" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)" + }, + "query":{ + "type":"boolean", + "description":"Clear query caches" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "index":{ + "type":"list", + "description":"A comma-separated list of index name to limit the operation" + }, + "request":{ + "type":"boolean", + "description":"Clear request cache" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json index fe847488c2c33..9d4fb9ec46bb6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json @@ -1,35 +1,45 @@ { "indices.clone": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html", + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html", + "description": "Clones an index" + }, "stability": "stable", - "methods": ["PUT", "POST"], "url": { - "paths": ["/{index}/_clone/{target}"], - "parts": { - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the source index to clone" - }, - "target": { - "type" : "string", - "required" : true, - "description" : "The name of the target index to clone into" + "paths": [ + { + "path": "/{index}/_clone/{target}", + "methods": [ + "PUT", + "POST" + ], + "parts": { + "index": { + "type": "string", + "required": true, + "description": "The name of the source index to clone" + }, + "target": { + "type": "string", + "required": true, + "description": "The name of the target index to clone into" + } + } } + ] + }, + "params": { + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the cloned index before the operation returns." - } + "master_timeout": { + "type" : "time", + "description" : "Specify timeout for connection to master" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the cloned index before the operation returns." } }, "body": { diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json index 5af971362c3c2..539088199d683 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json @@ -1,46 +1,58 @@ { - "indices.close": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/{index}/_close"], - "parts": { - "index": { - "type" : "list", - "required" : true, - "description" : "A comma separated list of indices to close" + "indices.close":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", + "description":"Closes an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_close", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to close" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of active shards to wait for before the operation returns." - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json index 2f71f8f1d7fc4..2b9e8617a661c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json @@ -1,38 +1,46 @@ { - "indices.create": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html", - "stability": "stable", - "methods": ["PUT"], - "url": { - "paths": ["/{index}"], - "parts": { - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the index" + "indices.create":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html", + "description":"Creates an index with optional settings and mappings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be expected in the body of the mappings." }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether a type should be expected in the body of the mappings." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for before the operation returns." - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - } + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for before the operation returns." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } }, - "body": { - "description" : "The configuration for the index (`settings` and `mappings`)" + "body":{ + "description":"The configuration for the index (`settings` and `mappings`)" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete.json index 8df0b7f70d97b..d77d47f0d739b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete.json @@ -1,42 +1,54 @@ { - "indices.delete": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/{index}"], - "parts": { - "index": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices" + "indices.delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html", + "description":"Deletes an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type": "boolean", - "description": "Ignore unavailable indexes (default: false)" - }, - "allow_no_indices": { - "type": "boolean", - "description": "Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards": { - "type": "enum", - "options": [ "open", "closed", "none", "all" ], - "default": "open", - "description": "Whether wildcard expressions should get expanded to open or closed indices (default: open)" - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json index a2e04f2e24d71..13abf70ca739b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json @@ -1,33 +1,55 @@ { - "indices.delete_alias": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/{index}/_alias/{name}", "/{index}/_aliases/{name}"], - "parts": { - "index": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of index names (supports wildcards); use `_all` for all indices" + "indices.delete_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Deletes an alias." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_alias/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + } + } }, - "name": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + { + "path":"/{index}/_aliases/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit timestamp for the document" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit timestamp for the document" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json index bbe0c9e6aeb72..ca484a73e99f9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json @@ -1,28 +1,35 @@ { - "indices.delete_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/_template/{name}"], - "parts": { - "name": { - "type" : "string", - "required" : true, - "description" : "The name of the template" + "indices.delete_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Deletes an index template." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists.json index 08cba812b37f0..d6bdcef95815f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists.json @@ -1,47 +1,59 @@ { - "indices.exists": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html", - "stability": "stable", - "methods": [ "HEAD" ], - "url": { - "paths": [ "/{index}" ], - "parts": { - "index": { - "type": "list", - "required": true, - "description": "A comma-separated list of index names" + "indices.exists":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html", + "description":"Returns information about whether a particular index exists." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" }, - "params": { - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable": { - "type": "boolean", - "description": "Ignore unavailable indexes (default: false)" - }, - "allow_no_indices": { - "type": "boolean", - "description": "Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards": { - "type": "enum", - "options": [ "open", "closed", "none", "all" ], - "default": "open", - "description": "Whether wildcard expressions should get expanded to open or closed indices (default: open)" - }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "include_defaults": { - "type": "boolean", - "description": "Whether to return all default setting for each of the indices.", - "default": false - } + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_alias.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_alias.json index c277842e5c002..a19786a7938f9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_alias.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_alias.json @@ -1,42 +1,66 @@ { - "indices.exists_alias": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "stability": "stable", - "methods": ["HEAD"], - "url": { - "paths": ["/_alias/{name}", "/{index}/_alias/{name}"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to filter aliases" + "indices.exists_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Returns information about whether a particular alias exists." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_alias/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } }, - "name": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of alias names to return" + { + "path":"/{index}/_alias/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "all", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - } + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_template.json index 2ffe6a7081a5f..9796bdd9d21ff 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_template.json @@ -1,32 +1,39 @@ { - "indices.exists_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "stability": "stable", - "methods": ["HEAD"], - "url": { - "paths": [ "/_template/{name}" ], - "parts": { - "name": { - "type": "list", - "required": true, - "description": "The comma separated names of the index templates" + "indices.exists_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Returns information about whether a particular index template exists." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" }, - "params": { - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "master_timeout": { - "type": "time", - "description": "Explicit operation timeout for connection to master node" - }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - } + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json index 1559abbee90ad..2a09d8bdfa679 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json @@ -1,47 +1,54 @@ { - "indices.exists_type": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", - "stability": "stable", - "methods": ["HEAD"], - "deprecated" : { - "version" : "7.0.0", - "description" : "Types are being removed from elasticsearch and therefor this API is on the way out. Read more here: https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html" + "indices.exists_type":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", + "description":"Returns information about whether a particular document type exists. (DEPRECATED)" }, - "url": { - "paths": ["/{index}/_mapping/{type}"], - "parts": { - "index": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of index names; use `_all` to check the types across all indices" - }, - "type": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of document types to check" + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_mapping/{type}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` to check the types across all indices" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types to check" + } + } } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - } + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush.json index a81f343e2b0b2..1eada8f831db6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush.json @@ -1,41 +1,62 @@ { - "indices.flush": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html", - "stability": "stable", - "methods": ["POST", "GET"], - "url": { - "paths": ["/_flush", "/{index}/_flush"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string for all indices" - } - }, - "params": { - "force": { - "type" : "boolean", - "description" : "Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)" - }, - "wait_if_ongoing": { - "type" : "boolean", - "description" : "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running." - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "indices.flush":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html", + "description":"Performs the flush operation on one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_flush", + "methods":[ + "POST", + "GET" + ] }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_flush", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string for all indices" + } + } } - } + ] }, - "body": null + "params":{ + "force":{ + "type":"boolean", + "description":"Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)" + }, + "wait_if_ongoing":{ + "type":"boolean", + "description":"If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running." + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush_synced.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush_synced.json index 1383224b92f81..d30b1f6f541a0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush_synced.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.flush_synced.json @@ -1,41 +1,54 @@ { - "indices.flush_synced": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html#synced-flush-api", - "stability": "stable", - "methods": ["POST", "GET"], - "url": { - "paths": [ - "/_flush/synced", - "/{index}/_flush/synced" - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string for all indices" - } - }, - "params": { - "ignore_unavailable": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type": "boolean", - "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "indices.flush_synced":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html#synced-flush-api", + "description":"Performs a synced flush operation on one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_flush/synced", + "methods":[ + "POST", + "GET" + ] }, - "expand_wildcards": { - "type": "enum", - "options": [ - "open", - "closed", - "none", - "all" + { + "path":"/{index}/_flush/synced", + "methods":[ + "POST", + "GET" ], - "default": "open", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both." + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string for all indices" + } + } } - } + ] }, - "body": null + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.forcemerge.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.forcemerge.json index b058115a33385..5eaf62840d841 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.forcemerge.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.forcemerge.json @@ -1,45 +1,64 @@ { - "indices.forcemerge": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_forcemerge", "/{index}/_forcemerge"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "flush": { - "type" : "boolean", - "description" : "Specify whether the index should be flushed after performing the operation (default: true)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "max_num_segments": { - "type" : "number", - "description" : "The number of segments the index should be merged into (default: dynamic)" + "indices.forcemerge":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html", + "description":"Performs the force merge operation on one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_forcemerge", + "methods":[ + "POST" + ] }, - "only_expunge_deletes": { - "type" : "boolean", - "description" : "Specify whether the operation should only expunge deleted documents" + { + "path":"/{index}/_forcemerge", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "flush":{ + "type":"boolean", + "description":"Specify whether the index should be flushed after performing the operation (default: true)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "max_num_segments":{ + "type":"number", + "description":"The number of segments the index should be merged into (default: dynamic)" + }, + "only_expunge_deletes":{ + "type":"boolean", + "description":"Specify whether the operation should only expunge deleted documents" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json index 4860a2fbd917a..20f243c2b595f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json @@ -1,55 +1,67 @@ { "indices.get":{ - "documentation":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html", - "stability": "stable", - "methods":[ "GET" ], + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html", + "description":"Returns information about one or more indices." + }, + "stability":"stable", "url":{ - "paths":[ "/{index}" ], - "parts":{ - "index":{ - "type":"list", - "required" : true, - "description":"A comma-separated list of index names" + "paths":[ + { + "path":"/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether to add the type name to the response (default: false)" }, - "params":{ - "include_type_name": { - "type" : "boolean", - "description" : "Whether to add the type name to the response (default: false)" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "include_defaults": { - "type": "boolean", - "description": "Whether to return all default setting for each of the indices.", - "default": false - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - } + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_alias.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_alias.json index 110df41abe0ca..800ea8d30d68d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_alias.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_alias.json @@ -1,41 +1,84 @@ { - "indices.get_alias": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ "/_alias", "/_alias/{name}", "/{index}/_alias/{name}", "/{index}/_alias"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to filter aliases" - }, - "name": { - "type" : "list", - "description" : "A comma-separated list of alias names to return" - } - }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" + "indices.get_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Returns an alias." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_alias", + "methods":[ + "GET" + ] }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + { + "path":"/_alias/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "all", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_alias/{name}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" + { + "path":"/{index}/_alias", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + } + } } - } + ] }, - "body": null + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json index d473964e0ef63..449754fcd405c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json @@ -1,66 +1,120 @@ { - "indices.get_field_mapping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}"], - "deprecated_paths" : [ + "indices.get_field_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html", + "description":"Returns mapping for one or more fields." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/_mapping/{type}/field/{fields}", - "description" : "Specifying types in urls has been deprecated" + "path":"/_mapping/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + } }, { - "version" : "7.0.0", - "path" : "/{index}/_mapping/{type}/field/{fields}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names" + "path":"/{index}/_mapping/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + } }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types" + { + "path":"/_mapping/{type}/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, - "fields": { - "type" : "list", - "description" : "A comma-separated list of fields", - "required" : true + { + "path":"/{index}/_mapping/{type}/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether a type should be returned in the body of the mappings." - }, - "include_defaults": { - "type" : "boolean", - "description" : "Whether the default mapping values should be returned as well" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - } + "include_defaults":{ + "type":"boolean", + "description":"Whether the default mapping values should be returned as well" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json index 283e2d3d3aa36..313e5cff7d20f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json @@ -1,61 +1,102 @@ { - "indices.get_mapping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_mapping", "/{index}/_mapping"], - "deprecated_paths" : [ + "indices.get_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html", + "description":"Returns mappings for one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/_mapping/{type}", - "description" : "Specifying types in urls has been deprecated" + "path":"/_mapping", + "methods":[ + "GET" + ] }, { - "version" : "7.0.0", - "path" : "/{index}/_mapping/{type}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names" - }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types" - } - }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether to add the type name to the response (default: false)" + "path":"/{index}/_mapping", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" + { + "path":"/_mapping/{type}", + "methods":[ + "GET" + ], + "parts":{ + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" + { + "path":"/{index}/_mapping/{type}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } - } + ] }, - "body": null + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether to add the type name to the response (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json index 9b6ea42504288..c19fa3bf5262f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json @@ -1,54 +1,100 @@ { - "indices.get_settings": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_settings", "/{index}/_settings", "/{index}/_settings/{name}", "/_settings/{name}"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "name": { - "type" : "list", - "description" : "The name of the settings that should be included" - } - }, - "params": { - "master_timeout": { - "type": "time", - "description": "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : ["open","closed"], - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + "indices.get_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html", + "description":"Returns settings for one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_settings", + "methods":[ + "GET" + ] }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" + { + "path":"/{index}/_settings", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" + { + "path":"/{index}/_settings/{name}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "name":{ + "type":"list", + "description":"The name of the settings that should be included" + } + } }, - "include_defaults": { - "type": "boolean", - "description": "Whether to return all default setting for each of the indices.", - "default": false + { + "path":"/_settings/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The name of the settings that should be included" + } + } } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":[ + "open", + "closed" + ], + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json index 3e0a63a1b6f28..9e07ae663ff8f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json @@ -1,39 +1,49 @@ { - "indices.get_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ - "/_template", - "/_template/{name}" - ], - "parts": { - "name": { - "type": "list", - "required": false, - "description": "The comma separated names of the index templates" - } - }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether a type should be returned in the body of the mappings." - }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - }, - "master_timeout": { - "type": "time", - "description": "Explicit operation timeout for connection to master node" + "indices.get_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Returns an index template." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template", + "methods":[ + "GET" + ] }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" + { + "path":"/_template/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } } - } + ] }, - "body": null + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_upgrade.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_upgrade.json index 100f229bb4e32..981478b41fecc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_upgrade.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_upgrade.json @@ -1,33 +1,52 @@ { - "indices.get_upgrade": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_upgrade", "/{index}/_upgrade"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "indices.get_upgrade":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", + "description":"The _upgrade API is no longer useful and will be removed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_upgrade", + "methods":[ + "GET" + ] }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_upgrade", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.open.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.open.json index c968713535be1..14050d626df83 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.open.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.open.json @@ -1,46 +1,58 @@ { - "indices.open": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/{index}/_open"], - "parts": { - "index": { - "type" : "list", - "required" : true, - "description" : "A comma separated list of indices to open" + "indices.open":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", + "description":"Opens an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_open", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to open" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "closed", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of active shards to wait for before the operation returns." - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"closed", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json index c6f40fdbb8c4a..603f24b665eb7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json @@ -1,36 +1,61 @@ { - "indices.put_alias": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/{index}/_alias/{name}", "/{index}/_aliases/{name}"], - "parts": { - "index": { - "type" : "list", - "required" : true, - "description" : "A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + "indices.put_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Creates or updates an alias." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_alias/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + }, + "name":{ + "type":"string", + "description":"The name of the alias to be created or updated" + } + } }, - "name": { - "type" : "string", - "required" : true, - "description" : "The name of the alias to be created or updated" + { + "path":"/{index}/_aliases/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + }, + "name":{ + "type":"string", + "description":"The name of the alias to be created or updated" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit timestamp for the document" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit timestamp for the document" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } }, - "body": { - "description" : "The settings for the alias, such as `routing` or `filter`", - "required" : false + "body":{ + "description":"The settings for the alias, such as `routing` or `filter`", + "required":false } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json index 56b7d7f5f5f9b..901576e5980b1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json @@ -1,89 +1,204 @@ { - "indices.put_mapping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["{index}/_mapping"], - "deprecated_paths" : [ + "indices.put_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html", + "description":"Updates the index mappings." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/_mapping", - "description" : "Specifying types in urls has been deprecated" + "path":"{index}/_mapping", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + } + } }, { - "version" : "7.0.0", - "path" : "/{index}/_mapping/{type}", - "description" : "Specifying types in urls has been deprecated" + "path":"/{index}/{type}/_mapping", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, { - "version" : "7.0.0", - "path" : "/{index}/{type}/_mappings", - "description" : "Specifying types in urls has been deprecated" + "path":"/{index}/_mapping/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, { - "version" : "7.0.0", - "path" : "/{index}/_mappings/{type}", - "description" : "Specifying types in urls has been deprecated" + "path":"/{index}/{type}/_mappings", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, { - "version" : "7.0.0", - "path" : "/_mappings/{type}", - "description" : "Specifying types in urls has been deprecated" + "path":"/{index}/_mappings/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, { - "version" : "7.0.0", - "path" : "{index}/_mappings", - "description" : "The plural mappings is accepted but only /_mapping is documented" + "path":"/_mappings/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } }, { - "version" : "7.0.0", - "path" : "/_mapping/{type}", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + "path":"{index}/_mappings", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The plural mappings is accepted but only /_mapping is documented" + } }, - "type": { - "type" : "string", - "description" : "The name of the document type" + { + "path":"/_mapping/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be expected in the body of the mappings." }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether a type should be expected in the body of the mappings." - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." } }, - "body": { - "description" : "The mapping definition", - "required" : true + "body":{ + "description":"The mapping definition", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json index 755fcb3d8ad1e..75bf3a340c311 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json @@ -1,52 +1,72 @@ { - "indices.put_settings": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html", - "stability": "stable", - "methods": ["PUT"], - "url": { - "paths": ["/_settings", "/{index}/_settings"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "master_timeout": { - "type": "time", - "description": "Specify timeout for connection to master" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "preserve_existing": { - "type": "boolean", - "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`" - }, - "ignore_unavailable": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type": "boolean", - "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type": "enum", - "options": ["open", "closed","none","all"], - "default": "open", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both." + "indices.put_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html", + "description":"Updates the index settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_settings", + "methods":[ + "PUT" + ] }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" + { + "path":"/{index}/_settings", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "preserve_existing":{ + "type":"boolean", + "description":"Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" } }, - "body": { - "description": "The index settings to be updated", - "required": true + "body":{ + "description":"The index settings to be updated", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json index eee0def8fad05..18f140538c339 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json @@ -1,48 +1,57 @@ { - "indices.put_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/_template/{name}"], - "parts": { - "name": { - "type" : "string", - "required" : true, - "description" : "The name of the template" + "indices.put_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Creates or updates an index template." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether a type should be returned in the body of the mappings." - }, - "order": { - "type" : "number", - "description" : "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)" - }, - "create" : { - "type" : "boolean", - "description" : "Whether the index template should only be added if new or can also replace an existing one", - "default" : false - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" - } + "order":{ + "type":"number", + "description":"The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)" + }, + "create":{ + "type":"boolean", + "description":"Whether the index template should only be added if new or can also replace an existing one", + "default":false + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" } }, - "body": { - "description" : "The template definition", - "required" : true + "body":{ + "description":"The template definition", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.recovery.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.recovery.json index 5df11abc5990b..8b134bbe2413a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.recovery.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.recovery.json @@ -1,29 +1,43 @@ { - "indices.recovery" : { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_recovery", "/{index}/_recovery"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "detailed" : { - "type": "boolean", - "description": "Whether to display detailed information about shard recovery", - "default": false - }, - "active_only" : { - "type": "boolean", - "description": "Display only those recoveries that are currently on-going", - "default": false - } - } + "indices.recovery":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html", + "description":"Returns information about ongoing index shard recoveries." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_recovery", + "methods":[ + "GET" + ] }, - "body": null + { + "path":"/{index}/_recovery", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "detailed":{ + "type":"boolean", + "description":"Whether to display detailed information about shard recovery", + "default":false + }, + "active_only":{ + "type":"boolean", + "description":"Display only those recoveries that are currently on-going", + "default":false + } } -} \ No newline at end of file + } +} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.refresh.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.refresh.json index bb7eefb90e582..7eee4eeec5fd0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.refresh.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.refresh.json @@ -1,33 +1,54 @@ { - "indices.refresh": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html", - "stability": "stable", - "methods": ["POST", "GET"], - "url": { - "paths": ["/_refresh", "/{index}/_refresh"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "indices.refresh":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html", + "description":"Performs the refresh operation in one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_refresh", + "methods":[ + "POST", + "GET" + ] }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_refresh", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json index 49cfbf93df3dc..4ed1f9b490969 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json @@ -1,47 +1,66 @@ { - "indices.rollover": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/{alias}/_rollover", "/{alias}/_rollover/{new_index}"], - "parts": { - "alias": { - "type" : "string", - "required" : true, - "description" : "The name of the alias to rollover" + "indices.rollover":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html", + "description":"Updates an alias to point to a new index when the existing index\nis considered to be too large or too old." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{alias}/_rollover", + "methods":[ + "POST" + ], + "parts":{ + "alias":{ + "type":"string", + "description":"The name of the alias to rollover" + } + } }, - "new_index": { - "type" : "string", - "required" : false, - "description" : "The name of the rollover index" + { + "path":"/{alias}/_rollover/{new_index}", + "methods":[ + "POST" + ], + "parts":{ + "alias":{ + "type":"string", + "description":"The name of the alias to rollover" + }, + "new_index":{ + "type":"string", + "description":"The name of the rollover index" + } + } } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be included in the body of the mappings." }, - "params": { - "include_type_name": { - "type" : "boolean", - "description" : "Whether a type should be included in the body of the mappings." - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "dry_run": { - "type" : "boolean", - "description" : "If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the newly created rollover index before the operation returns." - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "dry_run":{ + "type":"boolean", + "description":"If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for on the newly created rollover index before the operation returns." } }, - "body": { - "description" : "The conditions that needs to be met for executing rollover" + "body":{ + "description":"The conditions that needs to be met for executing rollover" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json index bbbdc4089d4bc..b99b19799dab9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json @@ -1,38 +1,57 @@ { - "indices.segments": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_segments", "/{index}/_segments"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + "indices.segments":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html", + "description":"Provides low-level information about segments in a Lucene index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_segments", + "methods":[ + "GET" + ] }, - "verbose": { - "type": "boolean", - "description": "Includes detailed memory usage by Lucene.", - "default": false + { + "path":"/{index}/_segments", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "verbose":{ + "type":"boolean", + "description":"Includes detailed memory usage by Lucene.", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shard_stores.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shard_stores.json index 484c4a5fbcf10..b397963f99d2f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shard_stores.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shard_stores.json @@ -1,38 +1,62 @@ { - "indices.shard_stores": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_shard_stores", "/{index}/_shard_stores"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "status" : { - "type" : "list", - "options" : ["green", "yellow", "red", "all"], - "description" : "A comma-separated list of statuses used to filter on shards to get store information for" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "indices.shard_stores":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html", + "description":"Provides store information for shard copies of indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_shard_stores", + "methods":[ + "GET" + ] }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_shard_stores", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "status":{ + "type":"list", + "options":[ + "green", + "yellow", + "red", + "all" + ], + "description":"A comma-separated list of statuses used to filter on shards to get store information for" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json index c4f4ea32fe4ea..b4a489d230302 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json @@ -1,39 +1,47 @@ { - "indices.shrink": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/{index}/_shrink/{target}"], - "parts": { - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the source index to shrink" - }, - "target": { - "type" : "string", - "required" : true, - "description" : "The name of the target index to shrink into" + "indices.shrink":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html", + "description":"Allow to shrink an existing index into a new index with fewer primary shards." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_shrink/{target}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the source index to shrink" + }, + "target":{ + "type":"string", + "description":"The name of the target index to shrink into" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for on the shrunken index before the operation returns." } }, - "body": { - "description" : "The configuration for the target index (`settings` and `aliases`)" + "body":{ + "description":"The configuration for the target index (`settings` and `aliases`)" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json index 08c3fd3a407b3..96517918defea 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json @@ -1,39 +1,47 @@ { - "indices.split": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/{index}/_split/{target}"], - "parts": { - "index": { - "type" : "string", - "required" : true, - "description" : "The name of the source index to split" - }, - "target": { - "type" : "string", - "required" : true, - "description" : "The name of the target index to split into" + "indices.split":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html", + "description":"Allows you to split an existing index into a new index with more primary shards." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_split/{target}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the source index to split" + }, + "target":{ + "type":"string", + "description":"The name of the target index to split into" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for on the shrunken index before the operation returns." } }, - "body": { - "description" : "The configuration for the target index (`settings` and `aliases`)" + "body":{ + "description":"The configuration for the target index (`settings` and `aliases`)" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json index 131e7030cc4f8..0940313154a74 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json @@ -1,76 +1,153 @@ { - "indices.stats": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ - "/_stats", - "/_stats/{metric}", - "/{index}/_stats", - "/{index}/_stats/{metric}" - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "metric" : { - "type" : "list", - "options" : ["_all", "completion", "docs", "fielddata", "query_cache", "flush", "get", "indexing", "merge", "request_cache", "refresh", "search", "segments", "store", "warmer", "suggest"], - "description" : "Limit the information returned the specific metrics." - } - }, - "params": { - "completion_fields": { - "type" : "list", - "description" : "A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" - }, - "fielddata_fields": { - "type" : "list", - "description" : "A comma-separated list of fields for `fielddata` index metric (supports wildcards)" - }, - "fields": { - "type" : "list", - "description" : "A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" - }, - "groups": { - "type" : "list", - "description" : "A comma-separated list of search groups for `search` index metric" - }, - "level": { - "type" : "enum", - "description": "Return stats aggregated at cluster, index or shard level", - "options" : ["cluster", "indices", "shards"], - "default" : "indices" - }, - "types" : { - "type" : "list", - "description" : "A comma-separated list of document types for the `indexing` index metric" - }, - "include_segment_file_sizes": { - "type": "boolean", - "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", - "default": false + "indices.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html", + "description":"Provides statistics on operations happening in an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_stats", + "methods":[ + "GET" + ] }, - "include_unloaded_segments": { - "type": "boolean", - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory", - "default": false + { + "path":"/_stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned the specific metrics." + } + } }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } }, - "forbid_closed_indices": { - "type": "boolean", - "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices", - "default": true + { + "path":"/{index}/_stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned the specific metrics." + } + } } - } + ] }, - "body": null + "params":{ + "completion_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" + }, + "fielddata_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + }, + "groups":{ + "type":"list", + "description":"A comma-separated list of search groups for `search` index metric" + }, + "level":{ + "type":"enum", + "description":"Return stats aggregated at cluster, index or shard level", + "options":[ + "cluster", + "indices", + "shards" + ], + "default":"indices" + }, + "types":{ + "type":"list", + "description":"A comma-separated list of document types for the `indexing` index metric" + }, + "include_segment_file_sizes":{ + "type":"boolean", + "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", + "default":false + }, + "include_unloaded_segments":{ + "type":"boolean", + "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "forbid_closed_indices":{ + "type":"boolean", + "description":"If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices", + "default":true + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json index 4da9daa357c23..d4a222f2061c8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json @@ -1,26 +1,33 @@ { - "indices.update_aliases": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_aliases"], - "parts": { - }, - "params": { - "timeout": { - "type" : "time", - "description" : "Request timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" + "indices.update_aliases":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Updates index aliases." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_aliases", + "methods":[ + "POST" + ] } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Request timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" } }, - "body": { - "description" : "The definition of `actions` to perform", - "required" : true + "body":{ + "description":"The definition of `actions` to perform", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.upgrade.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.upgrade.json index 743d647102693..7cdf098e7c617 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.upgrade.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.upgrade.json @@ -1,41 +1,60 @@ { - "indices.upgrade": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_upgrade", "/{index}/_upgrade"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "wait_for_completion": { - "type" : "boolean", - "description" : "Specify whether the request should block until the all segments are upgraded (default: false)" + "indices.upgrade":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", + "description":"The _upgrade API is no longer useful and will be removed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_upgrade", + "methods":[ + "POST" + ] }, - "only_ancient_segments": { - "type" : "boolean", - "description" : "If true, only ancient (an older Lucene major release) segments will be upgraded" + { + "path":"/{index}/_upgrade", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Specify whether the request should block until the all segments are upgraded (default: false)" + }, + "only_ancient_segments":{ + "type":"boolean", + "description":"If true, only ancient (an older Lucene major release) segments will be upgraded" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json index 9925a41ad6108..5ff6f073b77ec 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json @@ -1,84 +1,120 @@ { - "indices.validate_query": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_validate/query", "/{index}/_validate/query"], - "deprecated_paths" : [ + "indices.validate_query":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html", + "description":"Allows a user to validate a potentially expensive query without executing it." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/_validate/query", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" - }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types" - } - }, - "params": { - "explain": { - "type" : "boolean", - "description" : "Return detailed information about the error" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + "path":"/_validate/query", + "methods":[ + "GET", + "POST" + ] }, - "rewrite": { - "type": "boolean", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + { + "path":"/{index}/_validate/query", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" + } + } }, - "all_shards": { - "type": "boolean", - "description": "Execute validation on all shards instead of one random shard per index" + { + "path":"/{index}/{type}/_validate/query", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "explain":{ + "type":"boolean", + "description":"Return detailed information about the error" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "rewrite":{ + "type":"boolean", + "description":"Provide a more detailed explanation showing the actual Lucene query that will be executed." + }, + "all_shards":{ + "type":"boolean", + "description":"Execute validation on all shards instead of one random shard per index" } }, - "body": { - "description" : "The query definition specified with the Query DSL" + "body":{ + "description":"The query definition specified with the Query DSL" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/info.json b/rest-api-spec/src/main/resources/rest-api-spec/api/info.json index a0a422e8c90cf..3a4f4afa765bb 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/info.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/info.json @@ -1,15 +1,20 @@ { - "info": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/"], - "parts": { - }, - "params": { - } + "info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/", + "description":"Returns basic information about the cluster." }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json index f1b3168941814..29b4219038cd2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json @@ -1,28 +1,35 @@ { - "ingest.delete_pipeline": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ingest/pipeline/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Pipeline ID", - "required" : true + "ingest.delete_pipeline":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html", + "description":"Deletes a pipeline." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json index e91226c1859f9..65fc4f91b2b42 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json @@ -1,23 +1,37 @@ { - "ingest.get_pipeline": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_ingest/pipeline", "/_ingest/pipeline/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Comma separated list of pipeline ids. Wildcards supported" - } - }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" + "ingest.get_pipeline":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html", + "description":"Returns a pipeline." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline", + "methods":[ + "GET" + ] + }, + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Comma separated list of pipeline ids. Wildcards supported" + } + } } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.processor_grok.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.processor_grok.json index cb98ef30df948..ac8ad6e6d0669 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.processor_grok.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.processor_grok.json @@ -1,15 +1,20 @@ { - "ingest.processor_grok": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": ["/_ingest/processor/grok"], - "parts": { - }, - "params": { - } + "ingest.processor_grok":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get", + "description":"Returns a list of the built-in patterns." }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/processor/grok", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json index 166b2b9d4190e..4d2105866791c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json @@ -1,31 +1,39 @@ { - "ingest.put_pipeline": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html", - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ingest/pipeline/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Pipeline ID", - "required" : true + "ingest.put_pipeline":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html", + "description":"Creates or updates a pipeline." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } }, - "body": { - "description" : "The ingest definition", - "required" : true - } + "body":{ + "description":"The ingest definition", + "required":true + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.simulate.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.simulate.json index 5010c02424e5b..8122f7a0ffa19 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.simulate.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.simulate.json @@ -1,28 +1,44 @@ { - "ingest.simulate": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ "/_ingest/pipeline/_simulate", "/_ingest/pipeline/{id}/_simulate" ], - "parts": { - "id": { - "type" : "string", - "description" : "Pipeline ID", - "required" : false - } - }, - "params": { - "verbose": { - "type" : "boolean", - "description" : "Verbose mode. Display data output for each processor in executed pipeline", - "default" : false + "ingest.simulate":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html", + "description":"Allows to simulate a pipeline with example documents." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/_simulate", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_ingest/pipeline/{id}/_simulate", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } } + ] + }, + "params":{ + "verbose":{ + "type":"boolean", + "description":"Verbose mode. Display data output for each processor in executed pipeline", + "default":false } }, - "body": { - "description" : "The simulate definition", - "required" : true - } + "body":{ + "description":"The simulate definition", + "required":true + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json index 13785af0d7b69..f1d35aee7d62f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json @@ -1,65 +1,93 @@ { - "mget": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_mget", "/{index}/_mget"], - "deprecated_paths" : [ + "mget":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html", + "description":"Allows to get multiple documents in one request." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/_mget", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "index": { - "type" : "string", - "description" : "The name of the index" - }, - "type": { - "type" : "string", - "description" : "The type of the document" - } - }, - "params": { - "stored_fields": { - "type": "list", - "description" : "A comma-separated list of stored fields to return in the response" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime": { - "type" : "boolean", - "description" : "Specify whether to perform the operation in realtime or search mode" - }, - "refresh": { - "type" : "boolean", - "description" : "Refresh the shard containing the document before performing the operation" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" + "path":"/_mget", + "methods":[ + "GET", + "POST" + ] }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" + { + "path":"/{index}/_mget", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" + { + "path":"/{index}/{type}/_mget", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" } }, - "body": { - "description" : "Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", - "required" : true + "body":{ + "description":"Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json index f3cb83a99e26a..8dd9da844520a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json @@ -1,56 +1,78 @@ { - "msearch": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_msearch", "/{index}/_msearch"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to use as default" - } - }, - "params": { - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch"], - "description" : "Search operation type" - }, - "max_concurrent_searches" : { - "type" : "number", - "description" : "Controls the maximum number of concurrent searches the multi search api will execute" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "pre_filter_shard_size" : { - "type" : "number", - "description" : "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", - "default" : 128 - }, - "max_concurrent_shard_requests" : { - "type" : "number", - "description" : "The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", - "default" : 5 - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false + "msearch":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html", + "description":"Allows to execute several search operations in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_msearch", + "methods":[ + "GET", + "POST" + ] }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" + { + "path":"/{index}/_msearch", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to use as default" + } + } } + ] + }, + "params":{ + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "max_concurrent_searches":{ + "type":"number", + "description":"Controls the maximum number of concurrent searches the multi search api will execute" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "pre_filter_shard_size":{ + "type":"number", + "description":"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "default":128 + }, + "max_concurrent_shard_requests":{ + "type":"number", + "description":"The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", + "default":5 + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" } }, - "body": { - "description": "The request definitions (metadata-search request definition pairs), separated by newlines", - "required" : true, - "serialize" : "bulk" + "body":{ + "description":"The request definitions (metadata-search request definition pairs), separated by newlines", + "required":true, + "serialize":"bulk" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json index 6fea78ea79398..2d8be2f1cf403 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json @@ -1,46 +1,68 @@ { - "msearch_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_msearch/template", "/{index}/_msearch/template"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to use as default" - } - }, - "params": { - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch"], - "description" : "Search operation type" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "max_concurrent_searches" : { - "type" : "number", - "description" : "Controls the maximum number of concurrent searches the multi search api will execute" - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false + "msearch_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html", + "description":"Allows to execute several search template operations in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_msearch/template", + "methods":[ + "GET", + "POST" + ] }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" + { + "path":"/{index}/_msearch/template", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to use as default" + } + } } + ] + }, + "params":{ + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "max_concurrent_searches":{ + "type":"number", + "description":"Controls the maximum number of concurrent searches the multi search api will execute" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" } }, - "body": { - "description": "The request definitions (metadata-search request definition pairs), separated by newlines", - "required" : true, - "serialize" : "bulk" + "body":{ + "description":"The request definitions (metadata-search request definition pairs), separated by newlines", + "required":true, + "serialize":"bulk" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json index 90eb37a160cdc..f9c6541d0c369 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json @@ -1,87 +1,108 @@ { - "mtermvectors" : { - "documentation" : "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html", - "stability": "stable", - "methods" : ["GET", "POST"], - "url" : { - "paths" : ["/_mtermvectors", "/{index}/_mtermvectors"], - "parts" : { - "index" : { - "type" : "string", - "description" : "The index in which the document resides." - } - }, - "params" : { - "ids" : { - "type" : "list", - "description" : "A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body", - "required" : false - }, - "term_statistics" : { - "type" : "boolean", - "description" : "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default" : false, - "required" : false - }, - "field_statistics" : { - "type" : "boolean", - "description" : "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default" : true, - "required" : false - }, - "fields" : { - "type" : "list", - "description" : "A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "required" : false - }, - "offsets" : { - "type" : "boolean", - "description" : "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default" : true, - "required" : false - }, - "positions" : { - "type" : "boolean", - "description" : "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default" : true, - "required" : false - }, - "payloads" : { - "type" : "boolean", - "description" : "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default" : true, - "required" : false - }, - "preference" : { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "required" : false - }, - "routing" : { - "type" : "string", - "description" : "Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "required" : false - }, - "realtime": { - "type": "boolean", - "description": "Specifies if requests are real-time as opposed to near-real-time (default: true).", - "required": false - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" + "mtermvectors":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html", + "description":"Returns multiple termvectors in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_mtermvectors", + "methods":[ + "GET", + "POST" + ] }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" + { + "path":"/{index}/_mtermvectors", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + } + } } + ] + }, + "params":{ + "ids":{ + "type":"list", + "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body", + "required":false + }, + "term_statistics":{ + "type":"boolean", + "description":"Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":false, + "required":false + }, + "field_statistics":{ + "type":"boolean", + "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true, + "required":false + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "required":false + }, + "offsets":{ + "type":"boolean", + "description":"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true, + "required":false + }, + "positions":{ + "type":"boolean", + "description":"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true, + "required":false + }, + "payloads":{ + "type":"boolean", + "description":"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true, + "required":false + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "required":false + }, + "routing":{ + "type":"string", + "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "required":false + }, + "realtime":{ + "type":"boolean", + "description":"Specifies if requests are real-time as opposed to near-real-time (default: true).", + "required":false + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } }, - "body" : { - "description" : "Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.", - "required" : false - + "body":{ + "description":"Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.", + "required":false } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json index 6ee180500b284..0830344dc4ad4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json @@ -1,76 +1,143 @@ { - "nodes.hot_threads": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_nodes/hot_threads", "/_nodes/{node_id}/hot_threads"], - "deprecated_paths" : [ + "nodes.hot_threads":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html", + "description":"Returns information about hot threads on each node in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/_cluster/nodes/hotthreads", - "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + "path":"/_nodes/hot_threads", + "methods":[ + "GET" + ] }, { - "version" : "7.0.0", - "path" : "/_cluster/nodes/{node_id}/hotthreads", - "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + "path":"/_nodes/{node_id}/hot_threads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } }, { - "version" : "7.0.0", - "path" : "/_nodes/hotthreads", - "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + "path":"/_cluster/nodes/hotthreads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } }, { - "version" : "7.0.0", - "path" : "/_nodes/{node_id}/hotthreads", - "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + "path":"/_cluster/nodes/{node_id}/hotthreads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } }, { - "version" : "7.0.0", - "path" : "/_cluster/nodes/hot_threads", - "description" : "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + "path":"/_nodes/hotthreads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } }, { - "version" : "7.0.0", - "path" :"/_cluster/nodes/{node_id}/hot_threads", - "description" : "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - } - ], - "parts": { - "node_id": { - "type" : "list", - "description" : "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "params": { - "interval": { - "type" : "time", - "description" : "The interval for the second sampling of threads" + "path":"/_nodes/{node_id}/hotthreads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } }, - "snapshots": { - "type" : "number", - "description" : "Number of samples of thread stacktrace (default: 10)" - }, - "threads": { - "type" : "number", - "description" : "Specify the number of threads to provide information for (default: 3)" - }, - "ignore_idle_threads": { - "type" : "boolean", - "description" : "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)" - }, - "type": { - "type" : "enum", - "options" : ["cpu", "wait", "block"], - "description" : "The type to sample (default: cpu)" + { + "path":"/_cluster/nodes/hot_threads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"7.0.0", + "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + { + "path":"/_cluster/nodes/{node_id}/hot_threads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } } - } + ] }, - "body": null + "params":{ + "interval":{ + "type":"time", + "description":"The interval for the second sampling of threads" + }, + "snapshots":{ + "type":"number", + "description":"Number of samples of thread stacktrace (default: 10)" + }, + "threads":{ + "type":"number", + "description":"Specify the number of threads to provide information for (default: 3)" + }, + "ignore_idle_threads":{ + "type":"boolean", + "description":"Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)" + }, + "type":{ + "type":"enum", + "options":[ + "cpu", + "wait", + "block" + ], + "description":"The type to sample (default: cpu)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.info.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.info.json index 404f9107224ac..37279edd3106f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.info.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.info.json @@ -1,32 +1,91 @@ { - "nodes.info": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_nodes", "/_nodes/{node_id}", "/_nodes/{metric}", "/_nodes/{node_id}/{metric}"], - "parts": { - "node_id": { - "type": "list", - "description": "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + "nodes.info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html", + "description":"Returns information about nodes in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes", + "methods":[ + "GET" + ] }, - "metric": { - "type": "list", - "options": ["settings", "os", "process", "jvm", "thread_pool", "transport", "http", "plugins", "ingest"], - "description": "A comma-separated list of metrics you wish returned. Leave empty to return all." - } - }, - "params": { - "flat_settings": { - "type": "boolean", - "description": "Return settings in flat format (default: false)" + { + "path":"/_nodes/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." + } + } }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + { + "path":"/_nodes/{node_id}/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "metric":{ + "type":"list", + "options":[ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." + } + } } - } + ] }, - "body": null + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.reload_secure_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.reload_secure_settings.json index e40e66cb266bb..b1be8af3eee67 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.reload_secure_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.reload_secure_settings.json @@ -1,23 +1,37 @@ { - "nodes.reload_secure_settings": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_nodes/reload_secure_settings", "/_nodes/{node_id}/reload_secure_settings"], - "parts": { - "node_id": { - "type": "list", - "description": "A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes." - } - }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + "nodes.reload_secure_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings", + "description":"Reloads secure settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/reload_secure_settings", + "methods":[ + "POST" + ] + }, + { + "path":"/_nodes/{node_id}/reload_secure_settings", + "methods":[ + "POST" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes." + } + } } - } + ] }, - "body": null + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json index 6debf0db7b047..1aa57ee849c66 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json @@ -1,71 +1,224 @@ { - "nodes.stats": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ - "/_nodes/stats", - "/_nodes/{node_id}/stats", - "/_nodes/stats/{metric}", - "/_nodes/{node_id}/stats/{metric}", - "/_nodes/stats/{metric}/{index_metric}", - "/_nodes/{node_id}/stats/{metric}/{index_metric}" - ], - "parts": { - "metric" : { - "type" : "list", - "options" : ["_all", "breaker", "fs", "http", "indices", "jvm", "os", "process", "thread_pool", "transport", "discovery"], - "description" : "Limit the information returned to the specified metrics" - }, - "index_metric" : { - "type" : "list", - "options" : ["_all", "completion", "docs", "fielddata", "query_cache", "flush", "get", "indexing", "merge", "request_cache", "refresh", "search", "segments", "store", "warmer", "suggest"], - "description" : "Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." - }, - "node_id": { - "type" : "list", - "description" : "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "params": { - "completion_fields": { - "type" : "list", - "description" : "A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" - }, - "fielddata_fields": { - "type" : "list", - "description" : "A comma-separated list of fields for `fielddata` index metric (supports wildcards)" - }, - "fields": { - "type" : "list", - "description" : "A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + "nodes.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html", + "description":"Returns statistical information about nodes in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/stats", + "methods":[ + "GET" + ] }, - "groups": { - "type" : "boolean", - "description" : "A comma-separated list of search groups for `search` index metric" + { + "path":"/_nodes/{node_id}/stats", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } }, - "level": { - "type" : "enum", - "description": "Return indices stats aggregated at index, node or shard level", - "options" : ["indices", "node", "shards"], - "default" : "node" + { + "path":"/_nodes/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + } + } }, - "types" : { - "type" : "list", - "description" : "A comma-separated list of document types for the `indexing` index metric" + { + "path":"/_nodes/{node_id}/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + { + "path":"/_nodes/stats/{metric}/{index_metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + }, + "index_metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." + } + } }, - "include_segment_file_sizes": { - "type": "boolean", - "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", - "default": false + { + "path":"/_nodes/{node_id}/stats/{metric}/{index_metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + }, + "index_metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } } - } + ] }, - "body": null + "params":{ + "completion_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" + }, + "fielddata_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + }, + "groups":{ + "type":"boolean", + "description":"A comma-separated list of search groups for `search` index metric" + }, + "level":{ + "type":"enum", + "description":"Return indices stats aggregated at index, node or shard level", + "options":[ + "indices", + "node", + "shards" + ], + "default":"node" + }, + "types":{ + "type":"list", + "description":"A comma-separated list of document types for the `indexing` index metric" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "include_segment_file_sizes":{ + "type":"boolean", + "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", + "default":false + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.usage.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.usage.json index cc90ca953d9d2..5acbf7a51116c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.usage.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.usage.json @@ -1,33 +1,73 @@ { - "nodes.usage": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": [ - "/_nodes/usage", - "/_nodes/{node_id}/usage", - "/_nodes/usage/{metric}", - "/_nodes/{node_id}/usage/{metric}" - ], - "parts": { - "metric" : { - "type" : "list", - "options" : ["_all", "rest_actions"], - "description" : "Limit the information returned to the specified metrics" + "nodes.usage":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html", + "description":"Returns low-level information about REST actions usage on nodes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/usage", + "methods":[ + "GET" + ] }, - "node_id": { - "type" : "list", - "description" : "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" + { + "path":"/_nodes/{node_id}/usage", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/usage/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "rest_actions" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_nodes/{node_id}/usage/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "rest_actions" + ], + "description":"Limit the information returned to the specified metrics" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } } - } + ] }, - "body": null + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } } -} \ No newline at end of file +} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ping.json index 2deec2d533c53..a77a90e31bed4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ping.json @@ -1,15 +1,20 @@ { - "ping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html", - "stability": "stable", - "methods": ["HEAD"], - "url": { - "paths": ["/"], - "parts": { - }, - "params": { - } + "ping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/", + "description":"Returns whether the cluster is running." }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/", + "methods":[ + "HEAD" + ] + } + ] + }, + "params":{} } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json index fbe3eb9b3cf6c..750f7fdf4eb62 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json @@ -1,39 +1,61 @@ { - "put_script": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": [ "/_scripts/{id}", "/_scripts/{id}/{context}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Script ID", - "required" : true + "put_script":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "description":"Creates or updates a script." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } }, - "context" : { - "type" : "string", - "description" : "Script context" + { + "path":"/_scripts/{id}/{context}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + }, + "context":{ + "type":"string", + "description":"Script context" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params" : { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "context": { - "type" : "string", - "description" : "Context name to compile script against" - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "context":{ + "type":"string", + "description":"Context name to compile script against" } }, - "body": { - "description" : "The document", - "required" : true + "body":{ + "description":"The document", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/rank_eval.json b/rest-api-spec/src/main/resources/rest-api-spec/api/rank_eval.json index 8bb2212d7a68a..f22f4803bb489 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/rank_eval.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/rank_eval.json @@ -1,36 +1,58 @@ { - "rank_eval": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html", - "stability" : "experimental", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_rank_eval", "/{index}/_rank_eval"], - "parts": { - "index": { - "type": "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "rank_eval":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html", + "description":"Allows to evaluate the quality of ranked search results over a set of typical search queries" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rank_eval", + "methods":[ + "GET", + "POST" + ] }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_rank_eval", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } } - } - }, - "body": { - "description": "The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.", - "required": true + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + }, + "body":{ + "description":"The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/reindex.json b/rest-api-spec/src/main/resources/rest-api-spec/api/reindex.json index e4305bdd7a484..72f7b0670bc51 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/reindex.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/reindex.json @@ -1,54 +1,62 @@ { - "reindex": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_reindex"], - "parts": {}, - "params": { - "refresh": { - "type" : "boolean", - "description" : "Should the effected indexes be refreshed?" - }, - "timeout": { - "type" : "time", - "default": "1m", - "description" : "Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "wait_for_completion": { - "type" : "boolean", - "default": true, - "description" : "Should the request should block until the reindex is complete." - }, - "requests_per_second": { - "type": "number", - "default": 0, - "description": "The throttle to set on this request in sub-requests per second. -1 means no throttle." - }, - "scroll": { - "type" : "time", - "description" : "Control how long to keep the search context alive", - "default" : "5m" - }, - "slices": { - "type": "number", - "default": 1, - "description": "The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." - }, - "max_docs": { - "type" : "number", - "description" : "Maximum number of documents to process (default: all documents)" + "reindex":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", + "description":"Allows to copy documents from one index to another, optionally filtering the source\ndocuments by a query, changing the destination index settings, or fetching the\ndocuments from a remote cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_reindex", + "methods":[ + "POST" + ] } + ] + }, + "params":{ + "refresh":{ + "type":"boolean", + "description":"Should the effected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the reindex is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." + }, + "scroll":{ + "type":"time", + "description":"Control how long to keep the search context alive", + "default":"5m" + }, + "slices":{ + "type":"number", + "default":1, + "description":"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" } }, - "body": { - "description": "The search definition using the Query DSL and the prototype for the index request.", - "required": true + "body":{ + "description":"The search definition using the Query DSL and the prototype for the index request.", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/reindex_rethrottle.json b/rest-api-spec/src/main/resources/rest-api-spec/api/reindex_rethrottle.json index a6957c5f7c71a..d91365b3c49a5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/reindex_rethrottle.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/reindex_rethrottle.json @@ -1,25 +1,32 @@ { - "reindex_rethrottle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_reindex/{task_id}/_rethrottle"], - "parts": { - "task_id": { - "type": "string", - "required" : true, - "description": "The task id to rethrottle" - } - }, - "params": { - "requests_per_second": { - "type": "number", - "required": true, - "description": "The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + "reindex_rethrottle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", + "description":"Changes the number of requests per second for a particular Reindex operation." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_reindex/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } } - } + ] }, - "body": null + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/render_search_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/render_search_template.json index b560fdd18ebcf..72e2b871fce29 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/render_search_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/render_search_template.json @@ -1,19 +1,36 @@ { - "render_search_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html#_validating_templates", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": [ "/_render/template", "/_render/template/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "The id of the stored search template" + "render_search_template":{ + "documentation":{ + "url":"http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html", + "description":"Allows to use the Mustache language to pre-render a search definition." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_render/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_render/template/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The id of the stored search template" + } + } } - } + ] }, - "body": { - "description": "The search definition template and its params" + "body":{ + "description":"The search definition template and its params" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/scripts_painless_execute.json b/rest-api-spec/src/main/resources/rest-api-spec/api/scripts_painless_execute.json index 3cb9c18ef2103..9f761fb452ba1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/scripts_painless_execute.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/scripts_painless_execute.json @@ -1,17 +1,24 @@ { - "scripts_painless_execute": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html", - "stability" : "experimental", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_scripts/painless/_execute"], - "parts": { - }, - "params": { - } + "scripts_painless_execute":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html", + "description":"Allows an arbitrary script to be executed and a result to be returned" }, - "body": { - "description": "The script to execute" + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_scripts/painless/_execute", + "methods":[ + "GET", + "POST" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The script to execute" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json b/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json index 42329aae46c40..ea0cbe2675325 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json @@ -1,41 +1,56 @@ { - "scroll": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_search/scroll"], - "deprecated_paths" : [ + "scroll":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll", + "description":"Allows to retrieve a large numbers of results from a single search request." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/_search/scroll/{scroll_id}", - "description" : "A scroll id can be quite large and should be specified as part of the body" - } - ], - "parts": { - "scroll_id": { - "type" : "string", - "description" : "The scroll ID" - } - }, - "params": { - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "scroll_id": { - "type" : "string", - "description" : "The scroll ID for scrolled search" + "path":"/_search/scroll", + "methods":[ + "GET", + "POST" + ] }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false + { + "path":"/_search/scroll/{scroll_id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "scroll_id":{ + "type":"string", + "description":"The scroll ID", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"A scroll id can be quite large and should be specified as part of the body" + } } + ] + }, + "params":{ + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "scroll_id":{ + "type":"string", + "description":"The scroll ID for scrolled search" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false } }, - "body": { - "description": "The scroll ID if not passed by URL or query parameter." + "body":{ + "description":"The scroll ID if not passed by URL or query parameter." } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json index 79f580fbc7425..2411c309c7dff 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json @@ -1,202 +1,234 @@ { - "search": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_search", "/{index}/_search"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + "search":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html", + "description":"Returns results matching a query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" }, - "params": { - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "explain": { - "type" : "boolean", - "description" : "Specify whether to return detailed information about score computation as part of a hit" - }, - "stored_fields": { - "type" : "list", - "description" : "A comma-separated list of stored fields to return as part of a hit" - }, - "docvalue_fields": { - "type" : "list", - "description" : "A comma-separated list of fields to return as the docvalue representation of a field for each hit" - }, - "from": { - "type" : "number", - "description" : "Starting offset (default: 0)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled": { - "type" : "boolean", - "description" : "Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "dfs_query_then_fetch"], - "description" : "Search operation type" - }, - "size": { - "type" : "number", - "description" : "Number of hits to return (default: 10)" - }, - "sort": { - "type" : "list", - "description" : "A comma-separated list of : pairs" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "terminate_after": { - "type" : "number", - "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats": { - "type" : "list", - "description" : "Specific 'tag' of the request for logging and statistical purposes" - }, - "suggest_field": { - "type" : "string", - "description" : "Specify which field to use for suggestions" - }, - "suggest_mode": { - "type" : "enum", - "options" : ["missing", "popular", "always"], - "default" : "missing", - "description" : "Specify suggest mode" - }, - "suggest_size": { - "type" : "number", - "description" : "How many suggestions to return in response" - }, - "suggest_text": { - "type" : "string", - "description" : "The source text for which the suggestions should be returned" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "track_scores": { - "type" : "boolean", - "description": "Whether to calculate and return scores even if they are not used for sorting" - }, - "track_total_hits": { - "type" : "boolean", - "description": "Indicate if the number of documents that match the query should be tracked" - }, - "allow_partial_search_results": { - "type" : "boolean", - "default" : true, - "description": "Indicate if an error should be returned if there is a partial search failure or timeout" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "version": { - "type" : "boolean", - "description" : "Specify whether to return document version as part of a hit" - }, - "seq_no_primary_term": { - "type" : "boolean", - "description" : "Specify whether to return sequence number and primary term of the last modification of each hit" - }, - "request_cache": { - "type" : "boolean", - "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "batched_reduce_size" : { - "type" : "number", - "description" : "The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.", - "default" : 512 - }, - "max_concurrent_shard_requests" : { - "type" : "number", - "description" : "The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", - "default" : 5 - }, - "pre_filter_shard_size" : { - "type" : "number", - "description" : "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", - "default" : 128 - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false - } + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "explain":{ + "type":"boolean", + "description":"Specify whether to return detailed information about score computation as part of a hit" + }, + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return as part of a hit" + }, + "docvalue_fields":{ + "type":"list", + "description":"A comma-separated list of fields to return as the docvalue representation of a field for each hit" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "size":{ + "type":"number", + "description":"Number of hits to return (default: 10)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "suggest_field":{ + "type":"string", + "description":"Specify which field to use for suggestions" + }, + "suggest_mode":{ + "type":"enum", + "options":[ + "missing", + "popular", + "always" + ], + "default":"missing", + "description":"Specify suggest mode" + }, + "suggest_size":{ + "type":"number", + "description":"How many suggestions to return in response" + }, + "suggest_text":{ + "type":"string", + "description":"The source text for which the suggestions should be returned" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "track_scores":{ + "type":"boolean", + "description":"Whether to calculate and return scores even if they are not used for sorting" + }, + "track_total_hits":{ + "type":"boolean", + "description":"Indicate if the number of documents that match the query should be tracked" + }, + "allow_partial_search_results":{ + "type":"boolean", + "default":true, + "description":"Indicate if an error should be returned if there is a partial search failure or timeout" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "seq_no_primary_term":{ + "type":"boolean", + "description":"Specify whether to return sequence number and primary term of the last modification of each hit" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "batched_reduce_size":{ + "type":"number", + "description":"The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.", + "default":512 + }, + "max_concurrent_shard_requests":{ + "type":"number", + "description":"The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", + "default":5 + }, + "pre_filter_shard_size":{ + "type":"number", + "description":"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "default":128 + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false } }, - "body": { - "description": "The search definition using the Query DSL" + "body":{ + "description":"The search definition using the Query DSL" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search_shards.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search_shards.json index 148923901dcb2..70ee592520be9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search_shards.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search_shards.json @@ -1,45 +1,66 @@ { - "search_shards": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_search_shards", "/{index}/_search_shards"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - }, - "params": { - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + "search_shards":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html", + "description":"Returns information about the indices and shards that a search request would be executed against." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search_shards", + "methods":[ + "GET", + "POST" + ] }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." + { + "path":"/{index}/_search_shards", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } } - } + ] }, - "body": null + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json index 0a5c5c3a5d797..f3286cd932c4e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json @@ -1,79 +1,106 @@ { - "search_template": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/_search/template", "/{index}/_search/template"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - }, - "params" : { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled": { - "type" : "boolean", - "description" : "Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch"], - "description" : "Search operation type" - }, - "explain": { - "type" : "boolean", - "description" : "Specify whether to return detailed information about score computation as part of a hit" - }, - "profile": { - "type" : "boolean", - "description" : "Specify whether to profile the query execution" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false + "search_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html", + "description":"Allows to use the Mustache language to pre-render a search definition." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search/template", + "methods":[ + "GET", + "POST" + ] }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" + { + "path":"/{index}/_search/template", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "explain":{ + "type":"boolean", + "description":"Specify whether to return detailed information about score computation as part of a hit" + }, + "profile":{ + "type":"boolean", + "description":"Specify whether to profile the query execution" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" } }, - "body": { - "description": "The search definition template and its params", - "required" : true + "body":{ + "description":"The search definition template and its params", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json index f4aa725c5255b..da8cb9916f584 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json @@ -1,37 +1,45 @@ { - "snapshot.create": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/_snapshot/{repository}/{snapshot}"], - "parts": { - "repository": { - "type": "string", - "required" : true, - "description": "A repository name" - }, - "snapshot": { - "type": "string", - "required" : true, - "description": "A snapshot name" + "snapshot.create":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Creates a snapshot in a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "wait_for_completion": { - "type": "boolean", - "description": "Should this request wait until the operation has completed before returning", - "default": false - } + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":false } }, - "body" : { - "description" : "The snapshot definition", - "required" : false + "body":{ + "description":"The snapshot definition", + "required":false } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json index f55385f472fc7..431ac3c68c0bd 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json @@ -1,35 +1,44 @@ { - "snapshot.create_repository": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/_snapshot/{repository}"], - "parts": { - "repository": { - "type": "string", - "required" : true, - "description": "A repository name" + "snapshot.create_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Creates a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "verify": { - "type" : "boolean", - "description" : "Whether to verify the repository after creation" - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "verify":{ + "type":"boolean", + "description":"Whether to verify the repository after creation" } }, - "body": { - "description" : "The repository definition", - "required" : true + "body":{ + "description":"The repository definition", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json index ce7235c72d852..30053cd5b94d3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json @@ -1,29 +1,35 @@ { - "snapshot.delete": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/_snapshot/{repository}/{snapshot}"], - "parts": { - "repository": { - "type": "string", - "required" : true, - "description": "A repository name" - }, - "snapshot": { - "type": "string", - "required" : true, - "description": "A snapshot name" - } - }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" + "snapshot.delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Deletes a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "DELETE" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json index 2978a523990f8..b94c5f39b4f22 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json @@ -1,28 +1,35 @@ { - "snapshot.delete_repository": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/_snapshot/{repository}"], - "parts": { - "repository": { - "type": "list", - "required" : true, - "description": "A comma-separated list of repository names" + "snapshot.delete_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Deletes a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}", + "methods":[ + "DELETE" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"A comma-separated list of repository names" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json index a55e00f28c5e4..20006f6f499b6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json @@ -1,37 +1,43 @@ { - "snapshot.get": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_snapshot/{repository}/{snapshot}"], - "parts": { - "repository": { - "type": "string", - "required" : true, - "description": "A repository name" - }, - "snapshot": { - "type": "list", - "required" : true, - "description": "A comma-separated list of snapshot names" + "snapshot.get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Returns information about a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"list", + "description":"A comma-separated list of snapshot names" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "ignore_unavailable": { - "type": "boolean", - "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" - }, - "verbose": { - "type": "boolean", - "description": "Whether to show verbose snapshot info or only show the basic info found in the repository index blob" - } + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + }, + "verbose":{ + "type":"boolean", + "description":"Whether to show verbose snapshot info or only show the basic info found in the repository index blob" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json index bf9462874f92b..8c91caa4fe81f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json @@ -1,27 +1,41 @@ { - "snapshot.get_repository": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_snapshot", "/_snapshot/{repository}"], - "parts": { - "repository": { - "type": "list", - "description": "A comma-separated list of repository names" - } - }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" + "snapshot.get_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Returns information about a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot", + "methods":[ + "GET" + ] }, - "local": { - "type": "boolean", - "description": "Return local information, do not retrieve the state from master node (default: false)" + { + "path":"/_snapshot/{repository}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"A comma-separated list of repository names" + } + } } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json index cc283dcbbd54e..697ea395dcc2b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json @@ -1,37 +1,44 @@ { - "snapshot.restore": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_snapshot/{repository}/{snapshot}/_restore"], - "parts": { - "repository": { - "type": "string", - "required" : true, - "description": "A repository name" - }, - "snapshot": { - "type": "string", - "required" : true, - "description": "A snapshot name" + "snapshot.restore":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Restores a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}/_restore", + "methods":[ + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "wait_for_completion": { - "type": "boolean", - "description": "Should this request wait until the operation has completed before returning", - "default": false - } + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":false } }, - "body" : { - "description" : "Details of what to restore", - "required" : false + "body":{ + "description":"Details of what to restore", + "required":false } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json index 32e09d53ca224..70a7ba23ef506 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json @@ -1,31 +1,57 @@ { - "snapshot.status": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_snapshot/_status", "/_snapshot/{repository}/_status", "/_snapshot/{repository}/{snapshot}/_status"], - "parts": { - "repository": { - "type": "string", - "description": "A repository name" + "snapshot.status":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Returns information about the status of a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/_status", + "methods":[ + "GET" + ] }, - "snapshot": { - "type": "list", - "description": "A comma-separated list of snapshot names" - } - }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" + { + "path":"/_snapshot/{repository}/_status", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } }, - "ignore_unavailable": { - "type": "boolean", - "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + { + "path":"/_snapshot/{repository}/{snapshot}/_status", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"list", + "description":"A comma-separated list of snapshot names" + } + } } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json index 0ca87cd76475d..de638c19d4a0b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json @@ -1,28 +1,35 @@ { - "snapshot.verify_repository": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_snapshot/{repository}/_verify"], - "parts": { - "repository": { - "type": "string", - "required" : true, - "description": "A repository name" - } - }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - } + "snapshot.verify_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Verifies a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/_verify", + "methods":[ + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" } - }, - "body": null + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } } + } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.cancel.json b/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.cancel.json index d747de8dbfc9f..d9d681899868d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.cancel.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.cancel.json @@ -1,31 +1,45 @@ { - "tasks.cancel": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_tasks/_cancel", "/_tasks/{task_id}/_cancel"], - "parts": { - "task_id": { - "type": "string", - "description": "Cancel the task with specified task id (node_id:task_number)" - } - }, - "params": { - "nodes": { - "type": "list", - "description": "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions": { - "type": "list", - "description": "A comma-separated list of actions that should be cancelled. Leave empty to cancel all." + "tasks.cancel":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Cancels a task, if it can be cancelled through an API." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_tasks/_cancel", + "methods":[ + "POST" + ] }, - "parent_task_id": { - "type" : "string", - "description" : "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + { + "path":"/_tasks/{task_id}/_cancel", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"Cancel the task with specified task id (node_id:task_number)" + } + } } - } + ] }, - "body": null + "params":{ + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be cancelled. Leave empty to cancel all." + }, + "parent_task_id":{ + "type":"string", + "description":"Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.get.json index 1e4426ddcdecb..63bd1b6a96e98 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.get.json @@ -1,28 +1,35 @@ { - "tasks.get": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_tasks/{task_id}"], - "parts": { - "task_id": { - "type": "string", - "required" : true, - "description": "Return the task with specified id (node_id:task_number)" + "tasks.get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Returns information about a task." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_tasks/{task_id}", + "methods":[ + "GET" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"Return the task with specified id (node_id:task_number)" + } + } } + ] + }, + "params":{ + "wait_for_completion":{ + "type":"boolean", + "description":"Wait for the matching tasks to complete (default: false)" }, - "params": { - "wait_for_completion": { - "type": "boolean", - "description": "Wait for the matching tasks to complete (default: false)" - }, - "timeout": { - "type": "time", - "description": "Explicit operation timeout" - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } - }, - "body": null + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.list.json b/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.list.json index acc889b2b7212..0aba6d6391d48 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.list.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/tasks.list.json @@ -1,45 +1,55 @@ { - "tasks.list": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_tasks"], - "parts": {}, - "params": { - "nodes": { - "type": "list", - "description": "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions": { - "type": "list", - "description": "A comma-separated list of actions that should be returned. Leave empty to return all." - }, - "detailed": { - "type": "boolean", - "description": "Return detailed task information (default: false)" - }, - "parent_task_id": { - "type" : "string", - "description" : "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." - }, - "wait_for_completion": { - "type": "boolean", - "description": "Wait for the matching tasks to complete (default: false)" - }, - "group_by": { - "type" : "enum", - "description": "Group tasks by nodes or parent/child relationships", - "options" : ["nodes", "parents", "none"], - "default" : "nodes" - }, - "timeout": { - "type": "time", - "description": "Explicit operation timeout" + "tasks.list":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Returns a list of tasks." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_tasks", + "methods":[ + "GET" + ] } - - } + ] }, - "body": null + "params":{ + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be returned. Leave empty to return all." + }, + "detailed":{ + "type":"boolean", + "description":"Return detailed task information (default: false)" + }, + "parent_task_id":{ + "type":"string", + "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Wait for the matching tasks to complete (default: false)" + }, + "group_by":{ + "type":"enum", + "description":"Group tasks by nodes or parent/child relationships", + "options":[ + "nodes", + "parents", + "none" + ], + "default":"nodes" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json b/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json index 066e71b038554..8014535e018b3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json @@ -1,86 +1,113 @@ { - "termvectors" : { - "documentation" : "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html", - "stability": "stable", - "methods" : ["GET", "POST"], - "url" : { - "paths" : ["/{index}/_termvectors/{id}", "/{index}/_termvectors"], - "parts" : { - "index" : { - "type" : "string", - "description" : "The index in which the document resides.", - "required" : true - }, - "id" : { - "type" : "string", - "description" : "The id of the document, when not specified a doc param should be supplied." - } - }, - "params": { - "term_statistics" : { - "type" : "boolean", - "description" : "Specifies if total term frequency and document frequency should be returned.", - "default" : false, - "required" : false - }, - "field_statistics" : { - "type" : "boolean", - "description" : "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", - "default" : true, - "required" : false - }, - "fields" : { - "type" : "list", - "description" : "A comma-separated list of fields to return.", - "required" : false - }, - "offsets" : { - "type" : "boolean", - "description" : "Specifies if term offsets should be returned.", - "default" : true, - "required" : false - }, - "positions" : { - "type" : "boolean", - "description" : "Specifies if term positions should be returned.", - "default" : true, - "required" : false - }, - "payloads" : { - "type" : "boolean", - "description" : "Specifies if term payloads should be returned.", - "default" : true, - "required" : false - }, - "preference" : { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random).", - "required" : false - }, - "routing" : { - "type" : "string", - "description" : "Specific routing value.", - "required" : false - }, - "realtime": { - "type": "boolean", - "description": "Specifies if request is real-time as opposed to near-real-time (default: true).", - "required": false - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" + "termvectors":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html", + "description":"Returns information and statistics about terms in the fields of a particular document." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_termvectors/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + }, + "id":{ + "type":"string", + "description":"The id of the document, when not specified a doc param should be supplied." + } + } }, - "version_type": { - "type" : "enum", - "options" : ["internal", "external", "external_gte", "force"], - "description" : "Specific version type" + { + "path":"/{index}/_termvectors", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + } + } } + ] + }, + "params":{ + "term_statistics":{ + "type":"boolean", + "description":"Specifies if total term frequency and document frequency should be returned.", + "default":false, + "required":false + }, + "field_statistics":{ + "type":"boolean", + "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "default":true, + "required":false + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return.", + "required":false + }, + "offsets":{ + "type":"boolean", + "description":"Specifies if term offsets should be returned.", + "default":true, + "required":false + }, + "positions":{ + "type":"boolean", + "description":"Specifies if term positions should be returned.", + "default":true, + "required":false + }, + "payloads":{ + "type":"boolean", + "description":"Specifies if term payloads should be returned.", + "default":true, + "required":false + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random).", + "required":false + }, + "routing":{ + "type":"string", + "description":"Specific routing value.", + "required":false + }, + "realtime":{ + "type":"boolean", + "description":"Specifies if request is real-time as opposed to near-real-time (default: true).", + "required":false + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" } }, - "body": { - "description" : "Define parameters and or supply a document to get termvectors for. See documentation.", - "required" : false + "body":{ + "description":"Define parameters and or supply a document to get termvectors for. See documentation.", + "required":false } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json index e883b3ffc1eb1..146b25f5160f7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json @@ -1,84 +1,109 @@ { - "update": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/{index}/_update/{id}"], - "deprecated_paths" : [ + "update":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html", + "description":"Updates a document with a script or partial document." + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/{id}/_update", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "Document ID" + "path":"/{index}/_update/{id}", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } }, - "index": { - "type": "string", - "required": true, - "description": "The name of the index" - }, - "type": { - "type": "string", - "description": "The type of the document" + { + "path":"/{index}/{type}/{id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" }, - "params": { - "wait_for_active_shards": { - "type": "string", - "description": "Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "lang": { - "type": "string", - "description": "The script language (default: painless)" - }, - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." - }, - "retry_on_conflict": { - "type": "number", - "description": "Specify how many times should the operation be retried when a conflict occurs (default: 0)" - }, - "routing": { - "type": "string", - "description": "Specific routing value" - }, - "timeout": { - "type": "time", - "description": "Explicit operation timeout" - }, - "if_seq_no" : { - "type" : "number", - "description" : "only perform the update operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term" : { - "type" : "number", - "description" : "only perform the update operation if the last operation that has changed the document has the specified primary term" - } + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "lang":{ + "type":"string", + "description":"The script language (default: painless)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." + }, + "retry_on_conflict":{ + "type":"number", + "description":"Specify how many times should the operation be retried when a conflict occurs (default: 0)" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the update operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the update operation if the last operation that has changed the document has the specified primary term" } }, - "body": { - "description": "The request definition requires either `script` or partial `doc`", - "required": true + "body":{ + "description":"The request definition requires either `script` or partial `doc`", + "required":true } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json index 4048b4a55d962..48bb748430ed5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json @@ -1,172 +1,193 @@ { - "update_by_query": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/{index}/_update_by_query"], - "comment": "most things below this are just copied from search.json", - "parts": { - "index": { - "required" : true, - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + "update_by_query":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html", + "description":"Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_update_by_query", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" }, - "params": { - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "from": { - "type" : "number", - "description" : "Starting offset (default: 0)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "conflicts": { - "note": "This is not copied from search", - "type" : "enum", - "options": ["abort", "proceed"], - "default": "abort", - "description" : "What to do when the update by query hits version conflicts?" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "pipeline": { - "type" : "string", - "description" : "Ingest pipeline to set on index requests made by this action. (default: none)" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "dfs_query_then_fetch"], - "description" : "Search operation type" - }, - "search_timeout": { - "type" : "time", - "description" : "Explicit timeout for each search request. Defaults to no timeout." - }, - "max_docs": { - "type" : "number", - "description" : "Maximum number of documents to process (default: all documents)" - }, - "sort": { - "type" : "list", - "description" : "A comma-separated list of : pairs" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "terminate_after": { - "type" : "number", - "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats": { - "type" : "list", - "description" : "Specific 'tag' of the request for logging and statistical purposes" - }, - "version": { - "type" : "boolean", - "description" : "Specify whether to return document version as part of a hit" - }, - "version_type": { - "type" : "boolean", - "description" : "Should the document increment the version number (internal) on hit or not (reindex)" - }, - "request_cache": { - "type" : "boolean", - "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "refresh": { - "type" : "boolean", - "description" : "Should the effected indexes be refreshed?" - }, - "timeout": { - "type" : "time", - "default": "1m", - "description" : "Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "scroll_size": { - "type": "number", - "defaut_value": 100, - "description": "Size on the scroll request powering the update by query" - }, - "wait_for_completion": { - "type" : "boolean", - "default": true, - "description" : "Should the request should block until the update by query operation is complete." - }, - "requests_per_second": { - "type": "number", - "default": 0, - "description": "The throttle to set on this request in sub-requests per second. -1 means no throttle." - }, - "slices": { - "type": "number", - "default": 1, - "description": "The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." - } + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "conflicts":{ + "note":"This is not copied from search", + "type":"enum", + "options":[ + "abort", + "proceed" + ], + "default":"abort", + "description":"What to do when the update by query hits version conflicts?" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "pipeline":{ + "type":"string", + "description":"Ingest pipeline to set on index requests made by this action. (default: none)" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "search_timeout":{ + "type":"time", + "description":"Explicit timeout for each search request. Defaults to no timeout." + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "version_type":{ + "type":"boolean", + "description":"Should the document increment the version number (internal) on hit or not (reindex)" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "refresh":{ + "type":"boolean", + "description":"Should the effected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "scroll_size":{ + "type":"number", + "defaut_value":100, + "description":"Size on the scroll request powering the update by query" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the update by query operation is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." + }, + "slices":{ + "type":"number", + "default":1, + "description":"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." } }, - "body": { - "description": "The search definition using the Query DSL" + "body":{ + "description":"The search definition using the Query DSL" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query_rethrottle.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query_rethrottle.json index e79f2902329a6..bd70f6e1231c9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query_rethrottle.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query_rethrottle.json @@ -1,25 +1,32 @@ { - "update_by_query_rethrottle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_update_by_query/{task_id}/_rethrottle"], - "parts": { - "task_id": { - "type": "string", - "required" : true, - "description": "The task id to rethrottle" - } - }, - "params": { - "requests_per_second": { - "type": "number", - "required": true, - "description": "The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + "update_by_query_rethrottle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html", + "description":"Changes the number of requests per second for a particular Update By Query operation." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_update_by_query/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } } - } + ] }, - "body": null + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json index dd0be5a379d30..411bc10db946a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json @@ -1,17 +1,24 @@ { - "ccr.delete_auto_follow_pattern": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html", - "stability" : "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ccr/auto_follow/{name}" ], - "parts": { - "name": { - "type": "string", - "required": true, - "description": "The name of the auto follow pattern." + "ccr.delete_auto_follow_pattern":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ccr/auto_follow/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the auto follow pattern." + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow.json index ca7c7e9984ee4..830c3d7e02cb0 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow.json @@ -1,28 +1,35 @@ { - "ccr.follow": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html", - "stability" : "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/{index}/_ccr/follow" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The name of the follower index" - } - }, - "params": { - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)", - "default": "0" + "ccr.follow":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/follow", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the follower index" + } + } } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)", + "default":"0" } }, - "body": { - "description" : "The name of the leader index and other optional ccr related parameters", - "required" : true + "body":{ + "description":"The name of the leader index and other optional ccr related parameters", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_info.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_info.json index e2dcd8e83080c..dbe5f53f24783 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_info.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_info.json @@ -1,16 +1,24 @@ { - "ccr.follow_info": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html", - "stability" : "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/{index}/_ccr/info" ], - "parts": { - "index": { - "type": "list", - "description": "A comma-separated list of index patterns; use `_all` to perform the operation on all indices" + "ccr.follow_info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/info", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index patterns; use `_all` to perform the operation on all indices" + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_stats.json index 6901a39baf7b3..aecfd50a6a90d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.follow_stats.json @@ -1,17 +1,24 @@ { - "ccr.follow_stats": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html", - "stability" : "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/{index}/_ccr/stats" ], - "parts": { - "index": { - "type": "list", - "required" : true, - "description": "A comma-separated list of index patterns; use `_all` to perform the operation on all indices" + "ccr.follow_stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/stats", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index patterns; use `_all` to perform the operation on all indices" + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.forget_follower.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.forget_follower.json index 843a5760e2ca8..477ab10ce274d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.forget_follower.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.forget_follower.json @@ -1,21 +1,28 @@ { - "ccr.forget_follower": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current", - "stability" : "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/{index}/_ccr/forget_follower" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "the name of the leader index for which specified follower retention leases should be removed" + "ccr.forget_follower":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/forget_follower", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"the name of the leader index for which specified follower retention leases should be removed" + } + } } - } + ] }, - "body": { - "description" : "the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index", - "required" : true + "body":{ + "description":"the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.get_auto_follow_pattern.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.get_auto_follow_pattern.json index 2511e68cb8edd..8d34c1e597116 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.get_auto_follow_pattern.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.get_auto_follow_pattern.json @@ -1,16 +1,30 @@ { - "ccr.get_auto_follow_pattern": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html", - "stability" : "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_ccr/auto_follow", "/_ccr/auto_follow/{name}" ], - "parts": { - "name": { - "type": "string", - "description": "The name of the auto follow pattern." + "ccr.get_auto_follow_pattern":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ccr/auto_follow", + "methods":[ + "GET" + ] + }, + { + "path":"/_ccr/auto_follow/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the auto follow pattern." + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.pause_follow.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.pause_follow.json index ff30da5d9ac22..54b4576575987 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.pause_follow.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.pause_follow.json @@ -1,17 +1,24 @@ { - "ccr.pause_follow": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html", - "stability" : "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/{index}/_ccr/pause_follow" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The name of the follower index that should pause following its leader index." + "ccr.pause_follow":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/pause_follow", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the follower index that should pause following its leader index." + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json index 91a26268ce568..7edcb62903158 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json @@ -1,21 +1,28 @@ { - "ccr.put_auto_follow_pattern": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html", - "stability" : "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ccr/auto_follow/{name}" ], - "parts": { - "name": { - "type": "string", - "required": true, - "description": "The name of the auto follow pattern." + "ccr.put_auto_follow_pattern":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ccr/auto_follow/{name}", + "methods":[ + "PUT" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the auto follow pattern." + } + } } - } + ] }, - "body": { - "description" : "The specification of the auto follow pattern", - "required" : true + "body":{ + "description":"The specification of the auto follow pattern", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.resume_follow.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.resume_follow.json index 3c4481a7d7ee0..c6b3135fd7f3c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.resume_follow.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.resume_follow.json @@ -1,21 +1,28 @@ { - "ccr.resume_follow": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html", - "stability" : "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/{index}/_ccr/resume_follow" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The name of the follow index to resume following." + "ccr.resume_follow":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/resume_follow", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the follow index to resume following." + } + } } - } + ] }, - "body": { - "description" : "The name of the leader index and other optional ccr related parameters", - "required" : false + "body":{ + "description":"The name of the leader index and other optional ccr related parameters", + "required":false } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.stats.json index ab96a395efc2d..fcf36bf188ae3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.stats.json @@ -1,12 +1,18 @@ { - "ccr.stats": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html", - "stability" : "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_ccr/stats" ], - "parts": {}, - "body": null + "ccr.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ccr/stats", + "methods":[ + "GET" + ] + } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.unfollow.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.unfollow.json index 0c68018319b09..71df50f2d10e3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.unfollow.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ccr.unfollow.json @@ -1,17 +1,24 @@ { - "ccr.unfollow": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current", - "stability" : "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/{index}/_ccr/unfollow" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The name of the follower index that should be turned into a regular index." + "ccr.unfollow":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ccr/unfollow", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the follower index that should be turned into a regular index." + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.delete_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.delete_data_frame_transform.json index accb791320b91..5c09d1b60b60b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.delete_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.delete_data_frame_transform.json @@ -1,27 +1,31 @@ { - "data_frame.delete_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html", - "stability": "beta", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_data_frame/transforms/{transform_id}" - ], - "parts": { - "transform_id": { - "type": "string", - "required": true, - "description": "The id of the transform to delete" - } - }, - "params": { - "force": { - "type": "boolean", - "required": false, - "description": "When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted." + "data_frame.delete_data_frame_transform":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html" + }, + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/{transform_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "transform_id":{ + "type":"string", + "description":"The id of the transform to delete" + } + } } - } + ] }, - "body": null + "params":{ + "force":{ + "type":"boolean", + "required":false, + "description":"When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform.json index fc89a524081c8..812648c5fb152 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform.json @@ -1,35 +1,47 @@ { - "data_frame.get_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html", - "stability": "beta", - "methods": [ "GET" ], - "url": { - "paths": [ "/_data_frame/transforms/{transform_id}", "/_data_frame/transforms"], - "parts": { - "transform_id": { - "type": "string", - "required": false, - "description": "The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms" - } - }, - "params": { - "from": { - "type": "int", - "required": false, - "description": "skips a number of transform configs, defaults to 0" - }, - "size": { - "type": "int", - "required": false, - "description": "specifies a max number of transforms to get, defaults to 100" + "data_frame.get_data_frame_transform":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html" + }, + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/{transform_id}", + "methods":[ + "GET" + ], + "parts":{ + "transform_id":{ + "type":"string", + "description":"The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms" + } + } }, - "allow_no_match": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)" + { + "path":"/_data_frame/transforms", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "from":{ + "type":"int", + "required":false, + "description":"skips a number of transform configs, defaults to 0" + }, + "size":{ + "type":"int", + "required":false, + "description":"specifies a max number of transforms to get, defaults to 100" + }, + "allow_no_match":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform_stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform_stats.json index e04cb4d0b0637..61083d1fd7873 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform_stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.get_data_frame_transform_stats.json @@ -1,35 +1,41 @@ { - "data_frame.get_data_frame_transform_stats": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html", - "stability": "beta", - "methods": [ "GET" ], - "url": { - "paths": [ "/_data_frame/transforms/{transform_id}/_stats" ], - "parts": { - "transform_id": { - "type": "string", - "required": false, - "description": "The id of the transform for which to get stats. '_all' or '*' implies all transforms" + "data_frame.get_data_frame_transform_stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html" + }, + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/{transform_id}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "transform_id":{ + "type":"string", + "description":"The id of the transform for which to get stats. '_all' or '*' implies all transforms" + } + } } + ] + }, + "params":{ + "from":{ + "type":"number", + "required":false, + "description":"skips a number of transform stats, defaults to 0" }, - "params": { - "from": { - "type": "number", - "required": false, - "description": "skips a number of transform stats, defaults to 0" - }, - "size": { - "type": "number", - "required": false, - "description": "specifies a max number of transform stats to get, defaults to 100" - }, - "allow_no_match": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)" - } + "size":{ + "type":"number", + "required":false, + "description":"specifies a max number of transform stats to get, defaults to 100" + }, + "allow_no_match":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)" } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.preview_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.preview_data_frame_transform.json index bbfcf61640c43..a0d585c203a9f 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.preview_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.preview_data_frame_transform.json @@ -1,14 +1,22 @@ { - "data_frame.preview_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html", - "stability": "beta", - "methods": [ "POST" ], - "url": { - "paths": [ "/_data_frame/transforms/_preview" ] + "data_frame.preview_data_frame_transform":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html" }, - "body": { - "description" : "The definition for the data_frame transform to preview", - "required": true + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/_preview", + "methods":[ + "POST" + ] + } + ] + }, + "body":{ + "description":"The definition for the data_frame transform to preview", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json index 69f740c059b95..5e283c2a4a3e8 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json @@ -1,28 +1,28 @@ { - "data_frame.put_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html", - "stability": "beta", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_data_frame/transforms/{transform_id}" ], - "parts": { - "transform_id": { - "type": "string", - "required": true, - "description": "The id of the new transform." - } - }, - "params": { - "defer_validation": { - "type": "boolean", - "required": false, - "description": "If validations should be deferred until data frame transform starts, defaults to false." + "data_frame.put_data_frame_transform":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html" + }, + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/{transform_id}", + "methods":[ + "PUT" + ], + "parts":{ + "transform_id":{ + "type":"string", + "description":"The id of the new transform." + } + } } - } + ] }, - "body": { - "description" : "The data frame transform definition", - "required": true + "body":{ + "description":"The data frame transform definition", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.start_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.start_data_frame_transform.json index 0a1368514f1f8..b2e4997ebbe1e 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.start_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.start_data_frame_transform.json @@ -1,25 +1,31 @@ { - "data_frame.start_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html", - "stability": "beta", - "methods": [ "POST" ], - "url": { - "paths": [ "/_data_frame/transforms/{transform_id}/_start" ], - "parts": { - "transform_id": { - "type": "string", - "required": true, - "description": "The id of the transform to start" - } - }, - "params": { - "timeout": { - "type": "time", - "required": false, - "description": "Controls the time to wait for the transform to start" + "data_frame.start_data_frame_transform":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html" + }, + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/{transform_id}/_start", + "methods":[ + "POST" + ], + "parts":{ + "transform_id":{ + "type":"string", + "description":"The id of the transform to start" + } + } } - } + ] }, - "body": null + "params":{ + "timeout":{ + "type":"time", + "required":false, + "description":"Controls the time to wait for the transform to start" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.stop_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.stop_data_frame_transform.json index 0eb4452bc7091..af0c35b156390 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.stop_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.stop_data_frame_transform.json @@ -1,35 +1,41 @@ { - "data_frame.stop_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html", - "stability": "beta", - "methods": [ "POST" ], - "url": { - "paths": [ "/_data_frame/transforms/{transform_id}/_stop" ], - "parts": { - "transform_id": { - "type": "string", - "required": true, - "description": "The id of the transform to stop" + "data_frame.stop_data_frame_transform":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html" + }, + "stability":"beta", + "url":{ + "paths":[ + { + "path":"/_data_frame/transforms/{transform_id}/_stop", + "methods":[ + "POST" + ], + "parts":{ + "transform_id":{ + "type":"string", + "description":"The id of the transform to stop" + } + } } + ] + }, + "params":{ + "wait_for_completion":{ + "type":"boolean", + "required":false, + "description":"Whether to wait for the transform to fully stop before returning or not. Default to false" }, - "params": { - "wait_for_completion": { - "type": "boolean", - "required": false, - "description": "Whether to wait for the transform to fully stop before returning or not. Default to false" - }, - "timeout": { - "type": "time", - "required": false, - "description": "Controls the time to wait until the transform has stopped. Default to 30 seconds" - }, - "allow_no_match": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)" - } + "timeout":{ + "type":"time", + "required":false, + "description":"Controls the time to wait until the transform has stopped. Default to 30 seconds" + }, + "allow_no_match":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no data frame transforms. (This includes `_all` string or when no data frame transforms have been specified)" } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json index 4c82edadca339..aa8177bb8621d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json @@ -1,40 +1,60 @@ { - "graph.explore": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": ["/{index}/_graph/explore"], - "deprecated_paths" : [ + "graph.explore":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html" + }, + "stability":"stable", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/{index}/{type}/_graph/explore", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts" : { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + "path":"/{index}/_graph/explore", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types" + { + "path":"/{index}/{type}/_graph/explore", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types to search; leave empty to perform the operation on all types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "routing":{ + "type":"string", + "description":"Specific routing value" }, - "params": { - "routing": { - "type" : "string", - "description" : "Specific routing value" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - } + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" } }, - "body": { - "description" : "Graph Query DSL" + "body":{ + "description":"Graph Query DSL" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.delete_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.delete_lifecycle.json index 1abbc0a1b6ba0..50c15a9b6ee1b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.delete_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.delete_lifecycle.json @@ -1,19 +1,25 @@ { - "ilm.delete_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": ["/_ilm/policy/{policy}"], - "parts": { - "policy": { - "type" : "string", - "description" : "The name of the index lifecycle policy" + "ilm.delete_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/policy/{policy}", + "methods":[ + "DELETE" + ], + "parts":{ + "policy":{ + "type":"string", + "description":"The name of the index lifecycle policy" + } + } } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json index 9b80525946fca..9919547466e73 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json @@ -1,27 +1,25 @@ { - "ilm.explain_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": ["/{index}/_ilm/explain"], - "parts": { - "index": { - "type" : "string", - "description" : "The name of the index to explain" - } - }, - "params": { - "only_managed": { - "type": "boolean", - "description": "filters the indices included in the response to ones managed by ILM" - }, - "only_errors": { - "type": "boolean", - "description": "filters the indices included in the response to ones in an ILM error state, implies only_managed" + "ilm.explain_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ilm/explain", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to explain" + } + } } - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_lifecycle.json index 174e99059a7e2..231748795613b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_lifecycle.json @@ -1,19 +1,31 @@ { - "ilm.get_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": ["/_ilm/policy/{policy}", "/_ilm/policy"], - "parts": { - "policy": { - "type" : "string", - "description" : "The name of the index lifecycle policy" + "ilm.get_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/policy/{policy}", + "methods":[ + "GET" + ], + "parts":{ + "policy":{ + "type":"string", + "description":"The name of the index lifecycle policy" + } + } + }, + { + "path":"/_ilm/policy", + "methods":[ + "GET" + ] } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_status.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_status.json index 864a010c89e36..0e94c22596965 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_status.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.get_status.json @@ -1,13 +1,19 @@ { - "ilm.get_status": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": ["/_ilm/status"], - "parts": {}, - "params": {} + "ilm.get_status":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/status", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.move_to_step.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.move_to_step.json index bb8d6ec54a08f..1f46cd2e0053d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.move_to_step.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.move_to_step.json @@ -1,22 +1,28 @@ { - "ilm.move_to_step": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html", - "stability": "stable", - "description": "Triggers execution of a specific step in the lifecycle policy. Since this action is designed to only be run in emergency situations, clients should not implement this API", - "methods": [ "POST" ], - "url": { - "paths": ["/_ilm/move/{index}"], - "parts": { - "index": { - "type" : "string", - "description" : "The name of the index whose lifecycle step is to change" + "ilm.move_to_step":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/move/{index}", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index whose lifecycle step is to change" + } + } } - }, - "params": { - } + ] }, - "body": { - "description": "The new lifecycle step to move to" + "params":{}, + "body":{ + "description":"The new lifecycle step to move to" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.put_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.put_lifecycle.json index 7e97c46b69440..b33521cf5127d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.put_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.put_lifecycle.json @@ -1,21 +1,28 @@ { - "ilm.put_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html", - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": ["/_ilm/policy/{policy}"], - "parts": { - "policy": { - "type" : "string", - "description" : "The name of the index lifecycle policy" + "ilm.put_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/policy/{policy}", + "methods":[ + "PUT" + ], + "parts":{ + "policy":{ + "type":"string", + "description":"The name of the index lifecycle policy" + } + } } - }, - "params": { - } + ] }, - "body": { - "description": "The lifecycle policy definition to register" + "params":{}, + "body":{ + "description":"The lifecycle policy definition to register" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.remove_policy.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.remove_policy.json index 82c05d5560e67..f2b843017e671 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.remove_policy.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.remove_policy.json @@ -1,19 +1,25 @@ { - "ilm.remove_policy": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": ["/{index}/_ilm/remove"], - "parts": { - "index": { - "type" : "string", - "description" : "The name of the index to remove policy on" + "ilm.remove_policy":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ilm/remove", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to remove policy on" + } + } } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.retry.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.retry.json index cf9b8a30cf14b..c25a84521405c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.retry.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.retry.json @@ -1,19 +1,25 @@ { - "ilm.retry": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": ["/{index}/_ilm/retry"], - "parts": { - "index": { - "type" : "string", - "description" : "The name of the indices (comma-separated) whose failed lifecycle step is to be retry" + "ilm.retry":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_ilm/retry", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the indices (comma-separated) whose failed lifecycle step is to be retry" + } + } } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.start.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.start.json index c13f860b9e748..f6dd48beac5c7 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.start.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.start.json @@ -1,13 +1,19 @@ { - "ilm.start": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": ["/_ilm/start"], - "parts": {}, - "params": {} + "ilm.start":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/start", + "methods":[ + "POST" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.stop.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.stop.json index bee334e9f0b42..c49bbf327db30 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.stop.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.stop.json @@ -1,13 +1,19 @@ { - "ilm.stop": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": ["/_ilm/stop"], - "parts": {}, - "params": {} + "ilm.stop":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ilm/stop", + "methods":[ + "POST" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.freeze.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.freeze.json index 0f3d4d70239e0..620ce4b0a375b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.freeze.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.freeze.json @@ -1,48 +1,57 @@ { - "indices.freeze": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ - "/{index}/_freeze" - ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The name of the index to freeze" + "indices.freeze":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_freeze", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to freeze" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "closed", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of active shards to wait for before the operation returns." - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"closed", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.reload_search_analyzers.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.reload_search_analyzers.json index bd79dbf4718f5..a62634046483c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.reload_search_analyzers.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.reload_search_analyzers.json @@ -1,33 +1,46 @@ { - "indices.reload_search_analyzers": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html", - "stability": "experimental", - "methods": ["GET", "POST"], - "url": { - "paths": ["/{index}/_reload_search_analyzers"], - "parts": { - "index": { - "type": "list", - "description" : "A comma-separated list of index names to reload analyzers for" + "indices.reload_search_analyzers":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/{index}/_reload_search_analyzers", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to reload analyzers for" + } + } } - }, - "params": { - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "open", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - }, - "body": null + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.unfreeze.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.unfreeze.json index f8fb93a4401bb..79ff51a6947b9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.unfreeze.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/indices.unfreeze.json @@ -1,46 +1,57 @@ { - "indices.unfreeze": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/{index}/_unfreeze" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The name of the index to unfreeze" + "indices.unfreeze":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_unfreeze", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to unfreeze" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards": { - "type" : "enum", - "options" : ["open","closed","none","all"], - "default" : "closed", - "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of active shards to wait for before the operation returns." - } + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"closed", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.delete.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.delete.json index f5a6c28c8a323..9c369c384c2fd 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.delete.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.delete.json @@ -1,12 +1,18 @@ { - "license.delete": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html", - "stability": "stable", - "methods": ["DELETE"], - "url": { - "paths": ["/_license"], - "parts" : {} + "license.delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license", + "methods":[ + "DELETE" + ] + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json index 84d506783d695..0e917208c1bbf 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json @@ -1,19 +1,24 @@ { - "license.get": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_license"], - "parts" : { - }, - "params": { - "local": { - "type" : "boolean", - "description" : "Return local information, do not retrieve the state from master node (default: false)" + "license.get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_basic_status.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_basic_status.json index dcf8e01837fed..b3d10f1e1c088 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_basic_status.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_basic_status.json @@ -1,15 +1,19 @@ { - "license.get_basic_status": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_license/basic_status"], - "parts" : { - }, - "params": { - } + "license.get_basic_status":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license/basic_status", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } -} \ No newline at end of file +} diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_trial_status.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_trial_status.json index d8d3489d0cf54..072608982da91 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_trial_status.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get_trial_status.json @@ -1,15 +1,19 @@ { - "license.get_trial_status": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html", - "stability": "stable", - "methods": ["GET"], - "url": { - "paths": ["/_license/trial_status"], - "parts" : { - }, - "params": { - } + "license.get_trial_status":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license/trial_status", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } -} \ No newline at end of file +} diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post.json index 39cf43b03dc44..4b53ebeaa72a9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post.json @@ -1,21 +1,28 @@ { - "license.post": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html", - "stability": "stable", - "methods": ["PUT", "POST"], - "url": { - "paths": ["/_license"], - "parts" : { - }, - "params": { - "acknowledge": { - "type" : "boolean", - "description" : "whether the user has acknowledged acknowledge messages (default: false)" + "license.post":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license", + "methods":[ + "PUT", + "POST" + ] } + ] + }, + "params":{ + "acknowledge":{ + "type":"boolean", + "description":"whether the user has acknowledged acknowledge messages (default: false)" } }, - "body": { - "description" : "licenses to be installed" + "body":{ + "description":"licenses to be installed" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_basic.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_basic.json index b0da3724eac60..3aa928ec15034 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_basic.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_basic.json @@ -1,19 +1,24 @@ { - "license.post_start_basic": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_license/start_basic"], - "parts" : { - }, - "params": { - "acknowledge": { - "type" : "boolean", - "description" : "whether the user has acknowledged acknowledge messages (default: false)" + "license.post_start_basic":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license/start_basic", + "methods":[ + "POST" + ] } - } + ] }, - "body": null + "params":{ + "acknowledge":{ + "type":"boolean", + "description":"whether the user has acknowledged acknowledge messages (default: false)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_trial.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_trial.json index 89dbf30e7a3af..a28b45dc8dea5 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_trial.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.post_start_trial.json @@ -1,23 +1,28 @@ { - "license.post_start_trial": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html", - "stability": "stable", - "methods": ["POST"], - "url": { - "paths": ["/_license/start_trial"], - "parts" : { - }, - "params": { - "type": { - "type" : "string", - "description" : "The type of trial license to generate (default: \"trial\")" - }, - "acknowledge": { - "type" : "boolean", - "description" : "whether the user has acknowledged acknowledge messages (default: false)" + "license.post_start_trial":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_license/start_trial", + "methods":[ + "POST" + ] } - } + ] }, - "body": null + "params":{ + "type":{ + "type":"string", + "description":"The type of trial license to generate (default: \"trial\")" + }, + "acknowledge":{ + "type":"boolean", + "description":"whether the user has acknowledged acknowledge messages (default: false)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/migration.deprecations.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/migration.deprecations.json index ffba21b5f5ae6..5d7d231bd703e 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/migration.deprecations.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/migration.deprecations.json @@ -1,19 +1,31 @@ { - "migration.deprecations": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": ["/_migration/deprecations", "/{index}/_migration/deprecations"], - "parts": { - "index": { - "type" : "string", - "description" : "Index pattern" + "migration.deprecations":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_migration/deprecations", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_migration/deprecations", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Index pattern" + } + } } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.close_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.close_job.json index f8aef2814a335..54a5f7dd44f97 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.close_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.close_job.json @@ -1,37 +1,44 @@ { - "ml.close_job": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/_close" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The name of the job to close" + "ml.close_job":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_close", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The name of the job to close" + } + } } + ] + }, + "params":{ + "allow_no_jobs":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" }, - "params": { - "allow_no_jobs": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" - }, - "force": { - "type": "boolean", - "required": false, - "description": "True if the job should be forcefully closed" - }, - "timeout": { - "type": "time", - "description": "Controls the time to wait until a job has closed. Default to 30 minutes" - } + "force":{ + "type":"boolean", + "required":false, + "description":"True if the job should be forcefully closed" + }, + "timeout":{ + "type":"time", + "description":"Controls the time to wait until a job has closed. Default to 30 minutes" } }, - "body": { - "description" : "The URL params optionally sent in the body", - "required": false + "body":{ + "description":"The URL params optionally sent in the body", + "required":false } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar.json index 5c414f56a19a3..4614965a098c3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar.json @@ -1,17 +1,24 @@ { - "ml.delete_calendar": { - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/calendars/{calendar_id}" ], - "parts": { - "calendar_id": { - "type" : "string", - "required" : true, - "description" : "The ID of the calendar to delete" - } - } + "ml.delete_calendar":{ + "documentation":{ + "url":null }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to delete" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_event.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_event.json index 38e49841c01d1..a6b70a1427882 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_event.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_event.json @@ -1,22 +1,28 @@ { - "ml.delete_calendar_event": { - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/calendars/{calendar_id}/events/{event_id}" ], - "parts": { - "calendar_id": { - "type" : "string", - "required" : true, - "description" : "The ID of the calendar to modify" - }, - "event_id": { - "type": "string", - "required": true, - "description": "The ID of the event to remove from the calendar" - } - } + "ml.delete_calendar_event":{ + "documentation":{ + "url":null }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}/events/{event_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to modify" + }, + "event_id":{ + "type":"string", + "description":"The ID of the event to remove from the calendar" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_job.json index 8a78a850da413..5d88f42b7641a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_calendar_job.json @@ -1,22 +1,28 @@ { - "ml.delete_calendar_job": { - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/calendars/{calendar_id}/jobs/{job_id}" ], - "parts": { - "calendar_id": { - "type" : "string", - "required" : true, - "description" : "The ID of the calendar to modify" - }, - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to remove from the calendar" - } - } + "ml.delete_calendar_job":{ + "documentation":{ + "url":null }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}/jobs/{job_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to modify" + }, + "job_id":{ + "type":"string", + "description":"The ID of the job to remove from the calendar" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_data_frame_analytics.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_data_frame_analytics.json index f5db2405df7ba..bb2101765c75c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_data_frame_analytics.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_data_frame_analytics.json @@ -1,19 +1,24 @@ { - "ml.delete_data_frame_analytics": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html", - "stability": "experimental", - "methods": [ "DELETE" ], - "url": { - "path": "/_ml/data_frame/analytics/{id}", - "paths": [ "/_ml/data_frame/analytics/{id}" ], - "parts": { - "id": { - "type" : "string", - "required" : true, - "description" : "The ID of the data frame analytics to delete" - } - } + "ml.delete_data_frame_analytics":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html" }, - "body": null + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics to delete" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_datafeed.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_datafeed.json index 9208c099a7324..08d3f8dfcf6e4 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_datafeed.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_datafeed.json @@ -1,25 +1,31 @@ { - "ml.delete_datafeed": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/datafeeds/{datafeed_id}" ], - "parts": { - "datafeed_id": { - "type": "string", - "required": true, - "description": "The ID of the datafeed to delete" - } - }, - "params": { - "force": { - "type": "boolean", - "required": false, - "description": "True if the datafeed should be forcefully deleted" + "ml.delete_datafeed":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeed to delete" + } + } } - } + ] }, - "body": null + "params":{ + "force":{ + "type":"boolean", + "required":false, + "description":"True if the datafeed should be forcefully deleted" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_expired_data.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_expired_data.json index 838d986ba4142..598cad6b0bc33 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_expired_data.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_expired_data.json @@ -1,11 +1,18 @@ { - "ml.delete_expired_data": { - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/_delete_expired_data" ], - "parts": {} + "ml.delete_expired_data":{ + "documentation":{ + "url":null }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/_delete_expired_data", + "methods":[ + "DELETE" + ] + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_filter.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_filter.json index 15a3dac18a98a..bcb0fe310b9a6 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_filter.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_filter.json @@ -1,17 +1,24 @@ { - "ml.delete_filter": { - "methods": [ "DELETE" ], - "stability": "stable", - "url": { - "paths": [ "/_ml/filters/{filter_id}" ], - "parts": { - "filter_id": { - "type" : "string", - "required" : true, - "description" : "The ID of the filter to delete" - } - } + "ml.delete_filter":{ + "documentation":{ + "url":null }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/filters/{filter_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "filter_id":{ + "type":"string", + "description":"The ID of the filter to delete" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_forecast.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_forecast.json index d048858c75dd6..31cd0f5b58948 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_forecast.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_forecast.json @@ -1,38 +1,52 @@ { - "ml.delete_forecast": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/_forecast", - "/_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}" - ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job from which to delete forecasts" + "ml.delete_forecast":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_forecast", + "methods":[ + "DELETE" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job from which to delete forecasts" + } + } }, - "forecast_id": { - "type": "string", - "required": false, - "description": "The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all`" + { + "path":"/_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job from which to delete forecasts" + }, + "forecast_id":{ + "type":"string", + "description":"The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all`" + } + } } + ] + }, + "params":{ + "allow_no_forecasts":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if `_all` matches no forecasts" }, - "params": { - "allow_no_forecasts": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if `_all` matches no forecasts" - }, - "timeout": { - "type": "time", - "requred": false, - "description": "Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds" - } + "timeout":{ + "type":"time", + "requred":false, + "description":"Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds" } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_job.json index 2d1220324b91e..680a0ab8ffdff 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_job.json @@ -1,30 +1,36 @@ { - "ml.delete_job": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to delete" + "ml.delete_job":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to delete" + } + } } + ] + }, + "params":{ + "force":{ + "type":"boolean", + "description":"True if the job should be forcefully deleted", + "default":false }, - "params": { - "force": { - "type": "boolean", - "description": "True if the job should be forcefully deleted", - "default": false - }, - "wait_for_completion": { - "type": "boolean", - "description": "Should this request wait until the operation has completed before returning", - "default": true - } + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":true } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_model_snapshot.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_model_snapshot.json index 5c4d2bfbcb8aa..d333ade6525e3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_model_snapshot.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_model_snapshot.json @@ -1,23 +1,28 @@ { - "ml.delete_model_snapshot": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to fetch" - }, - "snapshot_id": { - "type": "string", - "required": true, - "description": "The ID of the snapshot to delete" - } - } + "ml.delete_model_snapshot":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to fetch" + }, + "snapshot_id":{ + "type":"string", + "description":"The ID of the snapshot to delete" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.evaluate_data_frame.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.evaluate_data_frame.json index 416887c003dbb..02beee73f8691 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.evaluate_data_frame.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.evaluate_data_frame.json @@ -1,16 +1,22 @@ { - "ml.evaluate_data_frame": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html", - "stability": "experimental", - "methods": [ "POST" ], - "url": { - "path": "/_ml/data_frame/_evaluate", - "paths": [ "/_ml/data_frame/_evaluate" ], - "parts": {} + "ml.evaluate_data_frame":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html" }, - "body": { - "description" : "The evaluation definition", - "required" : true + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/_evaluate", + "methods":[ + "POST" + ] + } + ] + }, + "body":{ + "description":"The evaluation definition", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.find_file_structure.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.find_file_structure.json index afab9575f7251..c761a2c94a7f1 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.find_file_structure.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.find_file_structure.json @@ -1,78 +1,91 @@ { - "ml.find_file_structure": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html", - "stability" : "experimental", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/find_file_structure" ], - "params": { - "lines_to_sample": { - "type": "int", - "description": "How many lines of the file should be included in the analysis", - "default": 1000 - }, - "line_merge_size_limit": { - "type": "int", - "description": "Maximum number of characters permitted in a single message when lines are merged to create messages.", - "default": 10000 - }, - "timeout": { - "type": "time", - "description": "Timeout after which the analysis will be aborted", - "default": "25s" - }, - "charset": { - "type": "string", - "description": "Optional parameter to specify the character set of the file" - }, - "format": { - "type": "enum", - "options": [ "ndjson", "xml", "delimited", "semi_structured_text" ], - "description": "Optional parameter to specify the high level file format" - }, - "has_header_row": { - "type": "boolean", - "description": "Optional parameter to specify whether a delimited file includes the column names in its first row" - }, - "column_names": { - "type": "list", - "description": "Optional parameter containing a comma separated list of the column names for a delimited file" - }, - "delimiter": { - "type": "string", - "description": "Optional parameter to specify the delimiter character for a delimited file - must be a single character" - }, - "quote": { - "type": "string", - "description": "Optional parameter to specify the quote character for a delimited file - must be a single character" - }, - "should_trim_fields": { - "type": "boolean", - "description": "Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them" - }, - "grok_pattern": { - "type": "string", - "description": "Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file" - }, - "timestamp_field": { - "type": "string", - "description": "Optional parameter to specify the timestamp field in the file" - }, - "timestamp_format": { - "type": "string", - "description": "Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format" - }, - "explain": { - "type": "boolean", - "description": "Whether to include a commentary on how the structure was derived", - "default": false + "ml.find_file_structure":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/find_file_structure", + "methods":[ + "POST" + ] } + ] + }, + "params":{ + "lines_to_sample":{ + "type":"int", + "description":"How many lines of the file should be included in the analysis", + "default":1000 + }, + "line_merge_size_limit":{ + "type":"int", + "description":"Maximum number of characters permitted in a single message when lines are merged to create messages.", + "default":10000 + }, + "timeout":{ + "type":"time", + "description":"Timeout after which the analysis will be aborted", + "default":"25s" + }, + "charset":{ + "type":"string", + "description":"Optional parameter to specify the character set of the file" + }, + "format":{ + "type":"enum", + "options":[ + "ndjson", + "xml", + "delimited", + "semi_structured_text" + ], + "description":"Optional parameter to specify the high level file format" + }, + "has_header_row":{ + "type":"boolean", + "description":"Optional parameter to specify whether a delimited file includes the column names in its first row" + }, + "column_names":{ + "type":"list", + "description":"Optional parameter containing a comma separated list of the column names for a delimited file" + }, + "delimiter":{ + "type":"string", + "description":"Optional parameter to specify the delimiter character for a delimited file - must be a single character" + }, + "quote":{ + "type":"string", + "description":"Optional parameter to specify the quote character for a delimited file - must be a single character" + }, + "should_trim_fields":{ + "type":"boolean", + "description":"Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them" + }, + "grok_pattern":{ + "type":"string", + "description":"Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file" + }, + "timestamp_field":{ + "type":"string", + "description":"Optional parameter to specify the timestamp field in the file" + }, + "timestamp_format":{ + "type":"string", + "description":"Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format" + }, + "explain":{ + "type":"boolean", + "description":"Whether to include a commentary on how the structure was derived", + "default":false } }, - "body": { - "description" : "The contents of the file to be analyzed", - "required" : true, - "serialize" : "bulk" + "body":{ + "description":"The contents of the file to be analyzed", + "required":true, + "serialize":"bulk" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.flush_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.flush_job.json index 8cc83b7beb234..413ff32b95526 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.flush_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.flush_job.json @@ -1,44 +1,49 @@ { - "ml.flush_job": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/_flush" - ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The name of the job to flush" + "ml.flush_job":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_flush", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The name of the job to flush" + } + } } + ] + }, + "params":{ + "calc_interim":{ + "type":"boolean", + "description":"Calculates interim results for the most recent bucket or all buckets within the latency period" }, - "params": { - "calc_interim": { - "type": "boolean", - "description": "Calculates interim results for the most recent bucket or all buckets within the latency period" - }, - "start": { - "type": "string", - "description": "When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results" - }, - "end": { - "type": "string", - "description": "When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results" - }, - "advance_time": { - "type": "string", - "description": "Advances time to the given value generating results and updating the model for the advanced interval" - }, - "skip_time": { - "type": "string", - "description": "Skips time to the given value without generating results or updating the model for the skipped interval" - } + "start":{ + "type":"string", + "description":"When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results" + }, + "end":{ + "type":"string", + "description":"When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results" + }, + "advance_time":{ + "type":"string", + "description":"Advances time to the given value generating results and updating the model for the advanced interval" + }, + "skip_time":{ + "type":"string", + "description":"Skips time to the given value without generating results or updating the model for the skipped interval" } }, - "body": { - "description": "Flush parameters" + "body":{ + "description":"Flush parameters" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.forecast.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.forecast.json index 18b808372e91d..71475feb6f921 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.forecast.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.forecast.json @@ -1,29 +1,36 @@ { - "ml.forecast": { - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/_forecast" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to forecast for" + "ml.forecast":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_forecast", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to forecast for" + } + } } + ] + }, + "params":{ + "duration":{ + "type":"time", + "required":false, + "description":"The duration of the forecast" }, - "params": { - "duration": { - "type": "time", - "required": false, - "description": "The duration of the forecast" - }, - "expires_in": { - "type": "time", - "required": false, - "description": "The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity." - } + "expires_in":{ + "type":"time", + "required":false, + "description":"The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity." } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_buckets.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_buckets.json index 953d1c40c7eb5..752147dbcd5ff 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_buckets.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_buckets.json @@ -1,65 +1,83 @@ { - "ml.get_buckets": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}", - "/_ml/anomaly_detectors/{job_id}/results/buckets" - ], - "parts": { - "job_id": { - "type" : "string", - "required": true, - "description": "ID of the job to get bucket results from" + "ml.get_buckets":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"ID of the job to get bucket results from" + }, + "timestamp":{ + "type":"string", + "description":"The timestamp of the desired single bucket result" + } + } }, - "timestamp": { - "type" : "string", - "description" : "The timestamp of the desired single bucket result" + { + "path":"/_ml/anomaly_detectors/{job_id}/results/buckets", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"ID of the job to get bucket results from" + } + } } + ] + }, + "params":{ + "expand":{ + "type":"boolean", + "description":"Include anomaly records" }, - "params": { - "expand": { - "type": "boolean", - "description" : "Include anomaly records" - }, - "exclude_interim": { - "type": "boolean", - "description" : "Exclude interim results" - }, - "from": { - "type": "int", - "description": "skips a number of buckets" - }, - "size": { - "type": "int", - "description": "specifies a max number of buckets to get" - }, - "start": { - "type": "string", - "description" : "Start time filter for buckets" - }, - "end": { - "type": "string", - "description" : "End time filter for buckets" - }, - "anomaly_score": { - "type": "double", - "description": "Filter for the most anomalous buckets" - }, - "sort": { - "type": "string", - "description": "Sort buckets by a particular field" - }, - "desc": { - "type": "boolean", - "description": "Set the sort direction" - } + "exclude_interim":{ + "type":"boolean", + "description":"Exclude interim results" + }, + "from":{ + "type":"int", + "description":"skips a number of buckets" + }, + "size":{ + "type":"int", + "description":"specifies a max number of buckets to get" + }, + "start":{ + "type":"string", + "description":"Start time filter for buckets" + }, + "end":{ + "type":"string", + "description":"End time filter for buckets" + }, + "anomaly_score":{ + "type":"double", + "description":"Filter for the most anomalous buckets" + }, + "sort":{ + "type":"string", + "description":"Sort buckets by a particular field" + }, + "desc":{ + "type":"boolean", + "description":"Set the sort direction" } }, - "body": { - "description" : "Bucket selection details if not provided in URI" + "body":{ + "description":"Bucket selection details if not provided in URI" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendar_events.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendar_events.json index 5bc126db3dcf6..f0f57b05ef1fd 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendar_events.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendar_events.json @@ -1,41 +1,46 @@ { - "ml.get_calendar_events": { - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_ml/calendars/{calendar_id}/events" - ], - "parts": { - "calendar_id": { - "type": "string", - "description": "The ID of the calendar containing the events", - "required": true + "ml.get_calendar_events":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}/events", + "methods":[ + "GET" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar containing the events" + } + } } + ] + }, + "params":{ + "job_id":{ + "type":"string", + "description":"Get events for the job. When this option is used calendar_id must be '_all'" }, - "params": { - "job_id": { - "type": "string", - "description": "Get events for the job. When this option is used calendar_id must be '_all'" - }, - "start": { - "type": "string", - "description": "Get events after this time" - }, - "end": { - "type": "date", - "description": "Get events before this time" - }, - "from": { - "type": "int", - "description": "Skips a number of events" - }, - "size": { - "type": "int", - "description": "Specifies a max number of events to get" - } + "start":{ + "type":"string", + "description":"Get events after this time" + }, + "end":{ + "type":"date", + "description":"Get events before this time" + }, + "from":{ + "type":"int", + "description":"Skips a number of events" + }, + "size":{ + "type":"int", + "description":"Specifies a max number of events to get" } - }, - "body": null + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendars.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendars.json index de8cd034a4065..d863f83387520 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendars.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendars.json @@ -1,31 +1,45 @@ { - "ml.get_calendars": { - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ - "/_ml/calendars", - "/_ml/calendars/{calendar_id}" - ], - "parts": { - "calendar_id": { - "type": "string", - "description": "The ID of the calendar to fetch" - } - }, - "params": { - "from": { - "type": "int", - "description": "skips a number of calendars" + "ml.get_calendars":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars", + "methods":[ + "GET", + "POST" + ] }, - "size": { - "type": "int", - "description": "specifies a max number of calendars to get" + { + "path":"/_ml/calendars/{calendar_id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to fetch" + } + } } + ] + }, + "params":{ + "from":{ + "type":"int", + "description":"skips a number of calendars" + }, + "size":{ + "type":"int", + "description":"specifies a max number of calendars to get" } }, - "body": { - "description": "The from and size parameters optionally sent in the body" + "body":{ + "description":"The from and size parameters optionally sent in the body" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_categories.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_categories.json index 74d0b1dd97120..4a34611c065b9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_categories.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_categories.json @@ -1,37 +1,55 @@ { - "ml.get_categories": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/results/categories/{category_id}", - "/_ml/anomaly_detectors/{job_id}/results/categories/" - ], - "parts": { - "job_id": { - "type" : "string", - "required": true, - "description": "The name of the job" + "ml.get_categories":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/results/categories/{category_id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The name of the job" + }, + "category_id":{ + "type":"long", + "description":"The identifier of the category definition of interest" + } + } }, - "category_id": { - "type" : "long", - "description" : "The identifier of the category definition of interest" + { + "path":"/_ml/anomaly_detectors/{job_id}/results/categories/", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The name of the job" + } + } } + ] + }, + "params":{ + "from":{ + "type":"int", + "description":"skips a number of categories" }, - "params": { - "from": { - "type": "int", - "description": "skips a number of categories" - }, - "size": { - "type": "int", - "description": "specifies a max number of categories to get" - } + "size":{ + "type":"int", + "description":"specifies a max number of categories to get" } }, - "body": { - "description" : "Category selection details if not provided in URI" + "body":{ + "description":"Category selection details if not provided in URI" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics.json index c42e36737e907..f18ef68a135e6 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics.json @@ -1,39 +1,48 @@ { - "ml.get_data_frame_analytics": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html", - "stability": "experimental", - "methods": [ "GET"], - "url": { - "path": "/_ml/data_frame/analytics/{id}", - "paths": [ - "/_ml/data_frame/analytics/{id}", - "/_ml/data_frame/analytics" - ], - "parts": { - "id": { - "type": "string", - "description": "The ID of the data frame analytics to fetch" - } - }, - "params": { - "allow_no_match": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)", - "default": true - }, - "from": { - "type": "int", - "description": "skips a number of analytics", - "default": 0 + "ml.get_data_frame_analytics":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics to fetch" + } + } }, - "size": { - "type": "int", - "description": "specifies a max number of analytics to get", - "default": 100 + { + "path":"/_ml/data_frame/analytics", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "allow_no_match":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)", + "default":true + }, + "from":{ + "type":"int", + "description":"skips a number of analytics", + "default":0 + }, + "size":{ + "type":"int", + "description":"specifies a max number of analytics to get", + "default":100 + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics_stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics_stats.json index f8fad160f8911..c028144216765 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics_stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_data_frame_analytics_stats.json @@ -1,39 +1,48 @@ { - "ml.get_data_frame_analytics_stats": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html", - "stability": "experimental", - "methods": [ "GET"], - "url": { - "path": "/_ml/data_frame/analytics/{id}/_stats", - "paths": [ - "/_ml/data_frame/analytics/_stats", - "/_ml/data_frame/analytics/{id}/_stats" - ], - "parts": { - "id": { - "type": "string", - "description": "The ID of the data frame analytics stats to fetch" - } - }, - "params": { - "allow_no_match": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)", - "default": true - }, - "from": { - "type": "int", - "description": "skips a number of analytics", - "default": 0 + "ml.get_data_frame_analytics_stats":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/_stats", + "methods":[ + "GET" + ] }, - "size": { - "type": "int", - "description": "specifies a max number of analytics to get", - "default": 100 + { + "path":"/_ml/data_frame/analytics/{id}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics stats to fetch" + } + } } - } + ] }, - "body": null + "params":{ + "allow_no_match":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)", + "default":true + }, + "from":{ + "type":"int", + "description":"skips a number of analytics", + "default":0 + }, + "size":{ + "type":"int", + "description":"specifies a max number of analytics to get", + "default":100 + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeed_stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeed_stats.json index d3ec06b88518c..e41f2b6cd4878 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeed_stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeed_stats.json @@ -1,27 +1,37 @@ { - "ml.get_datafeed_stats": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html", - "stability": "stable", - "methods": [ "GET"], - "url": { - "paths": [ - "/_ml/datafeeds/{datafeed_id}/_stats", - "/_ml/datafeeds/_stats" - ], - "parts": { - "datafeed_id": { - "type": "string", - "description": "The ID of the datafeeds stats to fetch" - } - }, - "params": { - "allow_no_datafeeds": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" + "ml.get_datafeed_stats":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeeds stats to fetch" + } + } + }, + { + "path":"/_ml/datafeeds/_stats", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "allow_no_datafeeds":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeeds.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeeds.json index befcd94d93059..833abd0ce218a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeeds.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_datafeeds.json @@ -1,27 +1,37 @@ { - "ml.get_datafeeds": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html", - "stability": "stable", - "methods": [ "GET"], - "url": { - "paths": [ - "/_ml/datafeeds/{datafeed_id}", - "/_ml/datafeeds" - ], - "parts": { - "datafeed_id": { - "type": "string", - "description": "The ID of the datafeeds to fetch" - } - }, - "params": { - "allow_no_datafeeds": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" + "ml.get_datafeeds":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}", + "methods":[ + "GET" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeeds to fetch" + } + } + }, + { + "path":"/_ml/datafeeds", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "allow_no_datafeeds":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_filters.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_filters.json index f788776275cb3..20672c04b900e 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_filters.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_filters.json @@ -1,26 +1,40 @@ { - "ml.get_filters": { - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_ml/filters", "/_ml/filters/{filter_id}" ], - "parts": { - "filter_id": { - "type" : "string", - "description" : "The ID of the filter to fetch" - } - }, - "params": { - "from": { - "type": "int", - "description": "skips a number of filters" + "ml.get_filters":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/filters", + "methods":[ + "GET" + ] }, - "size": { - "type": "int", - "description": "specifies a max number of filters to get" + { + "path":"/_ml/filters/{filter_id}", + "methods":[ + "GET" + ], + "parts":{ + "filter_id":{ + "type":"string", + "description":"The ID of the filter to fetch" + } + } } - } + ] }, - "body": null + "params":{ + "from":{ + "type":"int", + "description":"skips a number of filters" + }, + "size":{ + "type":"int", + "description":"specifies a max number of filters to get" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_influencers.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_influencers.json index 987551fa52a61..cd25f852ded37 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_influencers.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_influencers.json @@ -1,53 +1,61 @@ { - "ml.get_influencers": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/results/influencers" ], - "parts": { - "job_id": { - "type" : "string", - "required": true + "ml.get_influencers":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/results/influencers", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string" + } + } } + ] + }, + "params":{ + "exclude_interim":{ + "type":"boolean", + "description":"Exclude interim results" }, - "params": { - "exclude_interim": { - "type": "boolean", - "description" : "Exclude interim results" - }, - "from": { - "type": "int", - "description": "skips a number of influencers" - }, - "size": { - "type": "int", - "description": "specifies a max number of influencers to get" - }, - "start": { - "type": "string", - "description": "start timestamp for the requested influencers" - }, - "end": { - "type": "string", - "description": "end timestamp for the requested influencers" - }, - "influencer_score": { - "type": "double", - "description": "influencer score threshold for the requested influencers" - }, - "sort": { - "type": "string", - "description": "sort field for the requested influencers" - }, - "desc": { - "type": "boolean", - "description": "whether the results should be sorted in decending order" - } + "from":{ + "type":"int", + "description":"skips a number of influencers" + }, + "size":{ + "type":"int", + "description":"specifies a max number of influencers to get" + }, + "start":{ + "type":"string", + "description":"start timestamp for the requested influencers" + }, + "end":{ + "type":"string", + "description":"end timestamp for the requested influencers" + }, + "influencer_score":{ + "type":"double", + "description":"influencer score threshold for the requested influencers" + }, + "sort":{ + "type":"string", + "description":"sort field for the requested influencers" + }, + "desc":{ + "type":"boolean", + "description":"whether the results should be sorted in decending order" } }, - "body": { - "description": "Influencer selection criteria" + "body":{ + "description":"Influencer selection criteria" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_job_stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_job_stats.json index 8a29b68eca29f..2e02f0e718fae 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_job_stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_job_stats.json @@ -1,27 +1,37 @@ { - "ml.get_job_stats": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html", - "stability": "stable", - "methods": [ "GET"], - "url": { - "paths": [ - "/_ml/anomaly_detectors/_stats", - "/_ml/anomaly_detectors/{job_id}/_stats" - ], - "parts": { - "job_id": { - "type": "string", - "description": "The ID of the jobs stats to fetch" - } - }, - "params": { - "allow_no_jobs": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" + "ml.get_job_stats":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/_stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_ml/anomaly_detectors/{job_id}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the jobs stats to fetch" + } + } } - } + ] }, - "body": null + "params":{ + "allow_no_jobs":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_jobs.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_jobs.json index c57d977898ef7..55b12755194ce 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_jobs.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_jobs.json @@ -1,27 +1,37 @@ { - "ml.get_jobs": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html", - "stability": "stable", - "methods": [ "GET"], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}", - "/_ml/anomaly_detectors" - ], - "parts": { - "job_id": { - "type": "string", - "description": "The ID of the jobs to fetch" - } - }, - "params": { - "allow_no_jobs": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" + "ml.get_jobs":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}", + "methods":[ + "GET" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the jobs to fetch" + } + } + }, + { + "path":"/_ml/anomaly_detectors", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "allow_no_jobs":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_model_snapshots.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_model_snapshots.json index 42dca88ea2107..9d78b1c4036c4 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_model_snapshots.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_model_snapshots.json @@ -1,53 +1,71 @@ { - "ml.get_model_snapshots": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}", - "/_ml/anomaly_detectors/{job_id}/model_snapshots" - ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to fetch" + "ml.get_model_snapshots":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to fetch" + }, + "snapshot_id":{ + "type":"string", + "description":"The ID of the snapshot to fetch" + } + } }, - "snapshot_id": { - "type": "string", - "description": "The ID of the snapshot to fetch" + { + "path":"/_ml/anomaly_detectors/{job_id}/model_snapshots", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to fetch" + } + } } + ] + }, + "params":{ + "from":{ + "type":"int", + "description":"Skips a number of documents" }, - "params": { - "from": { - "type": "int", - "description": "Skips a number of documents" - }, - "size": { - "type": "int", - "description": "The default number of documents returned in queries as a string." - }, - "start": { - "type": "date", - "description": "The filter 'start' query parameter" - }, - "end": { - "type": "date", - "description": "The filter 'end' query parameter" - }, - "sort": { - "type": "string", - "description": "Name of the field to sort on" - }, - "desc": { - "type": "boolean", - "description": "True if the results should be sorted in descending order" - } + "size":{ + "type":"int", + "description":"The default number of documents returned in queries as a string." + }, + "start":{ + "type":"date", + "description":"The filter 'start' query parameter" + }, + "end":{ + "type":"date", + "description":"The filter 'end' query parameter" + }, + "sort":{ + "type":"string", + "description":"Name of the field to sort on" + }, + "desc":{ + "type":"boolean", + "description":"True if the results should be sorted in descending order" } }, - "body": { - "description": "Model snapshot selection criteria" + "body":{ + "description":"Model snapshot selection criteria" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_overall_buckets.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_overall_buckets.json index c0d9f5202535a..7f306abc5d547 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_overall_buckets.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_overall_buckets.json @@ -1,52 +1,58 @@ { - "ml.get_overall_buckets": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/results/overall_buckets" - ], - "parts": { - "job_id": { - "type" : "string", - "required": true, - "description": "The job IDs for which to calculate overall bucket results" + "ml.get_overall_buckets":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/results/overall_buckets", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The job IDs for which to calculate overall bucket results" + } + } } + ] + }, + "params":{ + "top_n":{ + "type":"int", + "description":"The number of top job bucket scores to be used in the overall_score calculation" }, - "params": { - "top_n": { - "type": "int", - "description": "The number of top job bucket scores to be used in the overall_score calculation" - }, - "bucket_span": { - "type": "string", - "description": "The span of the overall buckets. Defaults to the longest job bucket_span" - }, - "overall_score": { - "type": "double", - "description": "Returns overall buckets with overall scores higher than this value" - }, - "exclude_interim": { - "type": "boolean", - "description" : "If true overall buckets that include interim buckets will be excluded" - }, - "start": { - "type": "string", - "description" : "Returns overall buckets with timestamps after this time" - }, - "end": { - "type": "string", - "description" : "Returns overall buckets with timestamps earlier than this time" - }, - "allow_no_jobs": { - "type": "boolean", - "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" - } + "bucket_span":{ + "type":"string", + "description":"The span of the overall buckets. Defaults to the longest job bucket_span" + }, + "overall_score":{ + "type":"double", + "description":"Returns overall buckets with overall scores higher than this value" + }, + "exclude_interim":{ + "type":"boolean", + "description":"If true overall buckets that include interim buckets will be excluded" + }, + "start":{ + "type":"string", + "description":"Returns overall buckets with timestamps after this time" + }, + "end":{ + "type":"string", + "description":"Returns overall buckets with timestamps earlier than this time" + }, + "allow_no_jobs":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" } }, - "body": { - "description" : "Overall bucket selection details if not provided in URI" + "body":{ + "description":"Overall bucket selection details if not provided in URI" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_records.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_records.json index 51316c63a8848..20ea450e2bccd 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_records.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_records.json @@ -1,54 +1,60 @@ { - "ml.get_records": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html", - "stability": "stable", - "methods": ["GET", "POST"], - "url": { - "paths": [ - "/_ml/anomaly_detectors/{job_id}/results/records" - ], - "parts": { - "job_id": { - "type": "string", - "required": true + "ml.get_records":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/results/records", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "job_id":{ + "type":"string" + } + } } + ] + }, + "params":{ + "exclude_interim":{ + "type":"boolean", + "description":"Exclude interim results" }, - "params": { - "exclude_interim": { - "type": "boolean", - "description": "Exclude interim results" - }, - "from": { - "type": "int", - "description": "skips a number of records" - }, - "size": { - "type": "int", - "description": "specifies a max number of records to get" - }, - "start": { - "type": "string", - "description": "Start time filter for records" - }, - "end": { - "type": "string", - "description": "End time filter for records" - }, - "record_score": { - "type": "double" - }, - "sort": { - "type": "string", - "description": "Sort records by a particular field" - }, - "desc": { - "type": "boolean", - "description": "Set the sort direction" - } + "from":{ + "type":"int", + "description":"skips a number of records" + }, + "size":{ + "type":"int", + "description":"specifies a max number of records to get" + }, + "start":{ + "type":"string", + "description":"Start time filter for records" + }, + "end":{ + "type":"string", + "description":"End time filter for records" + }, + "record_score":{ + "type":"double" + }, + "sort":{ + "type":"string", + "description":"Sort records by a particular field" + }, + "desc":{ + "type":"boolean", + "description":"Set the sort direction" } }, - "body": { - "description": "Record selection criteria" + "body":{ + "description":"Record selection criteria" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.info.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.info.json index 2ee848a7f4323..5fa134e1781b3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.info.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.info.json @@ -1,11 +1,18 @@ { - "ml.info": { - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_ml/info" ], - "parts": {}, - "body": null + "ml.info":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/info", + "methods":[ + "GET" + ] + } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.open_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.open_job.json index 1bfcdeaefc338..86e5d7c15f98c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.open_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.open_job.json @@ -1,26 +1,24 @@ { - "ml.open_job": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/_open" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to open" - }, - "ignore_downtime": { - "type": "boolean", - "description": "Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start" - }, - "timeout": { - "type": "time", - "description": "Controls the time to wait until a job has opened. Default to 30 minutes" - } - } + "ml.open_job":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_open", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to open" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_calendar_events.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_calendar_events.json index e3a857fca6b3e..3bb25c4eaa683 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_calendar_events.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_calendar_events.json @@ -1,20 +1,28 @@ { - "ml.post_calendar_events": { - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/calendars/{calendar_id}/events" ], - "parts": { - "calendar_id": { - "type": "string", - "required": true, - "description": "The ID of the calendar to modify" + "ml.post_calendar_events":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}/events", + "methods":[ + "POST" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to modify" + } + } } - } + ] }, - "body": { - "description" : "A list of events", - "required" : true + "body":{ + "description":"A list of events", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_data.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_data.json index dfc00fc67a055..6df25d89ca0a9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_data.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.post_data.json @@ -1,32 +1,39 @@ { - "ml.post_data": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/_data" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The name of the job receiving the data" + "ml.post_data":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_data", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The name of the job receiving the data" + } + } } + ] + }, + "params":{ + "reset_start":{ + "type":"string", + "description":"Optional parameter to specify the start of the bucket resetting range" }, - "params": { - "reset_start": { - "type": "string", - "description": "Optional parameter to specify the start of the bucket resetting range" - }, - "reset_end": { - "type": "string", - "description": "Optional parameter to specify the end of the bucket resetting range" - } + "reset_end":{ + "type":"string", + "description":"Optional parameter to specify the end of the bucket resetting range" } }, - "body": { - "description" : "The data to process", - "required" : true, - "serialize" : "bulk" + "body":{ + "description":"The data to process", + "required":true, + "serialize":"bulk" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.preview_datafeed.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.preview_datafeed.json index 1afabb5c0dc9f..53c7d5da63ed5 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.preview_datafeed.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.preview_datafeed.json @@ -1,18 +1,24 @@ { - "ml.preview_datafeed": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_ml/datafeeds/{datafeed_id}/_preview" ], - "parts": { - "datafeed_id": { - "type": "string", - "required": true, - "description": "The ID of the datafeed to preview" - } - } + "ml.preview_datafeed":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}/_preview", + "methods":[ + "GET" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeed to preview" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar.json index b03a3011123ad..57c5b3769ce6e 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar.json @@ -1,20 +1,28 @@ { - "ml.put_calendar": { - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ml/calendars/{calendar_id}" ], - "parts": { - "calendar_id": { - "type": "string", - "required": true, - "description": "The ID of the calendar to create" + "ml.put_calendar":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}", + "methods":[ + "PUT" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to create" + } + } } - } + ] }, - "body": { - "description" : "The calendar details", - "required" : false + "body":{ + "description":"The calendar details", + "required":false } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar_job.json index f69733accc8b1..f10a9a438465a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_calendar_job.json @@ -1,22 +1,28 @@ { - "ml.put_calendar_job": { - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ml/calendars/{calendar_id}/jobs/{job_id}" ], - "parts": { - "calendar_id": { - "type": "string", - "required": true, - "description": "The ID of the calendar to modify" - }, - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to add to the calendar" - } - } + "ml.put_calendar_job":{ + "documentation":{ + "url":null }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/calendars/{calendar_id}/jobs/{job_id}", + "methods":[ + "PUT" + ], + "parts":{ + "calendar_id":{ + "type":"string", + "description":"The ID of the calendar to modify" + }, + "job_id":{ + "type":"string", + "description":"The ID of the job to add to the calendar" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_data_frame_analytics.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_data_frame_analytics.json index c7566a42ae05f..8643ddcf5fdd3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_data_frame_analytics.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_data_frame_analytics.json @@ -1,22 +1,28 @@ { - "ml.put_data_frame_analytics": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html", - "stability": "experimental", - "methods": [ "PUT" ], - "url": { - "path": "/_ml/data_frame/analytics/{id}", - "paths": [ "/_ml/data_frame/analytics/{id}" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the data frame analytics to create" + "ml.put_data_frame_analytics":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/{id}", + "methods":[ + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics to create" + } + } } - } + ] }, - "body": { - "description" : "The data frame analytics configuration", - "required" : true + "body":{ + "description":"The data frame analytics configuration", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_datafeed.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_datafeed.json index 8523584d604f3..9b97884c2fdbe 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_datafeed.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_datafeed.json @@ -1,21 +1,28 @@ { - "ml.put_datafeed": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html", - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ml/datafeeds/{datafeed_id}" ], - "parts": { - "datafeed_id": { - "type": "string", - "required": true, - "description": "The ID of the datafeed to create" + "ml.put_datafeed":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}", + "methods":[ + "PUT" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeed to create" + } + } } - } + ] }, - "body": { - "description" : "The datafeed config", - "required" : true + "body":{ + "description":"The datafeed config", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_filter.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_filter.json index 0f5e1849eef33..f5d6c476a4cbc 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_filter.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_filter.json @@ -1,20 +1,28 @@ { - "ml.put_filter": { - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ml/filters/{filter_id}" ], - "parts": { - "filter_id": { - "type": "string", - "required": true, - "description": "The ID of the filter to create" + "ml.put_filter":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/filters/{filter_id}", + "methods":[ + "PUT" + ], + "parts":{ + "filter_id":{ + "type":"string", + "description":"The ID of the filter to create" + } + } } - } + ] }, - "body": { - "description" : "The filter details", - "required" : true + "body":{ + "description":"The filter details", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_job.json index c0296e577c116..ee4235acfdac6 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.put_job.json @@ -1,21 +1,28 @@ { - "ml.put_job": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html", - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to create" + "ml.put_job":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}", + "methods":[ + "PUT" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to create" + } + } } - } + ] }, - "body": { - "description" : "The job", - "required" : true + "body":{ + "description":"The job", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.revert_model_snapshot.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.revert_model_snapshot.json index d9ca8902d276a..04251661f1763 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.revert_model_snapshot.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.revert_model_snapshot.json @@ -1,31 +1,37 @@ { - "ml.revert_model_snapshot": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to fetch" - }, - "snapshot_id": { - "type": "string", - "required": true, - "description": "The ID of the snapshot to revert to" - } - }, - "params": { - "delete_intervening_results": { - "type": "boolean", - "description": "Should we reset the results back to the time of the snapshot?" + "ml.revert_model_snapshot":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to fetch" + }, + "snapshot_id":{ + "type":"string", + "description":"The ID of the snapshot to revert to" + } + } } + ] + }, + "params":{ + "delete_intervening_results":{ + "type":"boolean", + "description":"Should we reset the results back to the time of the snapshot?" } }, - "body": { - "description": "Reversion options" + "body":{ + "description":"Reversion options" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.set_upgrade_mode.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.set_upgrade_mode.json index dc0f167798b61..8d477f8e15eee 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.set_upgrade_mode.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.set_upgrade_mode.json @@ -1,21 +1,28 @@ { - "ml.set_upgrade_mode": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/set_upgrade_mode" ], - "params": { - "enabled": { - "type": "boolean", - "description": "Whether to enable upgrade_mode ML setting or not. Defaults to false." - }, - "timeout": { - "type": "time", - "description": "Controls the time to wait before action times out. Defaults to 30 seconds" + "ml.set_upgrade_mode":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/set_upgrade_mode", + "methods":[ + "POST" + ] } - } + ] }, - "body": null + "params":{ + "enabled":{ + "type":"boolean", + "description":"Whether to enable upgrade_mode ML setting or not. Defaults to false." + }, + "timeout":{ + "type":"time", + "description":"Controls the time to wait before action times out. Defaults to 30 seconds" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_data_frame_analytics.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_data_frame_analytics.json index a6c5f30854082..138e1d120d431 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_data_frame_analytics.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_data_frame_analytics.json @@ -1,28 +1,34 @@ { - "ml.start_data_frame_analytics": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html", - "stability": "experimental", - "methods": [ "POST" ], - "url": { - "path": "/_ml/data_frame/analytics/{id}/_start", - "paths": [ "/_ml/data_frame/analytics/{id}/_start" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the data frame analytics to start" - } - }, - "params": { - "timeout": { - "type": "time", - "required": false, - "description": "Controls the time to wait until the task has started. Defaults to 20 seconds" + "ml.start_data_frame_analytics":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/{id}/_start", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics to start" + } + } } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "required":false, + "description":"Controls the time to wait until the task has started. Defaults to 20 seconds" } }, - "body": { - "description": "The start data frame analytics parameters" + "body":{ + "description":"The start data frame analytics parameters" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_datafeed.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_datafeed.json index 545f43085e36f..73cc79d76bf79 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_datafeed.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.start_datafeed.json @@ -1,37 +1,44 @@ { - "ml.start_datafeed": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/datafeeds/{datafeed_id}/_start" ], - "parts": { - "datafeed_id": { - "type": "string", - "required": true, - "description": "The ID of the datafeed to start" + "ml.start_datafeed":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}/_start", + "methods":[ + "POST" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeed to start" + } + } } + ] + }, + "params":{ + "start":{ + "type":"string", + "required":false, + "description":"The start time from where the datafeed should begin" }, - "params": { - "start": { - "type": "string", - "required": false, - "description": "The start time from where the datafeed should begin" - }, - "end": { - "type": "string", - "required": false, - "description": "The end time when the datafeed should stop. When not set, the datafeed continues in real time" - }, - "timeout": { - "type": "time", - "required": false, - "description": "Controls the time to wait until a datafeed has started. Default to 20 seconds" - } + "end":{ + "type":"string", + "required":false, + "description":"The end time when the datafeed should stop. When not set, the datafeed continues in real time" + }, + "timeout":{ + "type":"time", + "required":false, + "description":"Controls the time to wait until a datafeed has started. Default to 20 seconds" } }, - "body": { - "description": "The start datafeed parameters" + "body":{ + "description":"The start datafeed parameters" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_data_frame_analytics.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_data_frame_analytics.json index d90479bac60bd..fbf832fa04fce 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_data_frame_analytics.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_data_frame_analytics.json @@ -1,38 +1,44 @@ { - "ml.stop_data_frame_analytics": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html", - "stability": "experimental", - "methods": [ "POST" ], - "url": { - "path": "/_ml/data_frame/analytics/{id}/_stop", - "paths": [ "/_ml/data_frame/analytics/{id}/_stop" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the data frame analytics to stop" + "ml.stop_data_frame_analytics":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_ml/data_frame/analytics/{id}/_stop", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the data frame analytics to stop" + } + } } + ] + }, + "params":{ + "allow_no_match":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)" }, - "params": { - "allow_no_match": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)" - }, - "force": { - "type": "boolean", - "required": false, - "description": "True if the data frame analytics should be forcefully stopped" - }, - "timeout": { - "type": "time", - "required": false, - "description": "Controls the time to wait until the task has stopped. Defaults to 20 seconds" - } + "force":{ + "type":"boolean", + "required":false, + "description":"True if the data frame analytics should be forcefully stopped" + }, + "timeout":{ + "type":"time", + "required":false, + "description":"Controls the time to wait until the task has stopped. Defaults to 20 seconds" } }, - "body": { - "description": "The stop data frame analytics parameters" + "body":{ + "description":"The stop data frame analytics parameters" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_datafeed.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_datafeed.json index 5774c08be588d..649ae78925be6 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_datafeed.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.stop_datafeed.json @@ -1,37 +1,41 @@ { - "ml.stop_datafeed": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ - "/_ml/datafeeds/{datafeed_id}/_stop" - ], - "parts": { - "datafeed_id": { - "type": "string", - "required": true, - "description": "The ID of the datafeed to stop" + "ml.stop_datafeed":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}/_stop", + "methods":[ + "POST" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeed to stop" + } + } } + ] + }, + "params":{ + "allow_no_datafeeds":{ + "type":"boolean", + "required":false, + "description":"Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" }, - "params": { - "allow_no_datafeeds": { - "type": "boolean", - "required": false, - "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" - }, - "force": { - "type": "boolean", - "required": false, - "description": "True if the datafeed should be forcefully stopped." - }, - "timeout": { - "type": "time", - "required": false, - "description": "Controls the time to wait until a datafeed has stopped. Default to 20 seconds" - } + "force":{ + "type":"boolean", + "required":false, + "description":"True if the datafeed should be forcefully stopped." }, - "body": null + "timeout":{ + "type":"time", + "required":false, + "description":"Controls the time to wait until a datafeed has stopped. Default to 20 seconds" + } } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_datafeed.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_datafeed.json index 2585a7096ddd0..bd5fe028509cc 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_datafeed.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_datafeed.json @@ -1,21 +1,28 @@ { - "ml.update_datafeed": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/datafeeds/{datafeed_id}/_update" ], - "parts": { - "datafeed_id": { - "type": "string", - "required": true, - "description": "The ID of the datafeed to update" + "ml.update_datafeed":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/datafeeds/{datafeed_id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "datafeed_id":{ + "type":"string", + "description":"The ID of the datafeed to update" + } + } } - } + ] }, - "body": { - "description" : "The datafeed update settings", - "required" : true + "body":{ + "description":"The datafeed update settings", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_filter.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_filter.json index 3576b1f924cd8..f6f155b04eead 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_filter.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_filter.json @@ -1,20 +1,28 @@ { - "ml.update_filter": { - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/filters/{filter_id}/_update" ], - "parts": { - "filter_id": { - "type": "string", - "required": true, - "description": "The ID of the filter to update" + "ml.update_filter":{ + "documentation":{ + "url":null + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/filters/{filter_id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "filter_id":{ + "type":"string", + "description":"The ID of the filter to update" + } + } } - } + ] }, - "body": { - "description" : "The filter update", - "required" : true + "body":{ + "description":"The filter update", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_job.json index a153547a5a84e..3fef58cfde328 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_job.json @@ -1,21 +1,28 @@ { - "ml.update_job": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/_update" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to create" + "ml.update_job":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to create" + } + } } - } + ] }, - "body": { - "description" : "The job update settings", - "required" : true + "body":{ + "description":"The job update settings", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_model_snapshot.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_model_snapshot.json index 8486aee217b3f..b1315716b984b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_model_snapshot.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.update_model_snapshot.json @@ -1,27 +1,33 @@ { - "ml.update_model_snapshot": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update" ], - "parts": { - "job_id": { - "type": "string", - "required": true, - "description": "The ID of the job to fetch" - }, - "snapshot_id": { - "type": "string", - "required": true, - "description": "The ID of the snapshot to update" + "ml.update_model_snapshot":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "job_id":{ + "type":"string", + "description":"The ID of the job to fetch" + }, + "snapshot_id":{ + "type":"string", + "description":"The ID of the snapshot to update" + } + } } - }, - "params": {} + ] }, - "body": { - "description" : "The model snapshot properties to update", - "required" : true + "params":{}, + "body":{ + "description":"The model snapshot properties to update", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json index 9a2ff350c908d..c78d1aad6fd19 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate.json @@ -1,14 +1,23 @@ { - "ml.validate": { - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/_validate" ], - "params": {} + "ml.validate":{ + "documentation":{ + "url":null }, - "body": { - "description" : "The job config", - "required" : true + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/_validate", + "methods":[ + "POST" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The job config", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json index c28817558e5cd..ddb6637931500 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.validate_detector.json @@ -1,14 +1,23 @@ { - "ml.validate_detector": { - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_ml/anomaly_detectors/_validate/detector" ], - "params": {} + "ml.validate_detector":{ + "documentation":{ + "url":null }, - "body": { - "description" : "The detector", - "required" : true + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ml/anomaly_detectors/_validate/detector", + "methods":[ + "POST" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The detector", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json index f84cf6e7bb4f9..3e12be11ba75c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json @@ -1,42 +1,56 @@ { - "monitoring.bulk": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html", - "stability" : "experimental", - "methods": ["POST", "PUT"], - "url": { - "paths": ["/_monitoring/bulk"], - "deprecated_paths" : [ + "monitoring.bulk":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html" + }, + "stability":"experimental", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "/_monitoring/{type}/bulk", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "type": { - "type" : "string", - "description" : "Default document type for items which don't provide one" - } - }, - "params": { - "system_id": { - "type": "string", - "description" : "Identifier of the monitored system" - }, - "system_api_version" : { - "type" : "string", - "description" : "API Version of the monitored system" + "path":"/_monitoring/bulk", + "methods":[ + "POST", + "PUT" + ] }, - "interval": { - "type" : "string", - "description" : "Collection interval (e.g., '10s' or '10000ms') of the payload" + { + "path":"/_monitoring/{type}/bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "system_id":{ + "type":"string", + "description":"Identifier of the monitored system" + }, + "system_api_version":{ + "type":"string", + "description":"API Version of the monitored system" + }, + "interval":{ + "type":"string", + "description":"Collection interval (e.g., '10s' or '10000ms') of the payload" } }, - "body": { - "description" : "The operation definition and data (action-data pairs), separated by newlines", - "required" : true, - "serialize" : "bulk" + "body":{ + "description":"The operation definition and data (action-data pairs), separated by newlines", + "required":true, + "serialize":"bulk" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.delete_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.delete_job.json index ce083b7a0b1f2..6e90cd81efd68 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.delete_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.delete_job.json @@ -1,17 +1,24 @@ { - "rollup.delete_job": { - "documentation": "", - "stability" : "experimental", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_rollup/job/{id}" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the job to delete" + "rollup.delete_job":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rollup/job/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the job to delete" + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_jobs.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_jobs.json index 9c72834a0239d..cf1ae43fafd2b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_jobs.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_jobs.json @@ -1,17 +1,30 @@ { - "rollup.get_jobs": { - "documentation": "", - "stability" : "experimental", - "methods": [ "GET" ], - "url": { - "paths": [ "/_rollup/job/{id}", "/_rollup/job/" ], - "parts": { - "id": { - "type": "string", - "required": false, - "description": "The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs" + "rollup.get_jobs":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rollup/job/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs" + } + } + }, + { + "path":"/_rollup/job/", + "methods":[ + "GET" + ] } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_caps.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_caps.json index 0bf94ca336617..4944a9442cd09 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_caps.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_caps.json @@ -1,17 +1,30 @@ { - "rollup.get_rollup_caps": { - "documentation": "", - "stability" : "experimental", - "methods": [ "GET" ], - "url": { - "paths": [ "/_rollup/data/{id}", "/_rollup/data/" ], - "parts": { - "id": { - "type": "string", - "required": false, - "description": "The ID of the index to check rollup capabilities on, or left blank for all jobs" + "rollup.get_rollup_caps":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rollup/data/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the index to check rollup capabilities on, or left blank for all jobs" + } + } + }, + { + "path":"/_rollup/data/", + "methods":[ + "GET" + ] } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_index_caps.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_index_caps.json index b385cd4341cf5..e6d85ea99eee9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_index_caps.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.get_rollup_index_caps.json @@ -1,17 +1,24 @@ { - "rollup.get_rollup_index_caps": { - "documentation": "", - "stability" : "experimental", - "methods": [ "GET" ], - "url": { - "paths": [ "/{index}/_rollup/data" ], - "parts": { - "index": { - "type": "string", - "required": true, - "description": "The rollup index or index pattern to obtain rollup capabilities from." + "rollup.get_rollup_index_caps":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/{index}/_rollup/data", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The rollup index or index pattern to obtain rollup capabilities from." + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.put_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.put_job.json index 7a792617951f8..0f82970a0c86d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.put_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.put_job.json @@ -1,21 +1,28 @@ { - "rollup.put_job": { - "documentation": "", - "stability" : "experimental", - "methods": [ "PUT" ], - "url": { - "paths": [ "/_rollup/job/{id}" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the job to create" + "rollup.put_job":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rollup/job/{id}", + "methods":[ + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the job to create" + } + } } - } + ] }, - "body": { - "description" : "The job configuration", - "required" : true + "body":{ + "description":"The job configuration", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json index 3de6cbb08de7b..e04ef3e36ed99 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json @@ -1,44 +1,63 @@ { - "rollup.rollup_search": { - "documentation": "", - "stability" : "experimental", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ "{index}/_rollup_search"], - "deprecated_paths" : [ + "rollup.rollup_search":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ { - "version" : "7.0.0", - "path" : "{index}/{type}/_rollup_search", - "description" : "Specifying types in urls has been deprecated" - } - ], - "parts": { - "index": { - "type": "list", - "required": true, - "description": "The indices or index-pattern(s) (containing rollup or regular data) that should be searched" + "path":"{index}/_rollup_search", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"The indices or index-pattern(s) (containing rollup or regular data) that should be searched" + } + } }, - "type": { - "type": "string", - "required": false, - "description": "The doc type inside the index" + { + "path":"{index}/{type}/_rollup_search", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"The indices or index-pattern(s) (containing rollup or regular data) that should be searched" + }, + "type":{ + "type":"string", + "required":false, + "description":"The doc type inside the index", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } } + ] + }, + "params":{ + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" }, - "params": { - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false - } + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false } }, - "body": { - "description" : "The search request body", - "required" : true + "body":{ + "description":"The search request body", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.start_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.start_job.json index 6d77b6c223095..c8d5833e56611 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.start_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.start_job.json @@ -1,17 +1,24 @@ { - "rollup.start_job": { - "documentation": "", - "stability" : "experimental", - "methods": [ "POST" ], - "url": { - "paths": [ "/_rollup/job/{id}/_start" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the job to start" + "rollup.start_job":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rollup/job/{id}/_start", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the job to start" + } + } } - } + ] } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.stop_job.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.stop_job.json index 57ed0d7778e56..46b0212e86adc 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.stop_job.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.stop_job.json @@ -1,28 +1,35 @@ { - "rollup.stop_job": { - "documentation": "", - "stability" : "experimental", - "methods": [ "POST" ], - "url": { - "paths": [ "/_rollup/job/{id}/_stop" ], - "parts": { - "id": { - "type": "string", - "required": true, - "description": "The ID of the job to stop" + "rollup.stop_job":{ + "documentation":{ + "url":"" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rollup/job/{id}/_stop", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The ID of the job to stop" + } + } } + ] + }, + "params":{ + "wait_for_completion":{ + "type":"boolean", + "required":false, + "description":"True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false." }, - "params": { - "wait_for_completion": { - "type": "boolean", - "required": false, - "description": "True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false." - }, - "timeout": { - "type": "time", - "required": false, - "description": "Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s." - } + "timeout":{ + "type":"time", + "required":false, + "description":"Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s." } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.authenticate.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.authenticate.json index 196f27d3e4480..2864641c6ad8d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.authenticate.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.authenticate.json @@ -1,15 +1,19 @@ { - "security.authenticate": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/_authenticate" - ], - "parts": {}, - "params": {} + "security.authenticate":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/_authenticate", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.change_password.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.change_password.json index 073277db9781c..abfc9bb5d21ae 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.change_password.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.change_password.json @@ -1,31 +1,47 @@ { - "security.change_password": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/user/{username}/_password", - "/_security/user/_password" - ], - "parts": { - "username": { - "type" : "string", - "description" : "The username of the user to change the password for", - "required" : false - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.change_password":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/{username}/_password", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "username":{ + "type":"string", + "description":"The username of the user to change the password for" + } + } + }, + { + "path":"/_security/user/_password", + "methods":[ + "PUT", + "POST" + ] } + ] + }, + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." } }, - "body": { - "description" : "the new password for the user", - "required" : true + "body":{ + "description":"the new password for the user", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_realms.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_realms.json index 2e6e5198f7b2f..179e6ea64a467 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_realms.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_realms.json @@ -1,27 +1,31 @@ { - "security.clear_cached_realms": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ - "/_security/realm/{realms}/_clear_cache" - ], - "parts": { - "realms": { - "type" : "list", - "description" : "Comma-separated list of realms to clear", - "required" : true - } - }, - "params": { - "usernames": { - "type" : "list", - "description" : "Comma-separated list of usernames to clear from the cache", - "required" : false + "security.clear_cached_realms":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/realm/{realms}/_clear_cache", + "methods":[ + "POST" + ], + "parts":{ + "realms":{ + "type":"list", + "description":"Comma-separated list of realms to clear" + } + } } - } + ] }, - "body": null + "params":{ + "usernames":{ + "type":"list", + "description":"Comma-separated list of usernames to clear from the cache", + "required":false + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_roles.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_roles.json index f446f55324049..883689ec25f24 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_roles.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.clear_cached_roles.json @@ -1,21 +1,25 @@ { - "security.clear_cached_roles": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ - "/_security/role/{name}/_clear_cache" - ], - "parts": { - "name": { - "type" : "list", - "description" : "Role name", - "required" : true + "security.clear_cached_roles":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role/{name}/_clear_cache", + "methods":[ + "POST" + ], + "parts":{ + "name":{ + "type":"list", + "description":"Role name" + } + } } - }, - "params": {} + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.create_api_key.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.create_api_key.json index 271232f726a06..cc7e9f65f94df 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.create_api_key.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.create_api_key.json @@ -1,22 +1,34 @@ { - "security.create_api_key": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ "/_security/api_key" ], - "parts": {}, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.create_api_key":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/api_key", + "methods":[ + "PUT", + "POST" + ] } + ] + }, + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." } }, - "body": { - "description" : "The api key request to create an API key", - "required" : true + "body":{ + "description":"The api key request to create an API key", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_privileges.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_privileges.json index eecdd8a524248..bf95eae6a2a65 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_privileges.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_privileges.json @@ -1,32 +1,39 @@ { - "security.delete_privileges": { - "documentation": "TODO", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_security/privilege/{application}/{name}" - ], - "parts": { - "application": { - "type" : "string", - "description" : "Application name", - "required" : true - }, - "name": { - "type" : "string", - "description" : "Privilege name", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.delete_privileges":{ + "documentation":{ + "url":"TODO" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/privilege/{application}/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "application":{ + "type":"string", + "description":"Application name" + }, + "name":{ + "type":"string", + "description":"Privilege name" + } + } } - } + ] }, - "body": null + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role.json index d36a2b7b4ce50..1b739912128a0 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role.json @@ -1,27 +1,35 @@ { - "security.delete_role": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_security/role/{name}" - ], - "parts": { - "name": { - "type" : "string", - "description" : "Role name", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.delete_role":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"Role name" + } + } } - } + ] }, - "body": null + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role_mapping.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role_mapping.json index 3c8a43ee3efe3..231390e5daee3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role_mapping.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_role_mapping.json @@ -1,27 +1,35 @@ { - "security.delete_role_mapping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_security/role_mapping/{name}" - ], - "parts": { - "name": { - "type" : "string", - "description" : "Role-mapping name", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.delete_role_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role_mapping/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"Role-mapping name" + } + } } - } + ] }, - "body": null + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_user.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_user.json index e6697b43f837d..99ec88f3493db 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_user.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.delete_user.json @@ -1,27 +1,35 @@ { - "security.delete_user": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_security/user/{username}" - ], - "parts": { - "username": { - "type" : "string", - "description" : "username", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.delete_user":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/{username}", + "methods":[ + "DELETE" + ], + "parts":{ + "username":{ + "type":"string", + "description":"username" + } + } } - } + ] }, - "body": null + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.disable_user.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.disable_user.json index d3530fa8e0142..925b414074437 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.disable_user.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.disable_user.json @@ -1,27 +1,36 @@ { - "security.disable_user": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/user/{username}/_disable" - ], - "parts": { - "username": { - "type" : "string", - "description" : "The username of the user to disable", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.disable_user":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/{username}/_disable", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "username":{ + "type":"string", + "description":"The username of the user to disable" + } + } } - } + ] }, - "body": null + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.enable_user.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.enable_user.json index 1f002662245ec..83d14e82aafe9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.enable_user.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.enable_user.json @@ -1,27 +1,36 @@ { - "security.enable_user": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/user/{username}/_enable" - ], - "parts": { - "username": { - "type" : "string", - "description" : "The username of the user to enable", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.enable_user":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/{username}/_enable", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "username":{ + "type":"string", + "description":"The username of the user to enable" + } + } } - } + ] }, - "body": null + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json index 9f3eca4fae84b..c61ef6ca56463 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json @@ -1,30 +1,36 @@ { - "security.get_api_key": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_security/api_key" ], - "parts": {}, - "params": { - "id": { - "type": "string", - "description": "API key id of the API key to be retrieved" - }, - "name": { - "type": "string", - "description": "API key name of the API key to be retrieved" - }, - "username": { - "type": "string", - "description": "user name of the user who created this API key to be retrieved" - }, - "realm_name": { - "type": "string", - "description": "realm name of the user who created this API key to be retrieved" + "security.get_api_key":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/api_key", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "id":{ + "type":"string", + "description":"API key id of the API key to be retrieved" + }, + "name":{ + "type":"string", + "description":"API key name of the API key to be retrieved" + }, + "username":{ + "type":"string", + "description":"user name of the user who created this API key to be retrieved" + }, + "realm_name":{ + "type":"string", + "description":"realm name of the user who created this API key to be retrieved" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_builtin_privileges.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_builtin_privileges.json index 3312639a83c04..2b61c4baba582 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_builtin_privileges.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_builtin_privileges.json @@ -1,15 +1,19 @@ { - "security.get_builtin_privileges": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/privilege/_builtin" - ], - "parts": {}, - "params": {} + "security.get_builtin_privileges":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/privilege/_builtin", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_privileges.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_privileges.json index 13367024651fc..23acd2d54beda 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_privileges.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_privileges.json @@ -1,28 +1,47 @@ { - "security.get_privileges": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/privilege", - "/_security/privilege/{application}", - "/_security/privilege/{application}/{name}" - ], - "parts": { - "application": { - "type" : "string", - "description" : "Application name", - "required" : false + "security.get_privileges":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/privilege", + "methods":[ + "GET" + ] + }, + { + "path":"/_security/privilege/{application}", + "methods":[ + "GET" + ], + "parts":{ + "application":{ + "type":"string", + "description":"Application name" + } + } }, - "name": { - "type" : "string", - "description" : "Privilege name", - "required" : false + { + "path":"/_security/privilege/{application}/{name}", + "methods":[ + "GET" + ], + "parts":{ + "application":{ + "type":"string", + "description":"Application name" + }, + "name":{ + "type":"string", + "description":"Privilege name" + } + } } - }, - "params": {} + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role.json index 73e0584ba99b3..0c142d92fd811 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role.json @@ -1,22 +1,31 @@ { - "security.get_role": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/role/{name}", - "/_security/role" - ], - "parts": { - "name": { - "type" : "string", - "description" : "Role name", - "required" : false + "security.get_role":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"string", + "description":"Role name" + } + } + }, + { + "path":"/_security/role", + "methods":[ + "GET" + ] } - }, - "params": {} + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role_mapping.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role_mapping.json index da39ec0eaea80..1ff7eda328dee 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role_mapping.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_role_mapping.json @@ -1,22 +1,31 @@ { - "security.get_role_mapping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/role_mapping/{name}", - "/_security/role_mapping" - ], - "parts": { - "name": { - "type" : "string", - "description" : "Role-Mapping name", - "required" : false + "security.get_role_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role_mapping/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"string", + "description":"Role-Mapping name" + } + } + }, + { + "path":"/_security/role_mapping", + "methods":[ + "GET" + ] } - }, - "params": {} + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_token.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_token.json index 3204de64dc8b0..09b76b9068569 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_token.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_token.json @@ -1,18 +1,23 @@ { - "security.get_token": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ - "/_security/oauth2/token" - ], - "parts": {}, - "params": {} + "security.get_token":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html" }, - "body": { - "description" : "The token request to get", - "required" : true + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/oauth2/token", + "methods":[ + "POST" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The token request to get", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user.json index 65ef3c745b02e..ceb4c3a83b18f 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user.json @@ -1,22 +1,31 @@ { - "security.get_user": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/user/{username}", - "/_security/user" - ], - "parts": { - "username": { - "type" : "list", - "description" : "A comma-separated list of usernames", - "required" : false + "security.get_user":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/{username}", + "methods":[ + "GET" + ], + "parts":{ + "username":{ + "type":"list", + "description":"A comma-separated list of usernames" + } + } + }, + { + "path":"/_security/user", + "methods":[ + "GET" + ] } - }, - "params": {} + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user_privileges.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user_privileges.json index 9d998513511ad..c0a404ff34294 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user_privileges.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_user_privileges.json @@ -1,15 +1,19 @@ { - "security.get_user_privileges": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_security/user/_privileges" - ], - "parts": { }, - "params": {} + "security.get_user_privileges":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/_privileges", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.has_privileges.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.has_privileges.json index 8b719f67f2b76..cafd31cd4a84c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.has_privileges.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.has_privileges.json @@ -1,25 +1,37 @@ { - "security.has_privileges": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html", - "stability": "stable", - "methods": [ "GET", "POST" ], - "url": { - "paths": [ - "/_security/user/_has_privileges", - "/_security/user/{user}/_has_privileges" - ], - "parts": { - "user": { - "type" : "string", - "description" : "Username", - "required" : false + "security.has_privileges":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/_has_privileges", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_security/user/{user}/_has_privileges", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "user":{ + "type":"string", + "description":"Username" + } + } } - }, - "params": {} + ] }, - "body": { - "description" : "The privileges to test", - "required" : true + "params":{}, + "body":{ + "description":"The privileges to test", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_api_key.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_api_key.json index 0e6fdd819ceb9..827b3da9635cf 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_api_key.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_api_key.json @@ -1,15 +1,22 @@ { - "security.invalidate_api_key": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_security/api_key" ], - "parts": {} + "security.invalidate_api_key":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html" }, - "body": { - "description" : "The api key request to invalidate API key(s)", - "required" : true + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/api_key", + "methods":[ + "DELETE" + ] + } + ] + }, + "body":{ + "description":"The api key request to invalidate API key(s)", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_token.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_token.json index a184314de6657..73cbc86722cd1 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_token.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.invalidate_token.json @@ -1,18 +1,23 @@ { - "security.invalidate_token": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ - "/_security/oauth2/token" - ], - "parts": {}, - "params": {} + "security.invalidate_token":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html" }, - "body": { - "description" : "The token to invalidate", - "required" : true + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/oauth2/token", + "methods":[ + "DELETE" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The token to invalidate", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_privileges.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_privileges.json index 4f25d91b616a5..3e81d7164bbbe 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_privileges.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_privileges.json @@ -1,27 +1,34 @@ { - "security.put_privileges": { - "documentation": "TODO", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/privilege/" - ], - "params": { - "refresh": { - "type": "enum", - "options": [ - "true", - "false", - "wait_for" - ], - "description": "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.put_privileges":{ + "documentation":{ + "url":"TODO" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/privilege/", + "methods":[ + "PUT", + "POST" + ] } + ] + }, + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." } }, - "body": { - "description" : "The privilege(s) to add", - "required" : true + "body":{ + "description":"The privilege(s) to add", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role.json index 6be12ec41fe4f..718472e04d519 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role.json @@ -1,30 +1,40 @@ { - "security.put_role": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/role/{name}" - ], - "parts": { - "name": { - "type" : "string", - "description" : "Role name", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.put_role":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"Role name" + } + } } + ] + }, + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." } }, - "body": { - "description" : "The role to add", - "required" : true + "body":{ + "description":"The role to add", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role_mapping.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role_mapping.json index 3ae8897f4d78d..f083bbc642550 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role_mapping.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_role_mapping.json @@ -1,30 +1,40 @@ { - "security.put_role_mapping": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/role_mapping/{name}" - ], - "parts": { - "name": { - "type" : "string", - "description" : "Role-mapping name", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.put_role_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/role_mapping/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"Role-mapping name" + } + } } + ] + }, + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." } }, - "body": { - "description" : "The role mapping to add", - "required" : true + "body":{ + "description":"The role mapping to add", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_user.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_user.json index d71cdb476abc7..d1441cbb23b16 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_user.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.put_user.json @@ -1,30 +1,40 @@ { - "security.put_user": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ - "/_security/user/{username}" - ], - "parts": { - "username": { - "type" : "string", - "description" : "The username of the User", - "required" : true - } - }, - "params": { - "refresh": { - "type" : "enum", - "options": ["true", "false", "wait_for"], - "description" : "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." + "security.put_user":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_security/user/{username}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "username":{ + "type":"string", + "description":"The username of the User" + } + } } + ] + }, + "params":{ + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "description":"If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes." } }, - "body": { - "description" : "The user to add", - "required" : true + "body":{ + "description":"The user to add", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.delete_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.delete_lifecycle.json index 2c9c1edcda6ba..72b30f586a866 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.delete_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.delete_lifecycle.json @@ -1,20 +1,19 @@ { - "slm.delete_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "path": "/_slm/policy/{policy_id}", - "paths": ["/_slm/policy/{policy_id}"], - "parts": { - "policy_id": { - "type" : "string", - "description" : "The id of the snapshot lifecycle policy to remove" + "slm.delete_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_slm/policy/{policy_id}", + "methods":[ + "DELETE" + ] } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.execute_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.execute_lifecycle.json index ecfecb7a073cf..0f0cda611cb29 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.execute_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.execute_lifecycle.json @@ -1,20 +1,25 @@ { - "slm.execute_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute.html", - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "path": "/_slm/policy/{policy_id}/_execute", - "paths": ["/_slm/policy/{policy_id}/_execute"], - "parts": { - "policy_id": { - "type" : "string", - "description" : "The id of the snapshot lifecycle policy to be executed" + "slm.execute_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_slm/policy/{policy_id}/_execute", + "methods":[ + "PUT" + ], + "parts":{ + "policy_id":{ + "type":"string", + "description":"The id of the snapshot lifecycle policy to be executed" + } + } } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.get_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.get_lifecycle.json index e83759b19be44..0a3da4107331b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.get_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.get_lifecycle.json @@ -1,20 +1,31 @@ { - "slm.get_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "path": "/_slm/policy/{policy_id}", - "paths": ["/_slm/policy/{policy_id}", "/_slm/policy"], - "parts": { - "policy_id": { - "type" : "string", - "description" : "Comma-separated list of snapshot lifecycle policies to retrieve" + "slm.get_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_slm/policy/{policy_id}", + "methods":[ + "GET" + ], + "parts":{ + "policy_id":{ + "type":"string", + "description":"Comma-separated list of snapshot lifecycle policies to retrieve" + } + } + }, + { + "path":"/_slm/policy", + "methods":[ + "GET" + ] } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.put_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.put_lifecycle.json index 704b80da927b4..f4bb1062575fe 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.put_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/slm.put_lifecycle.json @@ -1,22 +1,28 @@ { - "slm.put_lifecycle": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put.html", - "stability": "stable", - "methods": [ "PUT" ], - "url": { - "path": "/_slm/policy/{policy_id}", - "paths": ["/_slm/policy/{policy_id}"], - "parts": { - "policy_id": { - "type" : "string", - "description" : "The id of the snapshot lifecycle policy" + "slm.put_lifecycle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_slm/policy/{policy_id}", + "methods":[ + "PUT" + ], + "parts":{ + "policy_id":{ + "type":"string", + "description":"The id of the snapshot lifecycle policy" + } + } } - }, - "params": { - } + ] }, - "body": { - "description": "The snapshot lifecycle policy definition to register" + "params":{}, + "body":{ + "description":"The snapshot lifecycle policy definition to register" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.clear_cursor.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.clear_cursor.json index cca53053513b5..392b24b218741 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.clear_cursor.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.clear_cursor.json @@ -1,15 +1,22 @@ { - "sql.clear_cursor": { - "documentation": "Clear SQL cursor", - "stability" : "stable", - "methods": [ "POST"], - "url": { - "paths": [ "/_sql/close" ], - "parts": {} + "sql.clear_cursor":{ + "documentation":{ + "url":"Clear SQL cursor" }, - "body": { - "description" : "Specify the cursor value in the `cursor` element to clean the cursor.", - "required" : true + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_sql/close", + "methods":[ + "POST" + ] + } + ] + }, + "body":{ + "description":"Specify the cursor value in the `cursor` element to clean the cursor.", + "required":true } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.query.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.query.json index 7f92622e1182f..0fe518b520546 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.query.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.query.json @@ -1,21 +1,29 @@ { - "sql.query": { - "documentation": "Execute SQL", - "stability" : "stable", - "methods": [ "POST", "GET" ], - "url": { - "paths": [ "/_sql" ], - "parts": {}, - "params": { - "format": { - "type" : "string", - "description" : "a short version of the Accept header, e.g. json, yaml" - } + "sql.query":{ + "documentation":{ + "url":"Execute SQL" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_sql", + "methods":[ + "POST", + "GET" + ] } - }, - "body": { - "description" : "Use the `query` element to start a query. Use the `cursor` element to continue a query.", - "required" : true + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" } + }, + "body":{ + "description":"Use the `query` element to start a query. Use the `cursor` element to continue a query.", + "required":true } + } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.translate.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.translate.json index 5258d5b87641b..30920a3e4a326 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.translate.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/sql.translate.json @@ -1,16 +1,24 @@ { - "sql.translate": { - "documentation": "Translate SQL into Elasticsearch queries", - "stability" : "stable", - "methods": [ "POST", "GET" ], - "url": { - "paths": [ "/_sql/translate" ], - "parts": {}, - "params": {} - }, - "body": { - "description" : "Specify the query in the `query` element.", - "required" : true - } + "sql.translate":{ + "documentation":{ + "url":"Translate SQL into Elasticsearch queries" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_sql/translate", + "methods":[ + "POST", + "GET" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"Specify the query in the `query` element.", + "required":true } } +} diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ssl.certificates.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ssl.certificates.json index f41e9b737dd9b..bc4369458c238 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ssl.certificates.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ssl.certificates.json @@ -1,15 +1,19 @@ { - "ssl.certificates": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ - "/_ssl/certificates" - ], - "parts": {}, - "params": {} + "ssl.certificates":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ssl/certificates", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.ack_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.ack_watch.json index 0ee2aad79c04d..60ed14879e881 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.ack_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.ack_watch.json @@ -1,22 +1,42 @@ { - "watcher.ack_watch": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ "/_watcher/watch/{watch_id}/_ack", "/_watcher/watch/{watch_id}/_ack/{action_id}"], - "parts": { - "watch_id": { - "type" : "string", - "description" : "Watch ID", - "required" : true + "watcher.ack_watch":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{watch_id}/_ack", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "watch_id":{ + "type":"string", + "description":"Watch ID" + } + } }, - "action_id": { - "type" : "list", - "description" : "A comma-separated list of the action ids to be acked" + { + "path":"/_watcher/watch/{watch_id}/_ack/{action_id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "watch_id":{ + "type":"string", + "description":"Watch ID" + }, + "action_id":{ + "type":"list", + "description":"A comma-separated list of the action ids to be acked" + } + } } - } - }, - "body": null + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.activate_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.activate_watch.json index 25f13f5007b83..bfbf933cf0db9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.activate_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.activate_watch.json @@ -1,18 +1,25 @@ { - "watcher.activate_watch": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ "/_watcher/watch/{watch_id}/_activate" ], - "parts": { - "watch_id": { - "type" : "string", - "description" : "Watch ID", - "required" : true - } - } + "watcher.activate_watch":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{watch_id}/_activate", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "watch_id":{ + "type":"string", + "description":"Watch ID" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.deactivate_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.deactivate_watch.json index 9325f03b8c2d8..56ee8ed82f86b 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.deactivate_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.deactivate_watch.json @@ -1,18 +1,25 @@ { - "watcher.deactivate_watch": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ "/_watcher/watch/{watch_id}/_deactivate" ], - "parts": { - "watch_id": { - "type" : "string", - "description" : "Watch ID", - "required" : true - } - } + "watcher.deactivate_watch":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{watch_id}/_deactivate", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "watch_id":{ + "type":"string", + "description":"Watch ID" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.delete_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.delete_watch.json index 87f4500f165c7..47c95b4e54f51 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.delete_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.delete_watch.json @@ -1,18 +1,24 @@ { - "watcher.delete_watch": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html", - "stability": "stable", - "methods": [ "DELETE" ], - "url": { - "paths": [ "/_watcher/watch/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Watch ID", - "required" : true - } - } + "watcher.delete_watch":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Watch ID" + } + } + } + ] + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.execute_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.execute_watch.json index 864427b93ae76..00e493bbb2c2a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.execute_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.execute_watch.json @@ -1,27 +1,43 @@ { - "watcher.execute_watch": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ "/_watcher/watch/{id}/_execute", "/_watcher/watch/_execute" ], - "parts": { - "id": { - "type" : "string", - "description" : "Watch ID" - } - }, - "params": { - "debug" : { - "type" : "boolean", - "description" : "indicates whether the watch should execute in debug mode", - "required" : false + "watcher.execute_watch":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{id}/_execute", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Watch ID" + } + } + }, + { + "path":"/_watcher/watch/_execute", + "methods":[ + "PUT", + "POST" + ] } + ] + }, + "params":{ + "debug":{ + "type":"boolean", + "description":"indicates whether the watch should execute in debug mode", + "required":false } }, - "body": { - "description" : "Execution control", - "required" : false + "body":{ + "description":"Execution control", + "required":false } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.get_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.get_watch.json index 593ac31fe759f..0b5afbf750fba 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.get_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.get_watch.json @@ -1,20 +1,25 @@ { - "watcher.get_watch": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_watcher/watch/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Watch ID", - "required" : true + "watcher.get_watch":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Watch ID" + } + } } - }, - "params": { - } + ] }, - "body": null + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.put_watch.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.put_watch.json index 9e9c0e7a01ddc..3a2c85ea2d32a 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.put_watch.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.put_watch.json @@ -1,39 +1,47 @@ { - "watcher.put_watch": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html", - "stability": "stable", - "methods": [ "PUT", "POST" ], - "url": { - "paths": [ "/_watcher/watch/{id}" ], - "parts": { - "id": { - "type" : "string", - "description" : "Watch ID", - "required" : true + "watcher.put_watch":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/watch/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Watch ID" + } + } } + ] + }, + "params":{ + "active":{ + "type":"boolean", + "description":"Specify whether the watch is in/active by default" }, - "params": { - "active": { - "type": "boolean", - "description": "Specify whether the watch is in/active by default" - }, - "version" : { - "type" : "number", - "description" : "Explicit version number for concurrency control" - }, - "if_seq_no" : { - "type" : "number", - "description" : "only update the watch if the last operation that has changed the watch has the specified sequence number" - }, - "if_primary_term" : { - "type" : "number", - "description" : "only update the watch if the last operation that has changed the watch has the specified primary term" - } + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "if_seq_no":{ + "type":"number", + "description":"only update the watch if the last operation that has changed the watch has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only update the watch if the last operation that has changed the watch has the specified primary term" } }, - "body": { - "description" : "The watch", - "required" : false + "body":{ + "description":"The watch", + "required":false } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.start.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.start.json index 77e18e81fb3a8..4128e67917aba 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.start.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.start.json @@ -1,15 +1,19 @@ { - "watcher.start": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_watcher/_start" ], - "parts": { - }, - "params": { - } + "watcher.start":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/_start", + "methods":[ + "POST" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stats.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stats.json index 44c75dff017ca..acb914656e527 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stats.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stats.json @@ -1,30 +1,53 @@ { - "watcher.stats": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_watcher/stats", "/_watcher/stats/{metric}" ], - "parts": { - "metric": { - "type" : "list", - "options" : ["_all", "queued_watches", "current_watches", "pending_watches"], - "description" : "Controls what additional stat metrics should be include in the response" - } - }, - "params": { - "metric": { - "type" : "list", - "options" : ["_all", "queued_watches", "current_watches", "pending_watches"], - "description" : "Controls what additional stat metrics should be include in the response" + "watcher.stats":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/stats", + "methods":[ + "GET" + ] }, - "emit_stacktraces": { - "type" : "boolean", - "description" : "Emits stack traces of currently running watches", - "required" : false + { + "path":"/_watcher/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "queued_watches", + "current_watches", + "pending_watches" + ], + "description":"Controls what additional stat metrics should be include in the response" + } + } } - } + ] }, - "body": null + "params":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "queued_watches", + "current_watches", + "pending_watches" + ], + "description":"Controls what additional stat metrics should be include in the response" + }, + "emit_stacktraces":{ + "type":"boolean", + "description":"Emits stack traces of currently running watches", + "required":false + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stop.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stop.json index c036782947b4b..3a98b47c6a025 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stop.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/watcher.stop.json @@ -1,15 +1,19 @@ { - "watcher.stop": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html", - "stability": "stable", - "methods": [ "POST" ], - "url": { - "paths": [ "/_watcher/_stop" ], - "parts": { - }, - "params": { - } + "watcher.stop":{ + "documentation":{ + "url":"http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html" }, - "body": null + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_watcher/_stop", + "methods":[ + "POST" + ] + } + ] + }, + "params":{} } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.info.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.info.json index 75d5bf276e4aa..49914c092d24d 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.info.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.info.json @@ -1,18 +1,24 @@ { - "xpack.info": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_xpack" ], - "parts": {}, - "params": { - "categories": { - "type": "list", - "description" : "Comma-separated list of info categories. Can be any of: build, license, features" + "xpack.info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_xpack", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "categories":{ + "type":"list", + "description":"Comma-separated list of info categories. Can be any of: build, license, features" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.usage.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.usage.json index 9923093dcecf0..6a9d065d806c3 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.usage.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/xpack.usage.json @@ -1,18 +1,24 @@ { - "xpack.usage": { - "documentation": "Retrieve information about xpack features usage", - "stability": "stable", - "methods": [ "GET" ], - "url": { - "paths": [ "/_xpack/usage" ], - "parts": {}, - "params": { - "master_timeout": { - "type": "time", - "description": "Specify timeout for watch write operation" + "xpack.usage":{ + "documentation":{ + "url":"Retrieve information about xpack features usage" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_xpack/usage", + "methods":[ + "GET" + ] } - } + ] }, - "body": null + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for watch write operation" + } + } } } From 3c259e59939d6f4c5a6216fdf3fcb4b6405f5eca Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Tue, 23 Jul 2019 14:00:00 +0100 Subject: [PATCH 2/2] Adapt YAML runner to new REST API specification format The logic for choosing the path to use when running tests has been simplified, as a consequence of the path parts being listed under each path in the spec. The special case for create and index has been removed. Also the parsing code has been hardened so that errors are thrown earlier when the structure of the spec differs from what expected, and their error messages should be more helpful. --- .../api/scripts_painless_context.json | 19 +- .../rest-api-spec/api/cat.example.json | 34 +- .../test/rest/yaml/ClientYamlTestClient.java | 71 ++-- .../rest/yaml/ESClientYamlSuiteTestCase.java | 13 +- .../yaml/restspec/ClientYamlSuiteRestApi.java | 177 ++++---- .../ClientYamlSuiteRestApiParser.java | 151 ++++--- .../restspec/ClientYamlSuiteRestPath.java | 101 ----- ...entYamlSuiteRestApiParserFailingTests.java | 63 ++- .../ClientYamlSuiteRestApiParserTests.java | 379 ++++++++++++------ .../restspec/ClientYamlSuiteRestApiTests.java | 270 +++++++++++++ .../data_frame.put_data_frame_transform.json | 7 + ...ata_frame.update_data_frame_transform.json | 36 +- .../api/ilm.explain_lifecycle.json | 11 +- .../api/ml.estimate_memory_usage.json | 15 +- 14 files changed, 840 insertions(+), 507 deletions(-) delete mode 100644 test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java create mode 100644 test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java diff --git a/modules/lang-painless/src/test/resources/rest-api-spec/api/scripts_painless_context.json b/modules/lang-painless/src/test/resources/rest-api-spec/api/scripts_painless_context.json index cb078ec4a00b8..31ef7ae8d489a 100644 --- a/modules/lang-painless/src/test/resources/rest-api-spec/api/scripts_painless_context.json +++ b/modules/lang-painless/src/test/resources/rest-api-spec/api/scripts_painless_context.json @@ -1,16 +1,19 @@ { "scripts_painless_context": { "stability": "experimental", - "methods": ["GET"], "url": { - "paths": ["/_scripts/painless/_context"], - "parts": { - }, - "params": { - "context" : { - "type" : "string", - "description" : "Select a specific context to retrieve API information about" + "paths": [ + { + "path": "/_scripts/painless/_context", + "methods": ["GET"], + "parts": {} } + ] + }, + "params": { + "context" : { + "type" : "string", + "description" : "Select a specific context to retrieve API information about" } } } diff --git a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json b/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json index d293db804f625..ee4e540be4e26 100644 --- a/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json +++ b/plugins/examples/rest-handler/src/test/resources/rest-api-spec/api/cat.example.json @@ -11,23 +11,23 @@ "path" : "/_cat/example", "methods" : ["GET"] } - ], - "params": { - "help": { - "type": "boolean", - "description": "Return help information", - "default": false - }, - "v": { - "type": "boolean", - "description": "Verbose mode. Display column headers", - "default": true - }, - "message": { - "type": "string", - "description": "A simple message that will be printed out in the response", - "default": "Hello from Cat Example action" - } + ] + }, + "params": { + "help": { + "type": "boolean", + "description": "Return help information", + "default": false + }, + "v": { + "type": "boolean", + "description": "Verbose mode. Display column headers", + "default": true + }, + "message": { + "type": "string", + "description": "A simple message that will be printed out in the response", + "default": "Hello from Cat Example action" } }, "body": null diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestClient.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestClient.java index 9d48969f7209f..64b61773461f6 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestClient.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestClient.java @@ -19,7 +19,6 @@ package org.elasticsearch.test.rest.yaml; import com.carrotsearch.randomizedtesting.RandomizedTest; - import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.client.methods.HttpGet; @@ -38,7 +37,6 @@ import org.elasticsearch.client.WarningsHandler; import org.elasticsearch.common.CheckedSupplier; import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi; -import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestPath; import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec; import java.io.Closeable; @@ -46,6 +44,7 @@ import java.io.UncheckedIOException; import java.net.URI; import java.net.URISyntaxException; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -100,19 +99,20 @@ public ClientYamlTestResponse callApi(String apiName, Map params ClientYamlSuiteRestApi restApi = restApi(apiName); + Set apiRequiredParameters = restApi.getParams().entrySet().stream().filter(Entry::getValue).map(Entry::getKey) + .collect(Collectors.toSet()); + + List bestPaths = restApi.getBestMatchingPaths(params.keySet()); + //the rest path to use is randomized out of the matching ones (if more than one) + ClientYamlSuiteRestApi.Path path = RandomizedTest.randomFrom(bestPaths); + //divide params between ones that go within query string and ones that go within path Map pathParts = new HashMap<>(); Map queryStringParams = new HashMap<>(); - Set apiRequiredPathParts = restApi.getPathParts().entrySet().stream().filter(Entry::getValue).map(Entry::getKey) - .collect(Collectors.toSet()); - Set apiRequiredParameters = restApi.getParams().entrySet().stream().filter(Entry::getValue).map(Entry::getKey) - .collect(Collectors.toSet()); - for (Map.Entry entry : params.entrySet()) { - if (restApi.getPathParts().containsKey(entry.getKey())) { + if (path.getParts().contains(entry.getKey())) { pathParts.put(entry.getKey(), entry.getValue()); - apiRequiredPathParts.remove(entry.getKey()); } else if (restApi.getParams().containsKey(entry.getKey()) || restSpec.isGlobalParameter(entry.getKey()) || restSpec.isClientParameter(entry.getKey())) { @@ -124,16 +124,33 @@ public ClientYamlTestResponse callApi(String apiName, Map params } } - if (false == apiRequiredPathParts.isEmpty()) { - throw new IllegalArgumentException( - "missing required path part: " + apiRequiredPathParts + " by [" + restApi.getName() + "] api"); - } if (false == apiRequiredParameters.isEmpty()) { throw new IllegalArgumentException( "missing required parameter: " + apiRequiredParameters + " by [" + restApi.getName() + "] api"); } - List supportedMethods = restApi.getSupportedMethods(pathParts.keySet()); + Set partNames = pathParts.keySet(); + if (path.getParts().size() != partNames.size() || path.getParts().containsAll(partNames) == false) { + throw new IllegalStateException("provided path parts don't match the best matching path: " + + path.getParts() + " - " + partNames); + } + + String finalPath = path.getPath(); + for (Entry pathPart : pathParts.entrySet()) { + try { + //Encode rules for path and query string parameters are different. We use URI to encode the path. We need to encode each + // path part separately, as each one might contain slashes that need to be escaped, which needs to be done manually. + // We prepend "/" to the path part to handle parts that start with - or other invalid characters. + URI uri = new URI(null, null, null, -1, "/" + pathPart.getValue(), null, null); + //manually escape any slash that each part may contain + String encodedPathPart = uri.getRawPath().substring(1).replaceAll("/", "%2F"); + finalPath = finalPath.replace("{" + pathPart.getKey() + "}", encodedPathPart); + } catch (URISyntaxException e) { + throw new RuntimeException("unable to build uri", e); + } + } + + List supportedMethods = Arrays.asList(path.getMethods()); String requestMethod; if (entity != null) { if (false == restApi.isBodySupported()) { @@ -157,32 +174,8 @@ public ClientYamlTestResponse callApi(String apiName, Map params requestMethod = RandomizedTest.randomFrom(supportedMethods); } - //the rest path to use is randomized out of the matching ones (if more than one) - ClientYamlSuiteRestPath restPath = RandomizedTest.randomFrom(restApi.getFinalPaths(pathParts)); - //Encode rules for path and query string parameters are different. We use URI to encode the path. - //We need to encode each path part separately, as each one might contain slashes that need to be escaped, which needs to - //be done manually. - String requestPath; - if (restPath.getPathParts().length == 0) { - requestPath = "/"; - } else { - StringBuilder finalPath = new StringBuilder(); - for (String pathPart : restPath.getPathParts()) { - try { - finalPath.append('/'); - // We prepend "/" to the path part to handle parts that start with - or other invalid characters - URI uri = new URI(null, null, null, -1, "/" + pathPart, null, null); - //manually escape any slash that each part may contain - finalPath.append(uri.getRawPath().substring(1).replaceAll("/", "%2F")); - } catch (URISyntaxException e) { - throw new RuntimeException("unable to build uri", e); - } - } - requestPath = finalPath.toString(); - } - logger.debug("calling api [{}]", apiName); - Request request = new Request(requestMethod, requestPath); + Request request = new Request(requestMethod, finalPath); for (Map.Entry param : queryStringParams.entrySet()) { request.addParameter(param.getKey(), param.getValue()); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java index cd48890d065df..703e30d19c2b8 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java @@ -48,6 +48,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; @@ -280,9 +281,15 @@ private static void validateSpec(ClientYamlSuiteRestSpec restSpec) { if (validateSpec) { StringBuilder errorMessage = new StringBuilder(); for (ClientYamlSuiteRestApi restApi : restSpec.getApis()) { - if (restApi.getMethods().contains("GET") && restApi.isBodySupported()) { - if (!restApi.getMethods().contains("POST")) { - errorMessage.append("\n- ").append(restApi.getName()).append(" supports GET with a body but doesn't support POST"); + if (restApi.isBodySupported()) { + for (ClientYamlSuiteRestApi.Path path : restApi.getPaths()) { + List methodsList = Arrays.asList(path.getMethods()); + if (methodsList.contains("GET") && restApi.isBodySupported()) { + if (!methodsList.contains("POST")) { + errorMessage.append("\n- ").append(restApi.getName()) + .append(" supports GET with a body but doesn't support POST"); + } + } } } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApi.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApi.java index 421da469f3b3a..ce8de16356999 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApi.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApi.java @@ -18,14 +18,18 @@ */ package org.elasticsearch.test.rest.yaml.restspec; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; +import org.elasticsearch.common.collect.Tuple; import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; +import java.util.PriorityQueue; import java.util.Set; /** @@ -35,16 +39,13 @@ public class ClientYamlSuiteRestApi { private final String location; private final String name; - private List methods = new ArrayList<>(); - private List paths = new ArrayList<>(); - private Map pathParts = new HashMap<>(); + private Set paths = new LinkedHashSet<>(); private Map params = new HashMap<>(); private Body body = Body.NOT_SUPPORTED; - private Stability stability = Stability.UNKNOWN; + private Stability stability; - public enum Stability - { - UNKNOWN, EXPERIMENTAL, BETA, STABLE + public enum Stability { + EXPERIMENTAL, BETA, STABLE } public enum Body { @@ -64,60 +65,28 @@ public String getLocation() { return location; } - public List getMethods() { - return methods; - } - - /** - * Returns the supported http methods given the rest parameters provided - */ - public List getSupportedMethods(Set restParams) { - //we try to avoid hardcoded mappings but the index api is the exception - if ("index".equals(name) || "create".equals(name)) { - List indexMethods = new ArrayList<>(); - for (String method : methods) { - if (restParams.contains("id")) { - //PUT when the id is provided - if (HttpPut.METHOD_NAME.equals(method)) { - indexMethods.add(method); - } - } else { - //POST without id - if (HttpPost.METHOD_NAME.equals(method)) { - indexMethods.add(method); - } - } + void addPath(String path, String[] methods, Set parts) { + Objects.requireNonNull(path, name + " API: path must not be null"); + Objects.requireNonNull(methods, name + " API: methods must not be null"); + if (methods.length == 0) { + throw new IllegalArgumentException(name + " API: methods is empty, at least one method is required"); + } + Objects.requireNonNull(parts, name + " API: parts must not be null"); + for (String part : parts) { + if (path.contains("{" + part + "}") == false) { + throw new IllegalArgumentException(name + " API: part [" + part + "] not contained in path [" + path + "]"); } - return indexMethods; } - - return methods; - } - - void addMethod(String method) { - this.methods.add(method); + boolean add = this.paths.add(new Path(path, methods, parts)); + if (add == false) { + throw new IllegalArgumentException(name + " API: found duplicate path [" + path + "]"); + } } - public List getPaths() { + public Collection getPaths() { return paths; } - void addPath(String path) { - this.paths.add(path); - } - - /** - * Gets all path parts supported by the api. For every path part defines if it - * is required or optional. - */ - public Map getPathParts() { - return pathParts; - } - - void addPathPart(String pathPart, boolean required) { - this.pathParts.put(pathPart, required); - } - /** * Gets all parameters supported by the api. For every parameter defines if it * is required or optional. @@ -147,52 +116,84 @@ public boolean isBodyRequired() { } public void setStability(String stability) { - this.stability = ClientYamlSuiteRestApi.Stability.valueOf(stability.toUpperCase(Locale.ROOT)); + this.stability = Stability.valueOf(stability.toUpperCase(Locale.ROOT)); } public Stability getStability() { return this.stability; } /** - * Finds the best matching rest path given the current parameters and replaces - * placeholders with their corresponding values received as arguments + * Returns the best matching paths based on the provided parameters, which may include either path parts or query_string parameters. + * The best path is the one that has exactly the same number of placeholders to replace + * (e.g. /{index}/{type}/{id} when the path params are exactly index, type and id). + * It returns a list instead of a single path as there are cases where there is more than one best matching path: + * - /{index}/_alias/{name}, /{index}/_aliases/{name} + * - /{index}/{type}/_mapping, /{index}/{type}/_mappings, /{index}/_mappings/{type}, /{index}/_mapping/{type} */ - public ClientYamlSuiteRestPath[] getFinalPaths(Map pathParams) { - List matchingRestPaths = findMatchingRestPaths(pathParams.keySet()); - if (matchingRestPaths == null || matchingRestPaths.isEmpty()) { - throw new IllegalArgumentException("unable to find matching rest path for api [" + name + "] and path params " + pathParams); + public List getBestMatchingPaths(Set params) { + PriorityQueue> queue = new PriorityQueue<>(Comparator.comparing(Tuple::v1, (a, b) -> Integer.compare(b, a))); + for (ClientYamlSuiteRestApi.Path path : paths) { + int matches = 0; + for (String actualParameter : params) { + if (path.getParts().contains(actualParameter)) { + matches++; + } + } + if (matches == path.parts.size()) { + queue.add(Tuple.tuple(matches, path)); + } } - - ClientYamlSuiteRestPath[] restPaths = new ClientYamlSuiteRestPath[matchingRestPaths.size()]; - for (int i = 0; i < matchingRestPaths.size(); i++) { - ClientYamlSuiteRestPath restPath = matchingRestPaths.get(i); - restPaths[i] = restPath.replacePlaceholders(pathParams); + if (queue.isEmpty()) { + throw new IllegalStateException("Unable to find a matching path for api [" + name + "]" + params); } - return restPaths; + List paths = new ArrayList<>(); + Tuple poll = queue.poll(); + int maxMatches = poll.v1(); + do { + paths.add(poll.v2()); + poll = queue.poll(); + } while (poll != null && poll.v1() == maxMatches); + + return paths; } - /** - * Finds the matching rest paths out of the available ones with the current api (based on REST spec). - * - * The best path is the one that has exactly the same number of placeholders to replace - * (e.g. /{index}/{type}/{id} when the path params are exactly index, type and id). - */ - private List findMatchingRestPaths(Set restParams) { + public static class Path { + private final String path; + private final String[] methods; + private final Set parts; - List matchingRestPaths = new ArrayList<>(); - ClientYamlSuiteRestPath[] restPaths = buildRestPaths(); - for (ClientYamlSuiteRestPath restPath : restPaths) { - if (restPath.matches(restParams)) { - matchingRestPaths.add(restPath); + private Path(String path, String[] methods, Set parts) { + this.path = path; + this.methods = methods; + this.parts = parts; + } + + public String getPath() { + return path; + } + + public String[] getMethods() { + return methods; + } + + public Set getParts() { + return parts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + Path path = (Path) o; + return this.path.equals(path.path); } - return matchingRestPaths; - } - private ClientYamlSuiteRestPath[] buildRestPaths() { - ClientYamlSuiteRestPath[] restPaths = new ClientYamlSuiteRestPath[paths.size()]; - for (int i = 0; i < restPaths.length; i++) { - restPaths[i] = new ClientYamlSuiteRestPath(paths.get(i)); + @Override + public int hashCode() { + return Objects.hash(path); } - return restPaths; } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java index cd797ae4e0705..eb53581dbce9d 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java @@ -19,10 +19,13 @@ package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.ParseField; +import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.XContentParser; import java.io.IOException; +import java.util.HashSet; +import java.util.Set; /** * Parser for a {@link ClientYamlSuiteRestApi}. @@ -51,76 +54,95 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro while (parser.nextToken() != XContentParser.Token.END_OBJECT || level >= 0) { if (parser.currentToken() == XContentParser.Token.FIELD_NAME) { - if ("stability".equals(parser.currentName())) - { + if ("documentation".equals(parser.currentName())) { parser.nextToken(); - String stability = parser.textOrNull(); - try { - restApi.setStability(stability); - } catch (IllegalArgumentException ex) - { - throw new IllegalArgumentException("API [" + apiName + "] sets wrong state for stability (" - + stability + ") [" + location + "]"); - } - } - - if ("methods".equals(parser.currentName())) { + parser.skipChildren(); + } else if ("stability".equals(parser.currentName())) { parser.nextToken(); - while (parser.nextToken() == XContentParser.Token.VALUE_STRING) { - String method = parser.text(); - if (restApi.getMethods().contains(method)) { - throw new IllegalArgumentException("Found duplicate method [" + method + "]"); - } - restApi.addMethod(method); - } - } + restApi.setStability(parser.textOrNull()); + } else if ("url".equals(parser.currentName())) { + String currentFieldName = null; + assert parser.nextToken() == XContentParser.Token.START_OBJECT; - if ("url".equals(parser.currentName())) { - String currentFieldName = "url"; while(parser.nextToken() != XContentParser.Token.END_OBJECT) { if (parser.currentToken() == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); } - if (parser.currentToken() == XContentParser.Token.START_ARRAY && "paths".equals(currentFieldName)) { - while (parser.nextToken() == XContentParser.Token.VALUE_STRING) { - addPathToApi(parser.text(), restApi); + if ("paths".equals(currentFieldName)) { + if (parser.nextToken() != XContentParser.Token.START_ARRAY) { + throw new ParsingException(parser.getTokenLocation(), apiName + " API: [paths] must be an array"); } - } - if (parser.currentToken() == XContentParser.Token.START_ARRAY && "deprecated_paths".equals(currentFieldName)) { while (parser.nextToken() != XContentParser.Token.END_ARRAY) { - if (parser.currentToken() == XContentParser.Token.FIELD_NAME && "path".equals(parser.currentName())) - { - parser.nextToken(); - addPathToApi(parser.text(), restApi); - } - } - } - - if (parser.currentToken() == XContentParser.Token.START_OBJECT && "parts".equals(currentFieldName)) { - while (parser.nextToken() == XContentParser.Token.FIELD_NAME) { - String part = parser.currentName(); - parser.nextToken(); - if (parser.currentToken() != XContentParser.Token.START_OBJECT) { - throw new IllegalArgumentException("Expected parts field in rest api definition to contain an object"); + String path = null; + Set methods = new HashSet<>(); + Set pathParts = new HashSet<>(); + while (parser.nextToken() != XContentParser.Token.END_OBJECT) { + if ("path".equals(parser.currentName())) { + parser.nextToken(); + path = parser.text(); + } else if ("methods".equals(parser.currentName())) { + if (parser.nextToken() != XContentParser.Token.START_ARRAY) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: expected [methods] field in rest api definition to hold an array"); + } + while (parser.nextToken() == XContentParser.Token.VALUE_STRING) { + String method = parser.text(); + if (methods.add(method) == false) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: found duplicate method [" + method + "]"); + } + } + } else if ("parts".equals(parser.currentName())) { + if (parser.nextToken() != XContentParser.Token.START_OBJECT) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: expected [parts] field in rest api definition to hold an object"); + } + while (parser.nextToken() == XContentParser.Token.FIELD_NAME) { + String part = parser.currentName(); + if (parser.nextToken() != XContentParser.Token.START_OBJECT) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: expected [parts] field in rest api definition to contain an object"); + } + parser.skipChildren(); + if (pathParts.add(part) == false) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: duplicated path part [" + part + "]"); + } + } + } else if ("deprecated".equals(parser.currentName())) { + if (parser.nextToken() != XContentParser.Token.START_OBJECT) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: expected [deprecated] field in rest api definition to hold an object"); + } + parser.skipChildren(); + } else { + throw new ParsingException(parser.getTokenLocation(), apiName + " API: unexpected field [" + + parser.currentName() + "] of type [" + parser.currentToken() + "]"); + } } - restApi.addPathPart(part, PARAMETER_PARSER.parse(parser, null).isRequired()); + restApi.addPath(path, methods.toArray(new String[0]), pathParts); } + } else { + throw new ParsingException(parser.getTokenLocation(), apiName + " API: unsupported field [" + + parser.currentName() + "]"); } + } + } else if ("params".equals(parser.currentName())) { + if (parser.nextToken() != XContentParser.Token.START_OBJECT) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: expected [params] field in rest api definition to contain an object"); - if (parser.currentToken() == XContentParser.Token.START_OBJECT && "params".equals(currentFieldName)) { - while (parser.nextToken() == XContentParser.Token.FIELD_NAME) { - String param = parser.currentName(); - parser.nextToken(); - if (parser.currentToken() != XContentParser.Token.START_OBJECT) { - throw new IllegalArgumentException("Expected params field in rest api definition to contain an object"); - } - restApi.addParam(param, PARAMETER_PARSER.parse(parser, null).isRequired()); - } + } + while (parser.nextToken() == XContentParser.Token.FIELD_NAME) { + String param = parser.currentName(); + parser.nextToken(); + if (parser.currentToken() != XContentParser.Token.START_OBJECT) { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: expected [params] field in rest api definition to contain an object"); } + restApi.addParam(param, PARAMETER_PARSER.parse(parser, null).isRequired()); } - } - - if ("body".equals(parser.currentName())) { + } else if ("body".equals(parser.currentName())) { parser.nextToken(); if (parser.currentToken() != XContentParser.Token.VALUE_NULL) { boolean requiredFound = false; @@ -141,6 +163,9 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro restApi.setBodyOptional(); } } + } else { + throw new ParsingException(parser.getTokenLocation(), + apiName + " API: unsupported field [" + parser.currentName() + "]"); } } @@ -150,25 +175,19 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro if (parser.currentToken() == XContentParser.Token.END_OBJECT) { level--; } - } parser.nextToken(); assert parser.currentToken() == XContentParser.Token.END_OBJECT : "Expected [END_OBJECT] but was [" + parser.currentToken() +"]"; parser.nextToken(); - if (restApi.getStability() == ClientYamlSuiteRestApi.Stability.UNKNOWN) { - throw new IllegalArgumentException("API [" + apiName + "] does not explicitly declare its stability in [" + location + "]"); + if (restApi.getPaths().isEmpty()) { + throw new IllegalArgumentException(apiName + " API: at least one path should be listed under [paths]"); } - - return restApi; - } - - private void addPathToApi(String path, ClientYamlSuiteRestApi restApi) { - if (restApi.getPaths().contains(path)) { - throw new IllegalArgumentException("Found duplicate path [" + path + "]"); + if (restApi.getStability() == null) { + throw new IllegalArgumentException(apiName + " API does not declare its stability in [" + location + "]"); } - restApi.addPath(path); + return restApi; } private static class Parameter { diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java deleted file mode 100644 index f54994138e087..0000000000000 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.test.rest.yaml.restspec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class ClientYamlSuiteRestPath { - private final List parts; - private final List placeholders; - - public ClientYamlSuiteRestPath(List parts) { - List pathParts = new ArrayList<>(parts.size()); - for (String part : parts) { - pathParts.add(new PathPart(part, false)); - } - this.parts = pathParts; - this.placeholders = Collections.emptyList(); - } - - public ClientYamlSuiteRestPath(String path) { - String[] pathParts = path.split("/"); - List placeholders = new ArrayList<>(); - List parts = new ArrayList<>(); - for (String pathPart : pathParts) { - if (pathPart.length() > 0) { - if (pathPart.startsWith("{")) { - if (pathPart.indexOf('}') != pathPart.length() - 1) { - throw new IllegalArgumentException("more than one parameter found in the same path part: [" + pathPart + "]"); - } - String placeholder = pathPart.substring(1, pathPart.length() - 1); - parts.add(new PathPart(placeholder, true)); - placeholders.add(placeholder); - } else { - parts.add(new PathPart(pathPart, false)); - } - } - } - this.placeholders = placeholders; - this.parts = parts; - } - - public String[] getPathParts() { - String[] parts = new String[this.parts.size()]; - int i = 0; - for (PathPart part : this.parts) { - parts[i++] = part.pathPart; - } - return parts; - } - - public boolean matches(Set params) { - return placeholders.size() == params.size() && placeholders.containsAll(params); - } - - public ClientYamlSuiteRestPath replacePlaceholders(Map params) { - List finalPathParts = new ArrayList<>(parts.size()); - for (PathPart pathPart : parts) { - if (pathPart.isPlaceholder) { - String value = params.get(pathPart.pathPart); - if (value == null) { - throw new IllegalArgumentException("parameter [" + pathPart.pathPart + "] missing"); - } - finalPathParts.add(value); - } else { - finalPathParts.add(pathPart.pathPart); - } - } - return new ClientYamlSuiteRestPath(finalPathParts); - } - - private static class PathPart { - private final boolean isPlaceholder; - private final String pathPart; - - private PathPart(String pathPart, boolean isPlaceholder) { - this.isPlaceholder = isPlaceholder; - this.pathPart = pathPart; - } - } -} diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java index 3fd343a17e990..dab1e535f7d47 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java @@ -18,6 +18,7 @@ */ package org.elasticsearch.test.rest.yaml.restspec; +import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.yaml.YamlXContent; import org.elasticsearch.test.ESTestCase; @@ -31,16 +32,12 @@ public class ClientYamlSuiteRestApiParserFailingTests extends ESTestCase { public void testDuplicateMethods() throws Exception { - parseAndExpectFailure("{\n" + + parseAndExpectParsingException("{\n" + " \"ping\": {" + " \"documentation\": \"http://www.elasticsearch.org/guide/\"," + " \"stability\": \"stable\",\n" + - " \"methods\": [\"PUT\", \"PUT\"]," + " \"url\": {" + - " \"path\": \"/\"," + - " \"paths\": [\"/\"]," + - " \"parts\": {" + - " }," + + " \"paths\": [{\"path\":\"/\", \"parts\": {}, \"methods\": [\"PUT\", \"PUT\"]}]," + " \"params\": {" + " \"type\" : \"boolean\",\n" + " \"description\" : \"Whether specified concrete indices should be ignored when unavailable (missing or closed)\"" + @@ -48,20 +45,17 @@ public void testDuplicateMethods() throws Exception { " }," + " \"body\": null" + " }" + - "}", "ping.json", "Found duplicate method [PUT]"); + "}", "ping.json", "ping API: found duplicate method [PUT]"); } public void testDuplicatePaths() throws Exception { - parseAndExpectFailure("{\n" + + parseAndExpectIllegalArgumentException("{\n" + " \"ping\": {" + " \"documentation\": \"http://www.elasticsearch.org/guide/\"," + " \"stability\": \"stable\",\n" + - " \"methods\": [\"PUT\"]," + " \"url\": {" + - " \"path\": \"/pingone\"," + - " \"paths\": [\"/pingone\", \"/pingtwo\", \"/pingtwo\"]," + - " \"parts\": {" + - " }," + + " \"paths\": [" + + " {\"path\":\"/pingtwo\", \"methods\": [\"PUT\"]}, " + "{\"path\":\"/pingtwo\", \"methods\": [\"PUT\"]}]," + " \"params\": {" + " \"type\" : \"boolean\",\n" + " \"description\" : \"Whether specified concrete indices should be ignored when unavailable (missing or closed)\"" + @@ -69,22 +63,33 @@ public void testDuplicatePaths() throws Exception { " }," + " \"body\": null" + " }" + - "}", "ping.json", "Found duplicate path [/pingtwo]"); + "}", "ping.json", "ping API: found duplicate path [/pingtwo]"); } public void testBrokenSpecShouldThrowUsefulExceptionWhenParsingFailsOnParams() throws Exception { - parseAndExpectFailure(BROKEN_SPEC_PARAMS, "ping.json", "Expected params field in rest api definition to contain an object"); + parseAndExpectParsingException(BROKEN_SPEC_PARAMS, "ping.json", + "ping API: expected [params] field in rest api definition to contain an object"); } public void testBrokenSpecShouldThrowUsefulExceptionWhenParsingFailsOnParts() throws Exception { - parseAndExpectFailure(BROKEN_SPEC_PARTS, "ping.json", "Expected parts field in rest api definition to contain an object"); + parseAndExpectParsingException(BROKEN_SPEC_PARTS, "ping.json", + "ping API: expected [parts] field in rest api definition to contain an object"); } public void testSpecNameMatchesFilename() throws Exception { - parseAndExpectFailure("{\"ping\":{}}", "not_matching.json", "API [ping] should have the same name as its file [not_matching.json]"); + parseAndExpectIllegalArgumentException("{\"ping\":{}}", "not_matching.json", "API [ping] should have " + + "the same name as its file [not_matching.json]"); } - private void parseAndExpectFailure(String brokenJson, String location, String expectedErrorMessage) throws Exception { + private void parseAndExpectParsingException(String brokenJson, String location, String expectedErrorMessage) throws Exception { + XContentParser parser = createParser(YamlXContent.yamlXContent, brokenJson); + ClientYamlSuiteRestApiParser restApiParser = new ClientYamlSuiteRestApiParser(); + + ParsingException e = expectThrows(ParsingException.class, () -> restApiParser.parse(location, parser)); + assertThat(e.getMessage(), containsString(expectedErrorMessage)); + } + + private void parseAndExpectIllegalArgumentException(String brokenJson, String location, String expectedErrorMessage) throws Exception { XContentParser parser = createParser(YamlXContent.yamlXContent, brokenJson); ClientYamlSuiteRestApiParser restApiParser = new ClientYamlSuiteRestApiParser(); @@ -97,16 +102,12 @@ private void parseAndExpectFailure(String brokenJson, String location, String ex " \"ping\": {" + " \"documentation\": \"http://www.elasticsearch.org/guide/\"," + " \"stability\": \"stable\",\n" + - " \"methods\": [\"HEAD\"]," + " \"url\": {" + - " \"path\": \"/\"," + - " \"paths\": [\"/\"]," + - " \"parts\": {" + - " }," + - " \"params\": {" + - " \"type\" : \"boolean\",\n" + - " \"description\" : \"Whether specified concrete indices should be ignored when unavailable (missing or closed)\"\n" + - " }" + + " \"paths\": [{\"path\": \"path\", \"methods\": [\"HEAD\"]}]" + + " }," + + " \"params\": {" + + " \"type\" : \"boolean\",\n" + + " \"description\" : \"Whether specified concrete indices should be ignored when unavailable (missing or closed)\"\n" + " }," + " \"body\": null" + " }" + @@ -117,13 +118,8 @@ private void parseAndExpectFailure(String brokenJson, String location, String ex " \"ping\": {" + " \"documentation\": \"http://www.elasticsearch.org/guide/\"," + " \"stability\": \"stable\",\n" + - " \"methods\": [\"HEAD\"]," + " \"url\": {" + - " \"path\": \"/\"," + - " \"paths\": [\"/\"]," + - " \"parts\": {" + - " \"type\" : \"boolean\",\n" + - " }," + + " \"paths\": [{ \"path\":\"/\", \"parts\": { \"type\":\"boolean\",}}]," + " \"params\": {\n" + " \"ignore_unavailable\": {\n" + " \"type\" : \"boolean\",\n" + @@ -133,5 +129,4 @@ private void parseAndExpectFailure(String brokenJson, String location, String ex " \"body\": null" + " }" + "}"; - } diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java index f2211f8feacfe..601961040032f 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java @@ -21,6 +21,8 @@ import org.elasticsearch.common.xcontent.yaml.YamlXContent; import org.elasticsearch.test.rest.yaml.section.AbstractClientYamlTestFragmentParserTestCase; +import java.util.Iterator; + import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; @@ -34,20 +36,27 @@ public void testParseRestSpecIndexApi() throws Exception { assertThat(restApi, notNullValue()); assertThat(restApi.getName(), equalTo("index")); - assertThat(restApi.getMethods().size(), equalTo(2)); - assertThat(restApi.getMethods().get(0), equalTo("POST")); - assertThat(restApi.getMethods().get(1), equalTo("PUT")); assertThat(restApi.getPaths().size(), equalTo(2)); - assertThat(restApi.getPaths().get(0), equalTo("/{index}/{type}")); - assertThat(restApi.getPaths().get(1), equalTo("/{index}/{type}/{id}")); - assertThat(restApi.getPathParts().size(), equalTo(3)); - assertThat(restApi.getPathParts().keySet(), containsInAnyOrder("id", "index", "type")); - assertThat(restApi.getPathParts(), hasEntry("index", true)); - assertThat(restApi.getPathParts(), hasEntry("type", true)); - assertThat(restApi.getPathParts(), hasEntry("id", false)); + Iterator iterator = restApi.getPaths().iterator(); + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/{index}/{type}")); + assertThat(next.getMethods().length, equalTo(1)); + assertThat(next.getMethods()[0], equalTo("POST")); + assertThat(next.getParts().size(), equalTo(2)); + assertThat(next.getParts(), containsInAnyOrder("index", "type")); + } + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/{index}/{type}/{id}")); + assertThat(next.getMethods().length, equalTo(1)); + assertThat(next.getMethods()[0], equalTo("PUT")); + assertThat(next.getParts().size(), equalTo(3)); + assertThat(next.getParts(), containsInAnyOrder("id", "index", "type")); + } assertThat(restApi.getParams().size(), equalTo(4)); - assertThat(restApi.getParams().keySet(), containsInAnyOrder("wait_for_active_shards", "op_type", "parent", "refresh")); - restApi.getParams().entrySet().forEach(e -> assertThat(e.getValue(), equalTo(false))); + assertThat(restApi.getParams().keySet(), containsInAnyOrder("wait_for_active_shards", "op_type", "routing", "refresh")); + restApi.getParams().forEach((key, value) -> assertThat(value, equalTo(false))); assertThat(restApi.isBodySupported(), equalTo(true)); assertThat(restApi.isBodyRequired(), equalTo(true)); } @@ -57,13 +66,23 @@ public void testParseRestSpecGetTemplateApi() throws Exception { ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("indices.get_template.json", parser); assertThat(restApi, notNullValue()); assertThat(restApi.getName(), equalTo("indices.get_template")); - assertThat(restApi.getMethods().size(), equalTo(1)); - assertThat(restApi.getMethods().get(0), equalTo("GET")); assertThat(restApi.getPaths().size(), equalTo(2)); - assertThat(restApi.getPaths().get(0), equalTo("/_template")); - assertThat(restApi.getPaths().get(1), equalTo("/_template/{name}")); - assertThat(restApi.getPathParts().size(), equalTo(1)); - assertThat(restApi.getPathParts(), hasEntry("name", false)); + Iterator iterator = restApi.getPaths().iterator(); + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/_template")); + assertThat(next.getMethods().length, equalTo(1)); + assertThat(next.getMethods()[0], equalTo("GET")); + assertEquals(0, next.getParts().size()); + } + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/_template/{name}")); + assertThat(next.getMethods().length, equalTo(1)); + assertThat(next.getMethods()[0], equalTo("GET")); + assertThat(next.getParts().size(), equalTo(1)); + assertThat(next.getParts(), contains("name")); + } assertThat(restApi.getParams().size(), equalTo(0)); assertThat(restApi.isBodySupported(), equalTo(false)); assertThat(restApi.isBodyRequired(), equalTo(false)); @@ -74,16 +93,33 @@ public void testParseRestSpecCountApi() throws Exception { ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("count.json", parser); assertThat(restApi, notNullValue()); assertThat(restApi.getName(), equalTo("count")); - assertThat(restApi.getMethods().size(), equalTo(2)); - assertThat(restApi.getMethods().get(0), equalTo("POST")); - assertThat(restApi.getMethods().get(1), equalTo("GET")); assertThat(restApi.getPaths().size(), equalTo(3)); - assertThat(restApi.getPaths().get(0), equalTo("/_count")); - assertThat(restApi.getPaths().get(1), equalTo("/{index}/_count")); - assertThat(restApi.getPaths().get(2), equalTo("/{index}/{type}/_count")); - assertThat(restApi.getPathParts().size(), equalTo(2)); - assertThat(restApi.getPathParts().keySet(), containsInAnyOrder("index", "type")); - restApi.getPathParts().entrySet().forEach(e -> assertThat(e.getValue(), equalTo(false))); + Iterator iterator = restApi.getPaths().iterator(); + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/_count")); + assertThat(next.getMethods().length, equalTo(2)); + assertThat(next.getMethods()[0], equalTo("POST")); + assertThat(next.getMethods()[1], equalTo("GET")); + assertEquals(0, next.getParts().size()); + } + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/{index}/_count")); + assertThat(next.getMethods().length, equalTo(2)); + assertThat(next.getMethods()[0], equalTo("POST")); + assertThat(next.getMethods()[1], equalTo("GET")); + assertEquals(1, next.getParts().size()); + assertThat(next.getParts(), contains("index")); + } + { + ClientYamlSuiteRestApi.Path next = iterator.next(); + assertThat(next.getPath(), equalTo("/{index}/{type}/_count")); + assertThat(next.getMethods().length, equalTo(2)); + assertThat(next.getMethods()[0], equalTo("POST")); + assertThat(next.getMethods()[1], equalTo("GET")); + assertThat(next.getParts(), containsInAnyOrder("index", "type")); + } assertThat(restApi.getParams().size(), equalTo(1)); assertThat(restApi.getParams().keySet(), contains("ignore_unavailable")); assertThat(restApi.getParams(), hasEntry("ignore_unavailable", false)); @@ -96,10 +132,16 @@ public void testRequiredBodyWithoutUrlParts() throws Exception { " \"count\": {\n" + " \"documentation\": \"whatever\",\n" + " \"stability\": \"stable\",\n" + - " \"methods\": [ \"GET\", \"POST\" ],\n" + " \"url\": {\n" + - " \"path\": \"/whatever\",\n" + - " \"paths\": [ \"/whatever\" ]\n" + + " \"paths\": [ \n" + + " {\n" + + " \"path\":\"/whatever\",\n" + + " \"methods\":[\n" + + " \"POST\",\n" + + " \"GET\"\n" + + " ]\n" + + " }\n" + + " ]\n" + " },\n" + " \"body\": {\n" + " \"description\" : \"whatever\",\n" + @@ -112,113 +154,190 @@ public void testRequiredBodyWithoutUrlParts() throws Exception { ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("count.json", parser); assertThat(restApi, notNullValue()); - assertThat(restApi.getPathParts().isEmpty(), equalTo(true)); + assertThat(restApi.getPaths().size(), equalTo(1)); + assertThat(restApi.getPaths().iterator().next().getParts().isEmpty(), equalTo(true)); assertThat(restApi.getParams().isEmpty(), equalTo(true)); assertThat(restApi.isBodyRequired(), equalTo(true)); } private static final String REST_SPEC_COUNT_API = "{\n" + - " \"count\": {\n" + - " \"documentation\": \"http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html\",\n" + - " \"stability\": \"stable\",\n" + - " \"methods\": [\"POST\", \"GET\"],\n" + - " \"url\": {\n" + - " \"path\": \"/_count\",\n" + - " \"paths\": [\"/_count\", \"/{index}/_count\", \"/{index}/{type}/_count\"],\n" + - " \"parts\": {\n" + - " \"index\": {\n" + - " \"type\" : \"list\",\n" + - " \"description\" : \"A comma-separated list of indices to restrict the results\"\n" + - " },\n" + - " \"type\": {\n" + - " \"type\" : \"list\",\n" + - " \"description\" : \"A comma-separated list of types to restrict the results\"\n" + - " }\n" + - " },\n" + - " \"params\": {\n" + - " \"ignore_unavailable\": {\n" + - " \"type\" : \"boolean\",\n" + - " \"description\" : \"Whether specified concrete indices should be ignored when unavailable (missing or closed)\"\n" + - " } \n" + - " }\n" + - " },\n" + - " \"body\": {\n" + - " \"description\" : \"A query to restrict the results specified with the Query DSL (optional)\"\n" + - " }\n" + - " }\n" + - "}\n"; + " \"count\":{\n" + + " \"documentation\":{\n" + + " \"url\":\"http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html\",\n" + + " \"description\":\"Returns number of documents matching a query.\"\n" + + " },\n" + + " \"stability\": \"stable\",\n" + + " \"url\":{\n" + + " \"paths\":[\n" + + " {\n" + + " \"path\":\"/_count\",\n" + + " \"methods\":[\n" + + " \"POST\",\n" + + " \"GET\"\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/_count\",\n" + + " \"methods\":[\n" + + " \"POST\",\n" + + " \"GET\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"list\",\n" + + " \"description\":\"A comma-separated list of indices to restrict the results\"\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/{type}/_count\",\n" + + " \"methods\":[\n" + + " \"POST\",\n" + + " \"GET\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"list\",\n" + + " \"description\":\"A comma-separated list of indices to restrict the results\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"list\",\n" + + " \"description\":\"A comma-separated list of types to restrict the results\",\n" + + " \"deprecated\":true\n" + + " }\n" + + " }\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"params\":{\n" + + " \"ignore_unavailable\":{\n" + + " \"type\":\"boolean\",\n" + + " \"description\":\"Whether specified concrete indices should be ignored when unavailable (missing or closed)\"\n" + + " }\n" + + " },\n" + + " \"body\":{\n" + + " \"description\":\"A query to restrict the results specified with the Query DSL (optional)\"\n" + + " }\n" + + " }\n" + + "}\n\n"; private static final String REST_SPEC_GET_TEMPLATE_API = "{\n" + - " \"indices.get_template\": {\n" + - " \"documentation\": \"http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/\",\n" + - " \"stability\": \"stable\",\n" + - " \"methods\": [\"GET\"],\n" + - " \"url\": {\n" + - " \"path\": \"/_template/{name}\",\n" + - " \"paths\": [\"/_template\", \"/_template/{name}\"],\n" + - " \"parts\": {\n" + - " \"name\": {\n" + - " \"type\" : \"string\",\n" + - " \"required\" : false,\n" + - " \"description\" : \"The name of the template\"\n" + - " }\n" + - " },\n" + - " \"params\": {\n" + - " }\n" + - " },\n" + - " \"body\": null\n" + - " }\n" + - "}"; + " \"indices.get_template\":{\n" + + " \"documentation\":{\n" + + " \"url\":\"http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html\",\n" + + " \"description\":\"Returns an index template.\"\n" + + " },\n" + + " \"stability\": \"stable\",\n" + + " \"url\":{\n" + + " \"paths\":[\n" + + " {\n" + + " \"path\":\"/_template\",\n" + + " \"methods\":[\n" + + " \"GET\"\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"path\":\"/_template/{name}\",\n" + + " \"methods\":[\n" + + " \"GET\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"name\":{\n" + + " \"type\":\"list\",\n" + + " \"description\":\"The comma separated names of the index templates\"\n" + + " }\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + "}\n"; private static final String REST_SPEC_INDEX_API = "{\n" + - " \"index\": {\n" + - " \"documentation\": \"http://elasticsearch.org/guide/reference/api/index_/\",\n" + - " \"stability\": \"stable\",\n" + - " \"methods\": [\"POST\", \"PUT\"],\n" + - " \"url\": {\n" + - " \"path\": \"/{index}/{type}\",\n" + - " \"paths\": [\"/{index}/{type}\", \"/{index}/{type}/{id}\"],\n" + - " \"parts\": {\n" + - " \"id\": {\n" + - " \"type\" : \"string\",\n" + - " \"description\" : \"Document ID\"\n" + - " },\n" + - " \"index\": {\n" + - " \"type\" : \"string\",\n" + - " \"required\" : true,\n" + - " \"description\" : \"The name of the index\"\n" + - " },\n" + - " \"type\": {\n" + - " \"type\" : \"string\",\n" + - " \"required\" : true,\n" + - " \"description\" : \"The type of the document\"\n" + - " }\n" + - " } ,\n" + - " \"params\": {\n" + - " \"wait_for_active_shards\": {\n" + - " \"type\" : \"string\",\n" + - " \"description\" : \"The number of active shard copies required to perform the operation\"\n" + - " },\n" + - " \"op_type\": {\n" + - " \"type\" : \"enum\",\n" + - " \"options\" : [\"index\", \"create\"],\n" + - " \"default\" : \"index\",\n" + - " \"description\" : \"Explicit operation type\"\n" + - " },\n" + - " \"parent\": {\n" + - " \"type\" : \"string\",\n" + - " \"description\" : \"ID of the parent document\"\n" + - " },\n" + - " \"refresh\": {\n" + - " \"type\" : \"boolean\",\n" + - " \"description\" : \"Refresh the index after performing the operation\"\n" + - " }\n" + - " }\n" + - " },\n" + - " \"body\": {\n" + - " \"description\" : \"The document\",\n" + - " \"required\" : true\n" + - " }\n" + - " }\n" + - "}\n"; + " \"index\":{\n" + + " \"documentation\":{\n" + + " \"url\":\"http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html\",\n" + + " \"description\":\"Creates or updates a document in an index.\"\n" + + " },\n" + + " \"stability\": \"stable\",\n" + + " \"url\":{\n" + + " \"paths\":[\n" + + " {\n" + + " \"path\":\"/{index}/{type}\",\n" + + " \"methods\":[\n" + + " \"POST\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The name of the index\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The type of the document\",\n" + + " \"deprecated\":true\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/{type}/{id}\",\n" + + " \"methods\":[\n" + + " \"PUT\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"id\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Document ID\"\n" + + " },\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The name of the index\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The type of the document\",\n" + + " \"deprecated\":true\n" + + " }\n" + + " },\n" + + " \"deprecated\":{\n" + + " \"version\":\"7.0.0\",\n" + + " \"description\":\"Specifying types in urls has been deprecated\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"params\":{\n" + + " \"wait_for_active_shards\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Sets the number of shard copies that must be active before proceeding with the index operation. \"\n" + + " },\n" + + " \"op_type\":{\n" + + " \"type\":\"enum\",\n" + + " \"options\":[\n" + + " \"index\",\n" + + " \"create\"\n" + + " ],\n" + + " \"default\":\"index\",\n" + + " \"description\":\"Explicit operation type\"\n" + + " },\n" + + " \"refresh\":{\n" + + " \"type\":\"enum\",\n" + + " \"options\":[\n" + + " \"true\",\n" + + " \"false\",\n" + + " \"wait_for\"\n" + + " ],\n" + + " \"description\":\"If `true` then refresh the affected shards to make this operation visible to search\"\n" + + " },\n" + + " \"routing\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Specific routing value\"\n" + + " }\n" + + " },\n" + + " \"body\":{\n" + + " \"description\":\"The document\",\n" + + " \"required\":true\n" + + " }\n" + + " }\n" + + "}\n"; } diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java new file mode 100644 index 0000000000000..5012275624c61 --- /dev/null +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java @@ -0,0 +1,270 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.elasticsearch.test.rest.yaml.restspec; + +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.test.ESTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +public class ClientYamlSuiteRestApiTests extends ESTestCase { + + public void testPathMatching() throws IOException { + XContentParser parser = createParser(YamlXContent.yamlXContent, REST_SPEC_API); + ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("index.json", parser); + { + List paths = restApi.getBestMatchingPaths(Collections.emptySet()); + assertEquals(1, paths.size()); + assertEquals("/_doc", paths.get(0).getPath()); + } + { + List paths = restApi.getBestMatchingPaths(Collections.singleton("wait_for_active_shards")); + assertEquals(1, paths.size()); + assertEquals("/_doc", paths.get(0).getPath()); + } + { + List paths = restApi.getBestMatchingPaths(Collections.singleton("index")); + assertEquals(1, paths.size()); + assertEquals("/{index}/_doc", paths.get(0).getPath()); + } + { + List paths = restApi.getBestMatchingPaths(Set.of("index", "id")); + assertEquals(1, paths.size()); + assertEquals("/{index}/_doc/{id}", paths.get(0).getPath()); + } + { + List paths = restApi.getBestMatchingPaths(Set.of("index", "type")); + assertEquals(3, paths.size()); + assertEquals("/{index}/_mapping/{type}", paths.get(0).getPath()); + assertEquals("/{index}/{type}", paths.get(1).getPath()); + assertEquals("/{index}/_mappings/{type}", paths.get(2).getPath()); + } + { + List paths = restApi.getBestMatchingPaths(Set.of("index", "type", "id")); + assertEquals(1, paths.size()); + assertEquals("/{index}/{type}/{id}", paths.get(0).getPath()); + } + } + + private static final String REST_SPEC_API = "{\n" + + " \"index\":{\n" + + " \"documentation\":{\n" + + " \"url\":\"http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html\",\n" + + " \"description\":\"Creates or updates a document in an index.\"\n" + + " },\n" + + " \"stability\":\"stable\",\n" + + " \"url\":{\n" + + " \"paths\":[\n" + + " {\n" + + " \"path\":\"/_doc\",\n" + + " \"methods\":[\n" + + " \"PUT\"\n" + + " ],\n" + + " \"parts\":{\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/_mapping/{type}\",\n" + + " \"methods\":[\n" + + " \"PUT\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"required\":true,\n" + + " \"description\":\"The name of the index\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The type of the document\"\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/_mappings/{type}\",\n" + + " \"methods\":[\n" + + " \"PUT\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"required\":true,\n" + + " \"description\":\"The name of the index\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The type of the document\"\n" + + " }\n" + + " }\n" + + " },\n" + + + " {\n" + + " \"path\":\"/{index}/_doc/{id}\",\n" + + " \"methods\":[\n" + + " \"PUT\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"id\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Document ID\"\n" + + " },\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"required\":true,\n" + + " \"description\":\"The name of the index\"\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/_doc\",\n" + + " \"methods\":[\n" + + " \"POST\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"required\":true,\n" + + " \"description\":\"The name of the index\"\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/{type}\",\n" + + " \"methods\":[\n" + + " \"POST\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"required\":true,\n" + + " \"description\":\"The name of the index\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The type of the document\",\n" + + " \"deprecated\":true\n" + + " }\n" + + " },\n" + + " \"deprecated\":{\n" + + " \"version\":\"7.0.0\",\n" + + " \"description\":\"Specifying types in urls has been deprecated\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"path\":\"/{index}/{type}/{id}\",\n" + + " \"methods\":[\n" + + " \"PUT\"\n" + + " ],\n" + + " \"parts\":{\n" + + " \"id\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Document ID\"\n" + + " },\n" + + " \"index\":{\n" + + " \"type\":\"string\",\n" + + " \"required\":true,\n" + + " \"description\":\"The name of the index\"\n" + + " },\n" + + " \"type\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The type of the document\",\n" + + " \"deprecated\":true\n" + + " }\n" + + " },\n" + + " \"deprecated\":{\n" + + " \"version\":\"7.0.0\",\n" + + " \"description\":\"Specifying types in urls has been deprecated\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"params\":{\n" + + " \"wait_for_active_shards\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Sets the number of shard copies that must be active before proceeding with the index operation. " + + "Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less " + + "than or equal to the total number of copies for the shard (number of replicas + 1)\"\n" + + " },\n" + + " \"op_type\":{\n" + + " \"type\":\"enum\",\n" + + " \"options\":[\n" + + " \"index\",\n" + + " \"create\"\n" + + " ],\n" + + " \"default\":\"index\",\n" + + " \"description\":\"Explicit operation type\"\n" + + " },\n" + + " \"refresh\":{\n" + + " \"type\":\"enum\",\n" + + " \"options\":[\n" + + " \"true\",\n" + + " \"false\",\n" + + " \"wait_for\"\n" + + " ],\n" + + " \"description\":\"If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` " + + "then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.\"\n" + + " },\n" + + " \"routing\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"Specific routing value\"\n" + + " },\n" + + " \"timeout\":{\n" + + " \"type\":\"time\",\n" + + " \"description\":\"Explicit operation timeout\"\n" + + " },\n" + + " \"version\":{\n" + + " \"type\":\"number\",\n" + + " \"description\":\"Explicit version number for concurrency control\"\n" + + " },\n" + + " \"version_type\":{\n" + + " \"type\":\"enum\",\n" + + " \"options\":[\n" + + " \"internal\",\n" + + " \"external\",\n" + + " \"external_gte\",\n" + + " \"force\"\n" + + " ],\n" + + " \"description\":\"Specific version type\"\n" + + " },\n" + + " \"if_seq_no\":{\n" + + " \"type\":\"number\",\n" + + " \"description\":\"only perform the index operation if the last operation that has changed the document has the " + + "specified sequence number\"\n" + + " },\n" + + " \"if_primary_term\":{\n" + + " \"type\":\"number\",\n" + + " \"description\":\"only perform the index operation if the last operation that has changed the document has the " + + "specified primary term\"\n" + + " },\n" + + " \"pipeline\":{\n" + + " \"type\":\"string\",\n" + + " \"description\":\"The pipeline id to preprocess incoming documents with\"\n" + + " }\n" + + " },\n" + + " \"body\":{\n" + + " \"description\":\"The document\",\n" + + " \"required\":true\n" + + " }\n" + + " }\n" + + "}\n"; +} diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json index 5e283c2a4a3e8..b4996d22861a7 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.put_data_frame_transform.json @@ -20,6 +20,13 @@ } ] }, + "params": { + "defer_validation": { + "type": "boolean", + "required": false, + "description": "If validations should be deferred until data frame transform starts, defaults to false." + } + }, "body":{ "description":"The data frame transform definition", "required":true diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.update_data_frame_transform.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.update_data_frame_transform.json index 91a044ef5711a..5dcf277796555 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.update_data_frame_transform.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/data_frame.update_data_frame_transform.json @@ -1,23 +1,29 @@ { "data_frame.update_data_frame_transform": { - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-data-frame-transform.html", + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-data-frame-transform.html" + }, "stability": "beta", - "methods": [ "POST" ], "url": { - "paths": [ "/_data_frame/transforms/{transform_id}/_update" ], - "parts": { - "transform_id": { - "type": "string", - "required": true, - "description": "The id of the transform." - } - }, - "params": { - "defer_validation": { - "type": "boolean", - "required": false, - "description": "If validations should be deferred until data frame transform starts, defaults to false." + "paths": [ + { + "path": "/_data_frame/transforms/{transform_id}/_update", + "methods": [ "POST" ], + "parts": { + "transform_id": { + "type": "string", + "required": true, + "description": "The id of the transform." + } + } } + ] + }, + "params": { + "defer_validation": { + "type": "boolean", + "required": false, + "description": "If validations should be deferred until data frame transform starts, defaults to false." } }, "body": { diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json index 9919547466e73..e00cc9aceb9eb 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ilm.explain_lifecycle.json @@ -20,6 +20,15 @@ } ] }, - "params":{} + "params": { + "only_managed": { + "type": "boolean", + "description": "filters the indices included in the response to ones managed by ILM" + }, + "only_errors": { + "type": "boolean", + "description": "filters the indices included in the response to ones in an ILM error state, implies only_managed" + } + } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.estimate_memory_usage.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.estimate_memory_usage.json index d9ab86533d943..99bd6527de3b1 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.estimate_memory_usage.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.estimate_memory_usage.json @@ -1,12 +1,17 @@ { "ml.estimate_memory_usage": { - "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html", + "documentation": { + "url": "http://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html" + }, "stability": "experimental", - "methods": [ "POST" ], "url": { - "path": "/_ml/data_frame/analytics/_estimate_memory_usage", - "paths": [ "/_ml/data_frame/analytics/_estimate_memory_usage" ], - "parts": {} + "paths" : [ + { + "path" : "/_ml/data_frame/analytics/_estimate_memory_usage", + "methods": [ "POST" ], + "parts": {} + } + ] }, "body": { "description" : "Memory usage estimation definition",