elasticsearch-api 9.1.3 → 9.2.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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch/api/actions/async_search/submit.rb +8 -0
  3. data/lib/elasticsearch/api/actions/cat/count.rb +8 -0
  4. data/lib/elasticsearch/api/actions/cat/nodes.rb +1 -1
  5. data/lib/elasticsearch/api/actions/cat/segments.rb +0 -10
  6. data/lib/elasticsearch/api/actions/close_point_in_time.rb +2 -0
  7. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +5 -0
  8. data/lib/elasticsearch/api/actions/cluster/state.rb +1 -1
  9. data/lib/elasticsearch/api/actions/count.rb +10 -2
  10. data/lib/elasticsearch/api/actions/delete_by_query.rb +2 -2
  11. data/lib/elasticsearch/api/actions/eql/search.rb +8 -0
  12. data/lib/elasticsearch/api/actions/explain.rb +2 -2
  13. data/lib/elasticsearch/api/actions/field_caps.rb +8 -0
  14. data/lib/elasticsearch/api/actions/fleet/search.rb +2 -6
  15. data/lib/elasticsearch/api/actions/get.rb +1 -0
  16. data/lib/elasticsearch/api/actions/graph/explore.rb +2 -6
  17. data/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb +1 -0
  18. data/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb +1 -0
  19. data/lib/elasticsearch/api/actions/indices/analyze.rb +3 -6
  20. data/lib/elasticsearch/api/actions/indices/disk_usage.rb +1 -0
  21. data/lib/elasticsearch/api/actions/indices/get_data_stream_mappings.rb +75 -0
  22. data/lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb +1 -0
  23. data/lib/elasticsearch/api/actions/indices/put_data_stream_mappings.rb +84 -0
  24. data/lib/elasticsearch/api/actions/indices/put_data_stream_options.rb +1 -0
  25. data/lib/elasticsearch/api/actions/indices/resolve_index.rb +9 -0
  26. data/lib/elasticsearch/api/actions/indices/rollover.rb +1 -1
  27. data/lib/elasticsearch/api/actions/indices/shrink.rb +1 -0
  28. data/lib/elasticsearch/api/actions/indices/split.rb +1 -0
  29. data/lib/elasticsearch/api/actions/indices/validate_query.rb +1 -1
  30. data/lib/elasticsearch/api/actions/inference/completion.rb +1 -0
  31. data/lib/elasticsearch/api/actions/inference/inference.rb +1 -0
  32. data/lib/elasticsearch/api/actions/inference/put.rb +2 -1
  33. data/lib/elasticsearch/api/actions/inference/put_ai21.rb +79 -0
  34. data/lib/elasticsearch/api/actions/inference/put_alibabacloud.rb +1 -0
  35. data/lib/elasticsearch/api/actions/inference/put_amazonbedrock.rb +1 -0
  36. data/lib/elasticsearch/api/actions/inference/put_amazonsagemaker.rb +1 -0
  37. data/lib/elasticsearch/api/actions/inference/put_anthropic.rb +1 -0
  38. data/lib/elasticsearch/api/actions/inference/put_azureaistudio.rb +1 -0
  39. data/lib/elasticsearch/api/actions/inference/put_azureopenai.rb +1 -0
  40. data/lib/elasticsearch/api/actions/inference/put_cohere.rb +1 -0
  41. data/lib/elasticsearch/api/actions/inference/put_contextualai.rb +84 -0
  42. data/lib/elasticsearch/api/actions/inference/put_custom.rb +1 -0
  43. data/lib/elasticsearch/api/actions/inference/put_deepseek.rb +1 -0
  44. data/lib/elasticsearch/api/actions/inference/put_elasticsearch.rb +1 -0
  45. data/lib/elasticsearch/api/actions/inference/put_elser.rb +1 -0
  46. data/lib/elasticsearch/api/actions/inference/put_googleaistudio.rb +1 -0
  47. data/lib/elasticsearch/api/actions/inference/put_googlevertexai.rb +1 -0
  48. data/lib/elasticsearch/api/actions/inference/put_hugging_face.rb +1 -0
  49. data/lib/elasticsearch/api/actions/inference/put_jinaai.rb +1 -0
  50. data/lib/elasticsearch/api/actions/inference/put_llama.rb +79 -0
  51. data/lib/elasticsearch/api/actions/inference/put_mistral.rb +1 -0
  52. data/lib/elasticsearch/api/actions/inference/put_openai.rb +1 -0
  53. data/lib/elasticsearch/api/actions/inference/put_voyageai.rb +1 -0
  54. data/lib/elasticsearch/api/actions/inference/put_watsonx.rb +1 -0
  55. data/lib/elasticsearch/api/actions/inference/rerank.rb +1 -0
  56. data/lib/elasticsearch/api/actions/inference/sparse_embedding.rb +1 -0
  57. data/lib/elasticsearch/api/actions/inference/stream_completion.rb +1 -0
  58. data/lib/elasticsearch/api/actions/inference/text_embedding.rb +1 -0
  59. data/lib/elasticsearch/api/actions/license/get.rb +3 -1
  60. data/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb +1 -1
  61. data/lib/elasticsearch/api/actions/msearch.rb +7 -0
  62. data/lib/elasticsearch/api/actions/msearch_template.rb +8 -0
  63. data/lib/elasticsearch/api/actions/open_point_in_time.rb +8 -0
  64. data/lib/elasticsearch/api/actions/project/tags.rb +65 -0
  65. data/lib/elasticsearch/api/actions/render_search_template.rb +3 -6
  66. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +3 -6
  67. data/lib/elasticsearch/api/actions/search.rb +11 -2
  68. data/lib/elasticsearch/api/actions/search_mvt.rb +8 -0
  69. data/lib/elasticsearch/api/actions/search_template.rb +8 -0
  70. data/lib/elasticsearch/api/actions/security/get_stats.rb +62 -0
  71. data/lib/elasticsearch/api/actions/simulate/ingest.rb +4 -0
  72. data/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb +17 -10
  73. data/lib/elasticsearch/api/actions/snapshot/status.rb +5 -0
  74. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb +1 -0
  75. data/lib/elasticsearch/api/actions/sql/query.rb +8 -0
  76. data/lib/elasticsearch/api/actions/streams/status.rb +1 -1
  77. data/lib/elasticsearch/api/actions/terms_enum.rb +2 -6
  78. data/lib/elasticsearch/api/actions/update_by_query.rb +2 -2
  79. data/lib/elasticsearch/api/version.rb +2 -2
  80. data/lib/elasticsearch/api.rb +1 -0
  81. metadata +8 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ade91dad7c15a6bd63fb93ff6bd2bf1e6e62373a3fda825c4664e89723e87aba
4
- data.tar.gz: 17ecdd291c9a9466b7fab5419f4a718e62d8f9b3406138e010a9d3c38809443a
3
+ metadata.gz: 6e2038b3f672cc606ab10912496c8ca767b970532ab39f0200631f248ffb5ded
4
+ data.tar.gz: 29f3e2870f65ad58c5f1a5bd2bd5d17c85ddc6da65fc9843bc2d8f27a1225378
5
5
  SHA512:
6
- metadata.gz: 7973b8089a9ca26a6cebdeaed6a8dee903ae4e5b42ac84a2760818a6a3bf6680162b038938e04c1a009f7db8a29649412b1667289f79f72aacc1269a1a32bb33
7
- data.tar.gz: b600a0a45746012a25b2eab5c17158e9c755f24924de22896cb5000e9cff84d0fc222af285aaac4b84e72740f37bf1071449d50aa2bef3b8de75adb32bada8f6
6
+ metadata.gz: a9679ac647fc9165740fc38d71decdc4b11a61c2b17f5aabe3bee3ccd008f4f55ed72534f3784018dea55b22cbf2cddb084c0d34c6e3601a0fff5228a3f40ccd
7
+ data.tar.gz: 741518f968028106d28fe6bcb2cc320dbc6e2b147b244520eed4d737adf69fe8f3ae4bea34d5746bf65a38d813e7451c630c5a028b6ec90ae5a3fc1992850a85
@@ -51,6 +51,14 @@ module Elasticsearch
51
51
  # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
52
52
  # @option arguments [Integer] :max_concurrent_shard_requests 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 Server default: 5.
53
53
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
54
+ # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
55
+ # metadata tags in a subset of Lucene query syntax.
56
+ # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
57
+ # Examples:
58
+ # _alias:my-project
59
+ # _alias:_origin
60
+ # _alias:*pr*
61
+ # Supported in serverless only.
54
62
  # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to true Server default: true.
55
63
  # @option arguments [String] :routing A comma-separated list of specific routing values
56
64
  # @option arguments [String] :search_type Search operation type
@@ -32,6 +32,14 @@ module Elasticsearch
32
32
  # It supports wildcards (`*`).
33
33
  # To target all data streams and indices, omit this parameter or use `*` or `_all`.
34
34
  # @option arguments [String, Array<String>] :h A comma-separated list of columns names to display. It supports simple wildcards.
35
+ # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
36
+ # metadata tags in a subset of Lucene query syntax.
37
+ # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
38
+ # Examples:
39
+ # _alias:my-project
40
+ # _alias:_origin
41
+ # _alias:*pr*
42
+ # Supported in serverless only.
35
43
  # @option arguments [String, Array<String>] :s List of columns that determine how the table should be sorted.
36
44
  # Sorting defaults to ascending and can be changed by setting `:asc`
37
45
  # or `:desc` as a suffix to the column name.
@@ -26,7 +26,7 @@ module Elasticsearch
26
26
  # Get information about the nodes in a cluster.
27
27
  # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
28
28
  #
29
- # @option arguments [Boolean, String] :full_id If `true`, return the full node ID. If `false`, return the shortened node ID. Server default: false.
29
+ # @option arguments [Boolean] :full_id If `true`, return the full node ID. If `false`, return the shortened node ID.
30
30
  # @option arguments [Boolean] :include_unloaded_segments If true, the response includes information from segments that are not loaded into memory.
31
31
  # @option arguments [String, Array<String>] :h A comma-separated list of columns names to display.
32
32
  # It supports simple wildcards. Server default: ip,hp,rp,r,m,n,cpu,l.
@@ -40,16 +40,6 @@ module Elasticsearch
40
40
  # from the cluster state of the master node. In both cases the coordinating
41
41
  # node will send requests for further information to each selected node.
42
42
  # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
43
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard expressions can match. If the request can target data streams, this argument
44
- # determines whether wildcard expressions match hidden data streams. Supports comma-separated values,
45
- # such as open,hidden. Server default: open.
46
- # @option arguments [Boolean] :allow_no_indices If false, the request returns an error if any wildcard expression, index alias, or _all value targets only
47
- # missing or closed indices. This behavior applies even if the request targets other open indices. For example,
48
- # a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. Server default: true.
49
- # @option arguments [Boolean] :ignore_throttled If true, concrete, expanded or aliased indices are ignored when frozen.
50
- # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response.
51
- # @option arguments [Boolean] :allow_closed If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour
52
- # of throwing an exception if index pattern matches closed indices
53
43
  # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to
54
44
  # `text`, `json`, `cbor`, `yaml`, or `smile`. Server default: text.
55
45
  # @option arguments [Boolean] :help When set to `true` will output available columns. This option
@@ -46,6 +46,8 @@ module Elasticsearch
46
46
  def close_point_in_time(arguments = {})
47
47
  request_opts = { endpoint: arguments[:endpoint] || 'close_point_in_time' }
48
48
 
49
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
50
+
49
51
  arguments = arguments.clone
50
52
  headers = arguments.delete(:headers) || {}
51
53
 
@@ -24,11 +24,16 @@ module Elasticsearch
24
24
  module Actions
25
25
  # Explain the shard allocations.
26
26
  # Get explanations for shard allocations in the cluster.
27
+ # This API accepts the current_node, index, primary and shard parameters in the request body or in query parameters, but not in both at the same time.
27
28
  # For unassigned shards, it provides an explanation for why the shard is unassigned.
28
29
  # For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.
29
30
  # This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
30
31
  # Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.
31
32
  #
33
+ # @option arguments [String] :index The name of the index that you would like an explanation for.
34
+ # @option arguments [Integer] :shard An identifier for the shard that you would like an explanation for.
35
+ # @option arguments [Boolean] :primary If true, returns an explanation for the primary shard for the specified shard ID.
36
+ # @option arguments [String] :current_node Explain a shard only if it is currently located on the specified node name or node ID.
32
37
  # @option arguments [Boolean] :include_disk_info If true, returns information about disk usage and shard sizes.
33
38
  # @option arguments [Boolean] :include_yes_decisions If true, returns YES decisions in explanation.
34
39
  # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
@@ -44,7 +44,7 @@ module Elasticsearch
44
44
  # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
45
45
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
46
46
  # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
47
- # @option arguments [Time] :master_timeout Specify timeout for connection to master Server default: 30s.
47
+ # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked Server default: 30s.
48
48
  # @option arguments [Integer] :wait_for_metadata_version Wait for the metadata version to be equal or greater than the specified metadata version
49
49
  # @option arguments [Time] :wait_for_timeout The maximum time to wait for wait_for_metadata_version before timing out
50
50
  # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
@@ -40,8 +40,8 @@ module Elasticsearch
40
40
  # This parameter can be used only when the `q` query string parameter is specified.
41
41
  # @option arguments [Boolean] :analyze_wildcard If `true`, wildcard and prefix queries are analyzed.
42
42
  # This parameter can be used only when the `q` query string parameter is specified.
43
- # @option arguments [String] :default_operator The default operator for query string query: `AND` or `OR`.
44
- # This parameter can be used only when the `q` query string parameter is specified. Server default: OR.
43
+ # @option arguments [String] :default_operator The default operator for query string query: `and` or `or`.
44
+ # This parameter can be used only when the `q` query string parameter is specified. Server default: or.
45
45
  # @option arguments [String] :df The field to use as a default when no field prefix is given in the query string.
46
46
  # This parameter can be used only when the `q` query string parameter is specified.
47
47
  # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
@@ -54,6 +54,14 @@ module Elasticsearch
54
54
  # @option arguments [Float] :min_score The minimum `_score` value that documents must have to be included in the result.
55
55
  # @option arguments [String] :preference The node or shard the operation should be performed on.
56
56
  # By default, it is random.
57
+ # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
58
+ # metadata tags in a subset of Lucene query syntax.
59
+ # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
60
+ # Examples:
61
+ # _alias:my-project
62
+ # _alias:_origin
63
+ # _alias:*pr*
64
+ # Supported in serverless only.
57
65
  # @option arguments [String] :routing A custom value used to route operations to a specific shard.
58
66
  # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
59
67
  # If a query reaches this limit, Elasticsearch terminates the query early.
@@ -93,8 +93,8 @@ module Elasticsearch
93
93
  # @option arguments [Boolean] :analyze_wildcard If `true`, wildcard and prefix queries are analyzed.
94
94
  # This parameter can be used only when the `q` query string parameter is specified.
95
95
  # @option arguments [String] :conflicts What to do if delete by query hits version conflicts: `abort` or `proceed`. Server default: abort.
96
- # @option arguments [String] :default_operator The default operator for query string query: `AND` or `OR`.
97
- # This parameter can be used only when the `q` query string parameter is specified. Server default: OR.
96
+ # @option arguments [String] :default_operator The default operator for query string query: `and` or `or`.
97
+ # This parameter can be used only when the `q` query string parameter is specified. Server default: or.
98
98
  # @option arguments [String] :df The field to use as default where no field prefix is given in the query string.
99
99
  # This parameter can be used only when the `q` query string parameter is specified.
100
100
  # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
@@ -36,6 +36,14 @@ module Elasticsearch
36
36
  # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. Server default: true.
37
37
  # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. Server default: 5d.
38
38
  # @option arguments [Boolean] :keep_on_completion If true, the search and its results are stored on the cluster.
39
+ # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
40
+ # metadata tags in a subset of Lucene query syntax.
41
+ # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
42
+ # Examples:
43
+ # _alias:my-project
44
+ # _alias:_origin
45
+ # _alias:*pr*
46
+ # Supported in serverless only.
39
47
  # @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.
40
48
  # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
41
49
  # when they occur.
@@ -32,8 +32,8 @@ module Elasticsearch
32
32
  # This parameter can be used only when the `q` query string parameter is specified.
33
33
  # @option arguments [Boolean] :analyze_wildcard If `true`, wildcard and prefix queries are analyzed.
34
34
  # This parameter can be used only when the `q` query string parameter is specified.
35
- # @option arguments [String] :default_operator The default operator for query string query: `AND` or `OR`.
36
- # This parameter can be used only when the `q` query string parameter is specified. Server default: OR.
35
+ # @option arguments [String] :default_operator The default operator for query string query: `and` or `or`.
36
+ # This parameter can be used only when the `q` query string parameter is specified. Server default: or.
37
37
  # @option arguments [String] :df The field to use as default where no field prefix is given in the query string.
38
38
  # This parameter can be used only when the `q` query string parameter is specified.
39
39
  # @option arguments [Boolean] :lenient If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
@@ -40,6 +40,14 @@ module Elasticsearch
40
40
  # Any fields that do not match one of these types will be excluded from the results.
41
41
  # It defaults to empty, meaning that all field types are returned.
42
42
  # @option arguments [Boolean] :include_empty_fields If false, empty fields are not included in the response. Server default: true.
43
+ # @option arguments [String] :project_routing Specifies a subset of projects to target for the field-caps query using project
44
+ # metadata tags in a subset of Lucene query syntax.
45
+ # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
46
+ # Examples:
47
+ # _alias:my-project
48
+ # _alias:_origin
49
+ # _alias:*pr*
50
+ # Supported in serverless only.
43
51
  # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
44
52
  # when they occur.
45
53
  # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
@@ -102,6 +102,7 @@ module Elasticsearch
102
102
  end
103
103
  request_opts[:defined_params] = defined_params unless defined_params.empty?
104
104
 
105
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
105
106
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
106
107
 
107
108
  arguments = arguments.clone
@@ -111,12 +112,7 @@ module Elasticsearch
111
112
 
112
113
  _index = arguments.delete(:index)
113
114
 
114
- method = if body
115
- Elasticsearch::API::HTTP_POST
116
- else
117
- Elasticsearch::API::HTTP_GET
118
- end
119
-
115
+ method = Elasticsearch::API::HTTP_POST
120
116
  path = "#{Utils.listify(_index)}/_fleet/_fleet_search"
121
117
  params = Utils.process_params(arguments)
122
118
 
@@ -88,6 +88,7 @@ module Elasticsearch
88
88
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
89
89
  # You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
90
90
  # If the `_source` parameter is `false`, this parameter is ignored.
91
+ # @option arguments [Boolean] :_source_exclude_vectors Whether vectors should be excluded from _source
91
92
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
92
93
  # If this parameter is specified, only these source fields are returned.
93
94
  # You can exclude fields from this subset using the `_source_excludes` query parameter.
@@ -58,6 +58,7 @@ module Elasticsearch
58
58
  end
59
59
  request_opts[:defined_params] = defined_params unless defined_params.empty?
60
60
 
61
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
61
62
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
62
63
 
63
64
  arguments = arguments.clone
@@ -67,12 +68,7 @@ module Elasticsearch
67
68
 
68
69
  _index = arguments.delete(:index)
69
70
 
70
- method = if body
71
- Elasticsearch::API::HTTP_POST
72
- else
73
- Elasticsearch::API::HTTP_GET
74
- end
75
-
71
+ method = Elasticsearch::API::HTTP_POST
76
72
  path = "#{Utils.listify(_index)}/_graph/explore"
77
73
  params = Utils.process_params(arguments)
78
74
 
@@ -59,6 +59,7 @@ module Elasticsearch
59
59
  end
60
60
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
61
 
62
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
62
63
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
63
64
 
64
65
  arguments = arguments.clone
@@ -53,6 +53,7 @@ module Elasticsearch
53
53
  end
54
54
  request_opts[:defined_params] = defined_params unless defined_params.empty?
55
55
 
56
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
56
57
  raise ArgumentError, "Required argument 'policy' missing" unless arguments[:policy]
57
58
 
58
59
  arguments = arguments.clone
@@ -56,6 +56,8 @@ module Elasticsearch
56
56
  end
57
57
  request_opts[:defined_params] = defined_params unless defined_params.empty?
58
58
 
59
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
60
+
59
61
  arguments = arguments.clone
60
62
  headers = arguments.delete(:headers) || {}
61
63
 
@@ -63,12 +65,7 @@ module Elasticsearch
63
65
 
64
66
  _index = arguments.delete(:index)
65
67
 
66
- method = if body
67
- Elasticsearch::API::HTTP_POST
68
- else
69
- Elasticsearch::API::HTTP_GET
70
- end
71
-
68
+ method = Elasticsearch::API::HTTP_POST
72
69
  path = if _index
73
70
  "#{Utils.listify(_index)}/_analyze"
74
71
  else
@@ -29,6 +29,7 @@ module Elasticsearch
29
29
  # NOTE: The total size of fields of the analyzed shards of the index in the response is usually smaller than the index `store_size` value because some small metadata files are ignored and some parts of data files might not be scanned by the API.
30
30
  # Since stored fields are stored together in a compressed format, the sizes of stored fields are also estimates and can be inaccurate.
31
31
  # The stored size of the `_id` field is likely underestimated while the `_source` field is overestimated.
32
+ # For usage examples see the External documentation or refer to {https://www.elastic.co/docs/reference/elasticsearch/rest-apis/index-disk-usage Analyze the index disk usage example} for an example.
32
33
  # This functionality is Experimental and may be changed or removed
33
34
  # completely in a future release. Elastic will take a best effort approach
34
35
  # to fix any issues, but experimental features are not subject to the
@@ -0,0 +1,75 @@
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
+ # This code was automatically generated from the Elasticsearch Specification
19
+ # See https://github.com/elastic/elasticsearch-specification
20
+ # See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21
+ module Elasticsearch
22
+ module API
23
+ module Indices
24
+ module Actions
25
+ # Get data stream mappings.
26
+ # Get mapping information for one or more data streams.
27
+ #
28
+ # @option arguments [String, Array] :name A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`). (*Required*)
29
+ # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. If no response is
30
+ # received before the timeout expires, the request fails and returns an
31
+ # error. Server default: 30s.
32
+ # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
33
+ # when they occur.
34
+ # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
35
+ # returned by Elasticsearch.
36
+ # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
37
+ # For example `"exists_time": "1h"` for humans and
38
+ # `"exists_time_in_millis": 3600000` for computers. When disabled the human
39
+ # readable values will be omitted. This makes sense for responses being consumed
40
+ # only by machines.
41
+ # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
42
+ # this option for debugging only.
43
+ # @option arguments [Hash] :headers Custom HTTP headers
44
+ #
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings
46
+ #
47
+ def get_data_stream_mappings(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream_mappings' }
49
+
50
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
51
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
+ end
53
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
54
+
55
+ raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
56
+
57
+ arguments = arguments.clone
58
+ headers = arguments.delete(:headers) || {}
59
+
60
+ body = nil
61
+
62
+ _name = arguments.delete(:name)
63
+
64
+ method = Elasticsearch::API::HTTP_GET
65
+ path = "_data_stream/#{Utils.listify(_name)}/_mappings"
66
+ params = Utils.process_params(arguments)
67
+
68
+ Elasticsearch::API::Response.new(
69
+ perform_request(method, path, params, body, headers, request_opts)
70
+ )
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -59,6 +59,7 @@ module Elasticsearch
59
59
  end
60
60
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
61
 
62
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
62
63
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
63
64
 
64
65
  arguments = arguments.clone
@@ -0,0 +1,84 @@
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
+ # This code was automatically generated from the Elasticsearch Specification
19
+ # See https://github.com/elastic/elasticsearch-specification
20
+ # See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21
+ module Elasticsearch
22
+ module API
23
+ module Indices
24
+ module Actions
25
+ # Update data stream mappings.
26
+ # This API can be used to override mappings on specific data streams. These overrides will take precedence over what
27
+ # is specified in the template that the data stream matches. The mapping change is only applied to new write indices
28
+ # that are created during rollover after this API is called. No indices are changed by this API.
29
+ #
30
+ # @option arguments [String, Array] :name A comma-separated list of data streams or data stream patterns. (*Required*)
31
+ # @option arguments [Boolean] :dry_run If `true`, the request does not actually change the mappings on any data streams. Instead, it
32
+ # simulates changing the settings and reports back to the user what would have happened had these settings
33
+ # actually been applied.
34
+ # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. If no response is
35
+ # received before the timeout expires, the request fails and returns an
36
+ # error. Server default: 30s.
37
+ # @option arguments [Time] :timeout The period to wait for a response. If no response is received before the
38
+ # timeout expires, the request fails and returns an error. Server default: 30s.
39
+ # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
40
+ # when they occur.
41
+ # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
42
+ # returned by Elasticsearch.
43
+ # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
44
+ # For example `"exists_time": "1h"` for humans and
45
+ # `"exists_time_in_millis": 3600000` for computers. When disabled the human
46
+ # readable values will be omitted. This makes sense for responses being consumed
47
+ # only by machines.
48
+ # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
49
+ # this option for debugging only.
50
+ # @option arguments [Hash] :headers Custom HTTP headers
51
+ # @option arguments [Hash] :body mappings
52
+ #
53
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings
54
+ #
55
+ def put_data_stream_mappings(arguments = {})
56
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_stream_mappings' }
57
+
58
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
59
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
60
+ end
61
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
62
+
63
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
64
+ raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
65
+
66
+ arguments = arguments.clone
67
+ headers = arguments.delete(:headers) || {}
68
+
69
+ body = arguments.delete(:body)
70
+
71
+ _name = arguments.delete(:name)
72
+
73
+ method = Elasticsearch::API::HTTP_PUT
74
+ path = "_data_stream/#{Utils.listify(_name)}/_mappings"
75
+ params = Utils.process_params(arguments)
76
+
77
+ Elasticsearch::API::Response.new(
78
+ perform_request(method, path, params, body, headers, request_opts)
79
+ )
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -59,6 +59,7 @@ module Elasticsearch
59
59
  end
60
60
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
61
 
62
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
62
63
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
63
64
 
64
65
  arguments = arguments.clone
@@ -35,6 +35,15 @@ module Elasticsearch
35
35
  # @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.
36
36
  # This behavior applies even if the request targets other open indices.
37
37
  # 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.
38
+ # @option arguments [String, Array<String>] :mode Filter indices by index mode - standard, lookup, time_series, etc. Comma-separated list of IndexMode. Empty means no filter.
39
+ # @option arguments [String] :project_routing Specifies a subset of projects to target using project
40
+ # metadata tags in a subset of Lucene query syntax.
41
+ # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
42
+ # Examples:
43
+ # _alias:my-project
44
+ # _alias:_origin
45
+ # _alias:*pr*
46
+ # Supported in serverless only.
38
47
  # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
39
48
  # when they occur.
40
49
  # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
@@ -23,7 +23,7 @@ module Elasticsearch
23
23
  module Indices
24
24
  module Actions
25
25
  # Roll over to a new index.
26
- # TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.
26
+ # TIP: We recommend using the index lifecycle rollover action to automate rollovers. However, Serverless does not support Index Lifecycle Management (ILM), so don't use this approach in the Serverless context.
27
27
  # The rollover API creates a new index for a data stream or index alias.
28
28
  # The API behavior depends on the rollover target.
29
29
  # **Roll over a data stream**
@@ -78,6 +78,7 @@ module Elasticsearch
78
78
  end
79
79
  request_opts[:defined_params] = defined_params unless defined_params.empty?
80
80
 
81
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
81
82
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
82
83
  raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]
83
84
 
@@ -81,6 +81,7 @@ module Elasticsearch
81
81
  end
82
82
  request_opts[:defined_params] = defined_params unless defined_params.empty?
83
83
 
84
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
84
85
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
85
86
  raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]
86
87
 
@@ -34,7 +34,7 @@ module Elasticsearch
34
34
  # @option arguments [String] :analyzer Analyzer to use for the query string.
35
35
  # This parameter can only be used when the `q` query string parameter is specified.
36
36
  # @option arguments [Boolean] :analyze_wildcard If `true`, wildcard and prefix queries are analyzed.
37
- # @option arguments [String] :default_operator The default operator for query string query: `AND` or `OR`. Server default: OR.
37
+ # @option arguments [String] :default_operator The default operator for query string query: `and` or `or`. Server default: or.
38
38
  # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
39
39
  # This parameter can only be used when the `q` query string parameter is specified.
40
40
  # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
@@ -50,6 +50,7 @@ module Elasticsearch
50
50
  end
51
51
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
52
 
53
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
53
54
  raise ArgumentError, "Required argument 'inference_id' missing" unless arguments[:inference_id]
54
55
 
55
56
  arguments = arguments.clone
@@ -55,6 +55,7 @@ module Elasticsearch
55
55
  end
56
56
  request_opts[:defined_params] = defined_params unless defined_params.empty?
57
57
 
58
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
58
59
  raise ArgumentError, "Required argument 'inference_id' missing" unless arguments[:inference_id]
59
60
 
60
61
  arguments = arguments.clone
@@ -27,11 +27,12 @@ module Elasticsearch
27
27
  # For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models.
28
28
  # However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
29
29
  # The following integrations are available through the inference API. You can find the available task types next to the integration name:
30
+ # * AI21 (`chat_completion`, `completion`)
30
31
  # * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`)
31
32
  # * Amazon Bedrock (`completion`, `text_embedding`)
32
33
  # * Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`)
33
34
  # * Anthropic (`completion`)
34
- # * Azure AI Studio (`completion`, `text_embedding`)
35
+ # * Azure AI Studio (`completion`, 'rerank', `text_embedding`)
35
36
  # * Azure OpenAI (`completion`, `text_embedding`)
36
37
  # * Cohere (`completion`, `rerank`, `text_embedding`)
37
38
  # * DeepSeek (`chat_completion`, `completion`)