elasticsearch-serverless 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/elasticsearch-serverless/api/async_search/delete.rb +3 -4
- data/lib/elasticsearch-serverless/api/async_search/get.rb +4 -5
- data/lib/elasticsearch-serverless/api/async_search/status.rb +11 -8
- data/lib/elasticsearch-serverless/api/async_search/submit.rb +6 -10
- data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
- data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -18
- data/lib/elasticsearch-serverless/api/cat/component_templates.rb +17 -16
- data/lib/elasticsearch-serverless/api/cat/count.rb +13 -18
- data/lib/elasticsearch-serverless/api/cat/help.rb +5 -19
- data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -15
- data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -17
- data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -16
- data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -16
- data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -16
- data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -16
- data/lib/elasticsearch-serverless/api/clear_scroll.rb +9 -7
- data/lib/elasticsearch-serverless/api/close_point_in_time.rb +8 -4
- data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +3 -5
- data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +4 -5
- data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +5 -6
- data/lib/elasticsearch-serverless/api/cluster/info.rb +3 -4
- data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +6 -5
- data/lib/elasticsearch-serverless/api/connector/check_in.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/delete.rb +4 -4
- data/lib/elasticsearch-serverless/api/connector/get.rb +5 -5
- data/lib/elasticsearch-serverless/api/connector/list.rb +4 -3
- data/lib/elasticsearch-serverless/api/connector/post.rb +3 -3
- data/lib/elasticsearch-serverless/api/connector/put.rb +4 -5
- data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +7 -6
- data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +7 -6
- data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +7 -6
- data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +3 -3
- data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +3 -3
- data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_error.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +2 -3
- data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_name.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_native.rb +2 -3
- data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_status.rb +3 -4
- data/lib/elasticsearch-serverless/api/count.rb +36 -25
- data/lib/elasticsearch-serverless/api/create.rb +77 -22
- data/lib/elasticsearch-serverless/api/delete.rb +44 -18
- data/lib/elasticsearch-serverless/api/delete_by_query.rb +91 -29
- data/lib/elasticsearch-serverless/api/delete_script.rb +10 -9
- data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +5 -5
- data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +6 -5
- data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +6 -6
- data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/delete.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/get.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/get_status.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/search.rb +9 -5
- data/lib/elasticsearch-serverless/api/exists.rb +38 -19
- data/lib/elasticsearch-serverless/api/exists_source.rb +23 -18
- data/lib/elasticsearch-serverless/api/explain.rb +25 -16
- data/lib/elasticsearch-serverless/api/field_caps.rb +16 -13
- data/lib/elasticsearch-serverless/api/get.rb +71 -21
- data/lib/elasticsearch-serverless/api/get_script.rb +7 -6
- data/lib/elasticsearch-serverless/api/get_source.rb +25 -15
- data/lib/elasticsearch-serverless/api/graph/explore.rb +9 -5
- data/lib/elasticsearch-serverless/api/index.rb +110 -21
- data/lib/elasticsearch-serverless/api/indices/add_block.rb +23 -12
- data/lib/elasticsearch-serverless/api/indices/analyze.rb +9 -6
- data/lib/elasticsearch-serverless/api/indices/create.rb +19 -6
- data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +3 -5
- data/lib/elasticsearch-serverless/api/indices/delete.rb +11 -8
- data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +4 -7
- data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +3 -4
- data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +3 -4
- data/lib/elasticsearch-serverless/api/indices/exists.rb +7 -8
- data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +8 -8
- data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +6 -6
- data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +4 -5
- data/lib/elasticsearch-serverless/api/indices/get.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/get_alias.rb +6 -6
- data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +4 -5
- data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +4 -6
- data/lib/elasticsearch-serverless/api/indices/get_settings.rb +6 -7
- data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +3 -4
- data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +3 -3
- data/lib/elasticsearch-serverless/api/indices/put_alias.rb +4 -7
- data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +4 -6
- data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +22 -4
- data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +21 -6
- data/lib/elasticsearch-serverless/api/indices/put_settings.rb +17 -7
- data/lib/elasticsearch-serverless/api/indices/refresh.rb +11 -5
- data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +5 -5
- data/lib/elasticsearch-serverless/api/indices/rollover.rb +28 -5
- data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +4 -5
- data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +3 -3
- data/lib/elasticsearch-serverless/api/indices/validate_query.rb +4 -5
- data/lib/elasticsearch-serverless/api/inference/chat_completion_unified.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/completion.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/delete.rb +6 -11
- data/lib/elasticsearch-serverless/api/inference/get.rb +4 -9
- data/lib/elasticsearch-serverless/api/inference/inference.rb +0 -4
- data/lib/elasticsearch-serverless/api/inference/put.rb +12 -9
- data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
- data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
- data/lib/elasticsearch-serverless/api/info.rb +4 -4
- data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
- data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
- data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
- data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
- data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
- data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
- data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
- data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
- data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
- data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
- data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
- data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
- data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
- data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
- data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
- data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch-serverless/api/mget.rb +12 -5
- data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
- data/lib/elasticsearch-serverless/api/msearch_template.rb +23 -16
- data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
- data/lib/elasticsearch-serverless/api/open_point_in_time.rb +33 -11
- data/lib/elasticsearch-serverless/api/ping.rb +8 -10
- data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
- data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
- data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
- data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
- data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
- data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
- data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
- data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
- data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
- data/lib/elasticsearch-serverless/api/rank_eval.rb +8 -7
- data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
- data/lib/elasticsearch-serverless/api/render_search_template.rb +7 -7
- data/lib/elasticsearch-serverless/api/response.rb +1 -1
- data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
- data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
- data/lib/elasticsearch-serverless/api/search.rb +79 -72
- data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
- data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
- data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
- data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_mvt.rb +132 -10
- data/lib/elasticsearch-serverless/api/search_template.rb +13 -13
- data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
- data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
- data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
- data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
- data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
- data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
- data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
- data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
- data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
- data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
- data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
- data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
- data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
- data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
- data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
- data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
- data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
- data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
- data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
- data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
- data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
- data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
- data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
- data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
- data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
- data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
- data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
- data/lib/elasticsearch-serverless/api/termvectors.rb +40 -17
- data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
- data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
- data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
- data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
- data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
- data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
- data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
- data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
- data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
- data/lib/elasticsearch-serverless/api/update.rb +36 -24
- data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
- data/lib/elasticsearch-serverless/api.rb +22 -25
- data/lib/elasticsearch-serverless/version.rb +1 -1
- data/lib/elasticsearch-serverless.rb +7 -0
- metadata +18 -7
@@ -22,42 +22,164 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Actions
|
24
24
|
# Search a vector tile.
|
25
|
-
#
|
25
|
+
# Search a vector tile for geospatial values.
|
26
|
+
# Before using this API, you should be familiar with the Mapbox vector tile specification.
|
27
|
+
# The API returns results as a binary mapbox vector tile.
|
28
|
+
# Internally, Elasticsearch translates a vector tile search API request into a search containing:
|
29
|
+
# * A +geo_bounding_box+ query on the +<field>+. The query uses the +<zoom>/<x>/<y>+ tile as a bounding box.
|
30
|
+
# * A +geotile_grid+ or +geohex_grid+ aggregation on the +<field>+. The +grid_agg+ parameter determines the aggregation type. The aggregation uses the +<zoom>/<x>/<y>+ tile as a bounding box.
|
31
|
+
# * Optionally, a +geo_bounds+ aggregation on the +<field>+. The search only includes this aggregation if the +exact_bounds+ parameter is +true+.
|
32
|
+
# * If the optional parameter +with_labels+ is +true+, the internal search will include a dynamic runtime field that calls the +getLabelPosition+ function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label.
|
33
|
+
# For example, Elasticsearch may translate a vector tile search API request with a +grid_agg+ argument of +geotile+ and an +exact_bounds+ argument of +true+ into the following search
|
34
|
+
# +
|
35
|
+
# GET my-index/_search
|
36
|
+
# {
|
37
|
+
# "size": 10000,
|
38
|
+
# "query": {
|
39
|
+
# "geo_bounding_box": {
|
40
|
+
# "my-geo-field": {
|
41
|
+
# "top_left": {
|
42
|
+
# "lat": -40.979898069620134,
|
43
|
+
# "lon": -45
|
44
|
+
# },
|
45
|
+
# "bottom_right": {
|
46
|
+
# "lat": -66.51326044311186,
|
47
|
+
# "lon": 0
|
48
|
+
# }
|
49
|
+
# }
|
50
|
+
# }
|
51
|
+
# },
|
52
|
+
# "aggregations": {
|
53
|
+
# "grid": {
|
54
|
+
# "geotile_grid": {
|
55
|
+
# "field": "my-geo-field",
|
56
|
+
# "precision": 11,
|
57
|
+
# "size": 65536,
|
58
|
+
# "bounds": {
|
59
|
+
# "top_left": {
|
60
|
+
# "lat": -40.979898069620134,
|
61
|
+
# "lon": -45
|
62
|
+
# },
|
63
|
+
# "bottom_right": {
|
64
|
+
# "lat": -66.51326044311186,
|
65
|
+
# "lon": 0
|
66
|
+
# }
|
67
|
+
# }
|
68
|
+
# }
|
69
|
+
# },
|
70
|
+
# "bounds": {
|
71
|
+
# "geo_bounds": {
|
72
|
+
# "field": "my-geo-field",
|
73
|
+
# "wrap_longitude": false
|
74
|
+
# }
|
75
|
+
# }
|
76
|
+
# }
|
77
|
+
# }
|
78
|
+
# +
|
79
|
+
# The API returns results as a binary Mapbox vector tile.
|
80
|
+
# Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers:
|
81
|
+
# * A +hits+ layer containing a feature for each +<field>+ value matching the +geo_bounding_box+ query.
|
82
|
+
# * An +aggs+ layer containing a feature for each cell of the +geotile_grid+ or +geohex_grid+. The layer only contains features for cells with matching data.
|
83
|
+
# * A meta layer containing:
|
84
|
+
# * A feature containing a bounding box. By default, this is the bounding box of the tile.
|
85
|
+
# * Value ranges for any sub-aggregations on the +geotile_grid+ or +geohex_grid+.
|
86
|
+
# * Metadata for the search.
|
87
|
+
# The API only returns features that can display at its zoom level.
|
88
|
+
# For example, if a polygon feature has no area at its zoom level, the API omits it.
|
89
|
+
# The API returns errors as UTF-8 encoded JSON.
|
90
|
+
# IMPORTANT: You can specify several options for this API as either a query parameter or request body parameter.
|
91
|
+
# If you specify both parameters, the query parameter takes precedence.
|
92
|
+
# **Grid precision for geotile**
|
93
|
+
# For a +grid_agg+ of +geotile+, you can use cells in the +aggs+ layer as tiles for lower zoom levels.
|
94
|
+
# +grid_precision+ represents the additional zoom levels available through these cells. The final precision is computed by as follows: +<zoom> + grid_precision+.
|
95
|
+
# For example, if +<zoom>+ is 7 and +grid_precision+ is 8, then the +geotile_grid+ aggregation will use a precision of 15.
|
96
|
+
# The maximum final precision is 29.
|
97
|
+
# The +grid_precision+ also determines the number of cells for the grid as follows: +(2^grid_precision) x (2^grid_precision)+.
|
98
|
+
# For example, a value of 8 divides the tile into a grid of 256 x 256 cells.
|
99
|
+
# The +aggs+ layer only contains features for cells with matching data.
|
100
|
+
# **Grid precision for geohex**
|
101
|
+
# For a +grid_agg+ of +geohex+, Elasticsearch uses +<zoom>+ and +grid_precision+ to calculate a final precision as follows: +<zoom> + grid_precision+.
|
102
|
+
# This precision determines the H3 resolution of the hexagonal cells produced by the +geohex+ aggregation.
|
103
|
+
# The following table maps the H3 resolution for each precision.
|
104
|
+
# For example, if +<zoom>+ is 3 and +grid_precision+ is 3, the precision is 6.
|
105
|
+
# At a precision of 6, hexagonal cells have an H3 resolution of 2.
|
106
|
+
# If +<zoom>+ is 3 and +grid_precision+ is 4, the precision is 7.
|
107
|
+
# At a precision of 7, hexagonal cells have an H3 resolution of 3.
|
108
|
+
# | Precision | Unique tile bins | H3 resolution | Unique hex bins | Ratio |
|
109
|
+
# | --------- | ---------------- | ------------- | ----------------| ----- |
|
110
|
+
# | 1 | 4 | 0 | 122 | 30.5 |
|
111
|
+
# | 2 | 16 | 0 | 122 | 7.625 |
|
112
|
+
# | 3 | 64 | 1 | 842 | 13.15625 |
|
113
|
+
# | 4 | 256 | 1 | 842 | 3.2890625 |
|
114
|
+
# | 5 | 1024 | 2 | 5882 | 5.744140625 |
|
115
|
+
# | 6 | 4096 | 2 | 5882 | 1.436035156 |
|
116
|
+
# | 7 | 16384 | 3 | 41162 | 2.512329102 |
|
117
|
+
# | 8 | 65536 | 3 | 41162 | 0.6280822754 |
|
118
|
+
# | 9 | 262144 | 4 | 288122 | 1.099098206 |
|
119
|
+
# | 10 | 1048576 | 4 | 288122 | 0.2747745514 |
|
120
|
+
# | 11 | 4194304 | 5 | 2016842 | 0.4808526039 |
|
121
|
+
# | 12 | 16777216 | 6 | 14117882 | 0.8414913416 |
|
122
|
+
# | 13 | 67108864 | 6 | 14117882 | 0.2103728354 |
|
123
|
+
# | 14 | 268435456 | 7 | 98825162 | 0.3681524172 |
|
124
|
+
# | 15 | 1073741824 | 8 | 691776122 | 0.644266719 |
|
125
|
+
# | 16 | 4294967296 | 8 | 691776122 | 0.1610666797 |
|
126
|
+
# | 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 |
|
127
|
+
# | 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 |
|
128
|
+
# | 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 |
|
129
|
+
# | 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 |
|
130
|
+
# | 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 |
|
131
|
+
# | 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 |
|
132
|
+
# | 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 |
|
133
|
+
# | 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 |
|
134
|
+
# | 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 |
|
135
|
+
# | 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 |
|
136
|
+
# | 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 |
|
137
|
+
# | 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 |
|
138
|
+
# | 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 |
|
139
|
+
# Hexagonal cells don't align perfectly on a vector tile.
|
140
|
+
# Some cells may intersect more than one vector tile.
|
141
|
+
# To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level.
|
142
|
+
# Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.
|
26
143
|
#
|
27
144
|
# @option arguments [String, Array] :index Comma-separated list of data streams, indices, or aliases to search (*Required*)
|
28
145
|
# @option arguments [String] :field Field containing geospatial data to return (*Required*)
|
29
146
|
# @option arguments [Integer] :zoom Zoom level for the vector tile to search (*Required*)
|
30
147
|
# @option arguments [Integer] :x X coordinate for the vector tile to search (*Required*)
|
31
148
|
# @option arguments [Integer] :y Y coordinate for the vector tile to search (*Required*)
|
32
|
-
# @option arguments [Boolean] :exact_bounds If false
|
33
|
-
# If true, the meta layer
|
149
|
+
# @option arguments [Boolean] :exact_bounds If +false+, the meta layer's feature is the bounding box of the tile.
|
150
|
+
# If true, the meta layer's feature is a bounding box resulting from a
|
34
151
|
# geo_bounds aggregation. The aggregation runs on <field> values that intersect
|
35
152
|
# the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting
|
36
153
|
# bounding box may be larger than the vector tile.
|
37
|
-
# @option arguments [Integer] :extent
|
154
|
+
# @option arguments [Integer] :extent The size, in pixels, of a side of the tile. Vector tiles are square with equal sides. Server default: 4096.
|
38
155
|
# @option arguments [String] :grid_agg Aggregation used to create a grid for +field+.
|
39
156
|
# @option arguments [Integer] :grid_precision Additional zoom levels available through the aggs layer. For example, if <zoom> is 7
|
40
157
|
# and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
|
41
|
-
# don
|
158
|
+
# don't include the aggs layer. Server default: 8.
|
42
159
|
# @option arguments [String] :grid_type Determines the geometry type for features in the aggs layer. In the aggs layer,
|
43
160
|
# each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
|
44
161
|
# of the cells bounding box. If 'point' each feature is a Point that is the centroid
|
45
162
|
# of the cell. Server default: grid.
|
46
163
|
# @option arguments [Integer] :size Maximum number of features to return in the hits layer. Accepts 0-10000.
|
47
|
-
# If 0, results don
|
164
|
+
# If 0, results don't include the hits layer. Server default: 10000.
|
48
165
|
# @option arguments [Boolean] :with_labels If +true+, the hits and aggs layers will contain additional point features representing
|
49
166
|
# suggested label positions for the original features.
|
167
|
+
# - +Point+ and +MultiPoint+ features will have one of the points selected.
|
168
|
+
# - +Polygon+ and +MultiPolygon+ features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.
|
169
|
+
# - +LineString+ features will likewise provide a roughly central point selected from the triangle-tree.
|
170
|
+
# - The aggregation results will provide one central point for each aggregation bucket.
|
171
|
+
# All attributes from the original features will also be copied to the new label features.
|
172
|
+
# In addition, the new features will be distinguishable using the tag +_mvt_label_position+.
|
50
173
|
# @option arguments [Hash] :headers Custom HTTP headers
|
51
174
|
# @option arguments [Hash] :body request body
|
52
175
|
#
|
53
|
-
# @see https://www.elastic.co/
|
176
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt
|
54
177
|
#
|
55
178
|
def search_mvt(arguments = {})
|
56
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
179
|
+
request_opts = { endpoint: arguments[:endpoint] || 'search_mvt' }
|
57
180
|
|
58
|
-
defined_params = [:index, :field, :zoom, :x, :y].
|
181
|
+
defined_params = [:index, :field, :zoom, :x, :y].each_with_object({}) do |variable, set_variables|
|
59
182
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
60
|
-
set_variables
|
61
183
|
end
|
62
184
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
63
185
|
|
@@ -21,41 +21,41 @@
|
|
21
21
|
module ElasticsearchServerless
|
22
22
|
module API
|
23
23
|
module Actions
|
24
|
-
#
|
24
|
+
# Run a search with a search template.
|
25
25
|
#
|
26
|
-
# @option arguments [String, Array] :index
|
27
|
-
#
|
26
|
+
# @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
|
27
|
+
# It supports wildcards (+*+).
|
28
28
|
# @option arguments [Boolean] :allow_no_indices If +false+, the request returns an error if any wildcard expression, index alias, or +_all+ value targets only missing or closed indices.
|
29
29
|
# This behavior applies even if the request targets other open indices.
|
30
30
|
# For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true.
|
31
31
|
# @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips are minimized for cross-cluster search requests.
|
32
|
-
# @option arguments [String, Array<String>] :expand_wildcards
|
32
|
+
# @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
|
33
33
|
# If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
|
34
34
|
# Supports comma-separated values, such as +open,hidden+.
|
35
35
|
# Valid values are: +all+, +open+, +closed+, +hidden+, +none+.
|
36
36
|
# @option arguments [Boolean] :explain If +true+, the response includes additional details about score computation as part of a hit.
|
37
37
|
# @option arguments [Boolean] :ignore_throttled If +true+, specified concrete, expanded, or aliased indices are not included in the response when throttled. Server default: true.
|
38
38
|
# @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
|
39
|
-
# @option arguments [String] :preference
|
40
|
-
#
|
39
|
+
# @option arguments [String] :preference The node or shard the operation should be performed on.
|
40
|
+
# It is random by default.
|
41
41
|
# @option arguments [Boolean] :profile If +true+, the query execution is profiled.
|
42
|
-
# @option arguments [String] :routing
|
42
|
+
# @option arguments [String] :routing A custom value used to route operations to a specific shard.
|
43
43
|
# @option arguments [Time] :scroll Specifies how long a consistent view of the index
|
44
44
|
# should be maintained for scrolled search.
|
45
45
|
# @option arguments [String] :search_type The type of the search operation.
|
46
|
-
# @option arguments [Boolean] :rest_total_hits_as_int If true
|
46
|
+
# @option arguments [Boolean] :rest_total_hits_as_int If +true+, +hits.total+ is rendered as an integer in the response.
|
47
|
+
# If +false+, it is rendered as an object.
|
47
48
|
# @option arguments [Boolean] :typed_keys If +true+, the response prefixes aggregation and suggester names with their respective types.
|
48
49
|
# @option arguments [Hash] :headers Custom HTTP headers
|
49
50
|
# @option arguments [Hash] :body request body
|
50
51
|
#
|
51
|
-
# @see https://www.elastic.co/
|
52
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-template
|
52
53
|
#
|
53
54
|
def search_template(arguments = {})
|
54
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
55
|
+
request_opts = { endpoint: arguments[:endpoint] || 'search_template' }
|
55
56
|
|
56
|
-
defined_params = [:index].
|
57
|
+
defined_params = [:index].each_with_object({}) do |variable, set_variables|
|
57
58
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
58
|
-
set_variables
|
59
59
|
end
|
60
60
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
61
61
|
|
@@ -72,7 +72,7 @@ module ElasticsearchServerless
|
|
72
72
|
path = if _index
|
73
73
|
"#{Utils.listify(_index)}/_search/template"
|
74
74
|
else
|
75
|
-
|
75
|
+
'_search/template'
|
76
76
|
end
|
77
77
|
params = Utils.process_params(arguments)
|
78
78
|
|
@@ -30,10 +30,10 @@ module ElasticsearchServerless
|
|
30
30
|
#
|
31
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
32
|
#
|
33
|
-
# @see https://www.elastic.co/
|
33
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-authenticate
|
34
34
|
#
|
35
35
|
def authenticate(arguments = {})
|
36
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
36
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.authenticate' }
|
37
37
|
|
38
38
|
arguments = arguments.clone
|
39
39
|
headers = arguments.delete(:headers) || {}
|
@@ -41,7 +41,7 @@ module ElasticsearchServerless
|
|
41
41
|
body = nil
|
42
42
|
|
43
43
|
method = ElasticsearchServerless::API::HTTP_GET
|
44
|
-
path =
|
44
|
+
path = '_security/_authenticate'
|
45
45
|
params = {}
|
46
46
|
|
47
47
|
ElasticsearchServerless::API::Response.new(
|
@@ -24,18 +24,22 @@ module ElasticsearchServerless
|
|
24
24
|
module Actions
|
25
25
|
# Create an API key.
|
26
26
|
# Create an API key for access without requiring basic authentication.
|
27
|
+
# IMPORTANT: If the credential that is used to authenticate this request is an API key, the derived API key cannot have any privileges.
|
28
|
+
# If you specify privileges, the API returns an error.
|
27
29
|
# A successful request returns a JSON structure that contains the API key, its unique id, and its name.
|
28
30
|
# If applicable, it also returns expiration information for the API key in milliseconds.
|
29
31
|
# NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
|
32
|
+
# The API keys are created by the Elasticsearch API key service, which is automatically enabled.
|
33
|
+
# To configure or turn off the API key service, refer to API key service setting documentation.
|
30
34
|
#
|
31
35
|
# @option arguments [String] :refresh 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.
|
32
36
|
# @option arguments [Hash] :headers Custom HTTP headers
|
33
37
|
# @option arguments [Hash] :body request body
|
34
38
|
#
|
35
|
-
# @see https://www.elastic.co/
|
39
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key
|
36
40
|
#
|
37
41
|
def create_api_key(arguments = {})
|
38
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
42
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.create_api_key' }
|
39
43
|
|
40
44
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
41
45
|
|
@@ -45,7 +49,7 @@ module ElasticsearchServerless
|
|
45
49
|
body = arguments.delete(:body)
|
46
50
|
|
47
51
|
method = ElasticsearchServerless::API::HTTP_PUT
|
48
|
-
path =
|
52
|
+
path = '_security/api_key'
|
49
53
|
params = Utils.process_params(arguments)
|
50
54
|
|
51
55
|
ElasticsearchServerless::API::Response.new(
|
@@ -24,19 +24,20 @@ module ElasticsearchServerless
|
|
24
24
|
module Actions
|
25
25
|
# Delete roles.
|
26
26
|
# Delete roles in the native realm.
|
27
|
+
# The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
28
|
+
# The delete roles API cannot remove roles that are defined in roles files.
|
27
29
|
#
|
28
|
-
# @option arguments [String] :name
|
30
|
+
# @option arguments [String] :name The name of the role. (*Required*)
|
29
31
|
# @option arguments [String] :refresh 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.
|
30
32
|
# @option arguments [Hash] :headers Custom HTTP headers
|
31
33
|
#
|
32
|
-
# @see https://www.elastic.co/
|
34
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role
|
33
35
|
#
|
34
36
|
def delete_role(arguments = {})
|
35
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
37
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.delete_role' }
|
36
38
|
|
37
|
-
defined_params = [:name].
|
39
|
+
defined_params = [:name].each_with_object({}) do |variable, set_variables|
|
38
40
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
39
|
-
set_variables
|
40
41
|
end
|
41
42
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
42
43
|
|
@@ -46,10 +46,10 @@ module ElasticsearchServerless
|
|
46
46
|
# @option arguments [Boolean] :with_profile_uid Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.
|
47
47
|
# @option arguments [Hash] :headers Custom HTTP headers
|
48
48
|
#
|
49
|
-
# @see https://www.elastic.co/
|
49
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-api-key
|
50
50
|
#
|
51
51
|
def get_api_key(arguments = {})
|
52
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
52
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.get_api_key' }
|
53
53
|
|
54
54
|
arguments = arguments.clone
|
55
55
|
headers = arguments.delete(:headers) || {}
|
@@ -57,7 +57,7 @@ module ElasticsearchServerless
|
|
57
57
|
body = nil
|
58
58
|
|
59
59
|
method = ElasticsearchServerless::API::HTTP_GET
|
60
|
-
path =
|
60
|
+
path = '_security/api_key'
|
61
61
|
params = Utils.process_params(arguments)
|
62
62
|
|
63
63
|
ElasticsearchServerless::API::Response.new(
|
@@ -27,10 +27,10 @@ module ElasticsearchServerless
|
|
27
27
|
#
|
28
28
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
29
|
#
|
30
|
-
# @see https://www.elastic.co/
|
30
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-builtin-privileges
|
31
31
|
#
|
32
32
|
def get_builtin_privileges(arguments = {})
|
33
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
33
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.get_builtin_privileges' }
|
34
34
|
|
35
35
|
arguments = arguments.clone
|
36
36
|
headers = arguments.delete(:headers) || {}
|
@@ -38,7 +38,7 @@ module ElasticsearchServerless
|
|
38
38
|
body = nil
|
39
39
|
|
40
40
|
method = ElasticsearchServerless::API::HTTP_GET
|
41
|
-
path =
|
41
|
+
path = '_security/privilege/_builtin'
|
42
42
|
params = {}
|
43
43
|
|
44
44
|
ElasticsearchServerless::API::Response.new(
|
@@ -24,18 +24,21 @@ module ElasticsearchServerless
|
|
24
24
|
module Actions
|
25
25
|
# Get roles.
|
26
26
|
# Get roles in the native realm.
|
27
|
+
# The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
28
|
+
# The get roles API cannot retrieve roles that are defined in roles files.
|
27
29
|
#
|
28
|
-
# @option arguments [String, Array<String>] :name The name of the role.
|
30
|
+
# @option arguments [String, Array<String>] :name The name of the role.
|
31
|
+
# You can specify multiple roles as a comma-separated list.
|
32
|
+
# If you do not specify this parameter, the API returns information about all roles.
|
29
33
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
34
|
#
|
31
|
-
# @see https://www.elastic.co/
|
35
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role
|
32
36
|
#
|
33
37
|
def get_role(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
38
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.get_role' }
|
35
39
|
|
36
|
-
defined_params = [:name].
|
40
|
+
defined_params = [:name].each_with_object({}) do |variable, set_variables|
|
37
41
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
38
|
-
set_variables
|
39
42
|
end
|
40
43
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
41
44
|
|
@@ -50,16 +53,16 @@ module ElasticsearchServerless
|
|
50
53
|
path = if _name
|
51
54
|
"_security/role/#{Utils.listify(_name)}"
|
52
55
|
else
|
53
|
-
|
56
|
+
'_security/role'
|
54
57
|
end
|
55
58
|
params = Utils.process_params(arguments)
|
56
59
|
|
57
60
|
if Array(arguments[:ignore]).include?(404)
|
58
|
-
Utils.rescue_from_not_found
|
61
|
+
Utils.rescue_from_not_found do
|
59
62
|
ElasticsearchServerless::API::Response.new(
|
60
63
|
perform_request(method, path, params, body, headers, request_opts)
|
61
64
|
)
|
62
|
-
|
65
|
+
end
|
63
66
|
else
|
64
67
|
ElasticsearchServerless::API::Response.new(
|
65
68
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -24,19 +24,20 @@ module ElasticsearchServerless
|
|
24
24
|
module Actions
|
25
25
|
# Check user privileges.
|
26
26
|
# Determine whether the specified user has a specified list of privileges.
|
27
|
+
# All users can use this API, but only to determine their own privileges.
|
28
|
+
# To check the privileges of other users, you must use the run as feature.
|
27
29
|
#
|
28
30
|
# @option arguments [String] :user Username
|
29
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
32
|
# @option arguments [Hash] :body request body
|
31
33
|
#
|
32
|
-
# @see https://www.elastic.co/
|
34
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges
|
33
35
|
#
|
34
36
|
def has_privileges(arguments = {})
|
35
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
37
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.has_privileges' }
|
36
38
|
|
37
|
-
defined_params = [:user].
|
39
|
+
defined_params = [:user].each_with_object({}) do |variable, set_variables|
|
38
40
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
39
|
-
set_variables
|
40
41
|
end
|
41
42
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
42
43
|
|
@@ -53,7 +54,7 @@ module ElasticsearchServerless
|
|
53
54
|
path = if _user
|
54
55
|
"_security/user/#{Utils.listify(_user)}/_has_privileges"
|
55
56
|
else
|
56
|
-
|
57
|
+
'_security/user/_has_privileges'
|
57
58
|
end
|
58
59
|
params = {}
|
59
60
|
|
@@ -25,20 +25,22 @@ module ElasticsearchServerless
|
|
25
25
|
# Invalidate API keys.
|
26
26
|
# This API invalidates API keys created by the create API key or grant API key APIs.
|
27
27
|
# Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted.
|
28
|
-
#
|
29
|
-
# The +
|
28
|
+
# To use this API, you must have at least the +manage_security+, +manage_api_key+, or +manage_own_api_key+ cluster privileges.
|
29
|
+
# The +manage_security+ privilege allows deleting any API key, including both REST and cross cluster API keys.
|
30
|
+
# The +manage_api_key+ privilege allows deleting any REST API key, but not cross cluster API keys.
|
31
|
+
# The +manage_own_api_key+ only allows deleting REST API keys that are owned by the user.
|
30
32
|
# In addition, with the +manage_own_api_key+ privilege, an invalidation request must be issued in one of the three formats:
|
31
33
|
# - Set the parameter +owner=true+.
|
32
|
-
# - Or, set both +username+ and +realm_name+ to match the user
|
34
|
+
# - Or, set both +username+ and +realm_name+ to match the user's identity.
|
33
35
|
# - Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the +ids+ field.
|
34
36
|
#
|
35
37
|
# @option arguments [Hash] :headers Custom HTTP headers
|
36
38
|
# @option arguments [Hash] :body request body
|
37
39
|
#
|
38
|
-
# @see https://www.elastic.co/
|
40
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-api-key
|
39
41
|
#
|
40
42
|
def invalidate_api_key(arguments = {})
|
41
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
43
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.invalidate_api_key' }
|
42
44
|
|
43
45
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
44
46
|
|
@@ -48,7 +50,7 @@ module ElasticsearchServerless
|
|
48
50
|
body = arguments.delete(:body)
|
49
51
|
|
50
52
|
method = ElasticsearchServerless::API::HTTP_DELETE
|
51
|
-
path =
|
53
|
+
path = '_security/api_key'
|
52
54
|
params = {}
|
53
55
|
|
54
56
|
ElasticsearchServerless::API::Response.new(
|
@@ -32,14 +32,13 @@ module ElasticsearchServerless
|
|
32
32
|
# @option arguments [Hash] :headers Custom HTTP headers
|
33
33
|
# @option arguments [Hash] :body request body
|
34
34
|
#
|
35
|
-
# @see https://www.elastic.co/
|
35
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role
|
36
36
|
#
|
37
37
|
def put_role(arguments = {})
|
38
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
38
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.put_role' }
|
39
39
|
|
40
|
-
defined_params = [:name].
|
40
|
+
defined_params = [:name].each_with_object({}) do |variable, set_variables|
|
41
41
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
42
|
-
set_variables
|
43
42
|
end
|
44
43
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
45
44
|
|
@@ -23,19 +23,25 @@ module ElasticsearchServerless
|
|
23
23
|
module Security
|
24
24
|
module Actions
|
25
25
|
# Find API keys with a query.
|
26
|
-
# Get a paginated list of API keys and their information.
|
26
|
+
# Get a paginated list of API keys and their information.
|
27
|
+
# You can optionally filter the results with a query.
|
28
|
+
# To use this API, you must have at least the +manage_own_api_key+ or the +read_security+ cluster privileges.
|
29
|
+
# If you have only the +manage_own_api_key+ privilege, this API returns only the API keys that you own.
|
30
|
+
# If you have the +read_security+, +manage_api_key+, or greater privileges (including +manage_security+), this API returns all API keys regardless of ownership.
|
27
31
|
#
|
28
32
|
# @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors associated with the API key.
|
29
|
-
# An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors.
|
30
|
-
#
|
33
|
+
# An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it).
|
34
|
+
# An API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has +manage_api_key+ or higher privileges.
|
35
|
+
# @option arguments [Boolean] :with_profile_uid Determines whether to also retrieve the profile UID for the API key owner principal.
|
36
|
+
# If it exists, the profile UID is returned under the +profile_uid+ response field for each API key.
|
31
37
|
# @option arguments [Boolean] :typed_keys Determines whether aggregation names are prefixed by their respective types in the response.
|
32
38
|
# @option arguments [Hash] :headers Custom HTTP headers
|
33
39
|
# @option arguments [Hash] :body request body
|
34
40
|
#
|
35
|
-
# @see https://www.elastic.co/
|
41
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-api-keys
|
36
42
|
#
|
37
43
|
def query_api_keys(arguments = {})
|
38
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
44
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.query_api_keys' }
|
39
45
|
|
40
46
|
arguments = arguments.clone
|
41
47
|
headers = arguments.delete(:headers) || {}
|
@@ -48,7 +54,7 @@ module ElasticsearchServerless
|
|
48
54
|
ElasticsearchServerless::API::HTTP_GET
|
49
55
|
end
|
50
56
|
|
51
|
-
path =
|
57
|
+
path = '_security/_query/api_key'
|
52
58
|
params = Utils.process_params(arguments)
|
53
59
|
|
54
60
|
ElasticsearchServerless::API::Response.new(
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
#
|
18
|
+
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
|
19
|
+
# @see https://github.com/elastic/elasticsearch-specification
|
20
|
+
#
|
21
|
+
module ElasticsearchServerless
|
22
|
+
module API
|
23
|
+
module Security
|
24
|
+
module Actions
|
25
|
+
# Find roles with a query.
|
26
|
+
# Get roles in a paginated manner.
|
27
|
+
# The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
|
28
|
+
# The query roles API does not retrieve roles that are defined in roles files, nor built-in ones.
|
29
|
+
# You can optionally filter the results with a query.
|
30
|
+
# Also, the results can be paginated and sorted.
|
31
|
+
#
|
32
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
33
|
+
# @option arguments [Hash] :body request body
|
34
|
+
#
|
35
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-role
|
36
|
+
#
|
37
|
+
def query_role(arguments = {})
|
38
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.query_role' }
|
39
|
+
|
40
|
+
arguments = arguments.clone
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
|
+
|
43
|
+
body = arguments.delete(:body)
|
44
|
+
|
45
|
+
method = if body
|
46
|
+
ElasticsearchServerless::API::HTTP_POST
|
47
|
+
else
|
48
|
+
ElasticsearchServerless::API::HTTP_GET
|
49
|
+
end
|
50
|
+
|
51
|
+
path = '_security/_query/role'
|
52
|
+
params = {}
|
53
|
+
|
54
|
+
ElasticsearchServerless::API::Response.new(
|
55
|
+
perform_request(method, path, params, body, headers, request_opts)
|
56
|
+
)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|