opensearch-ruby 4.0.0.pre.beta.3 → 4.0.0.pre.beta.5

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 (44) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -3
  3. data/README.md +1 -3
  4. data/lib/opensearch/api/actions/cluster/delete_component_template.rb +2 -2
  5. data/lib/opensearch/api/actions/cluster/exists_component_template.rb +1 -1
  6. data/lib/opensearch/api/actions/cluster/get_component_template.rb +1 -1
  7. data/lib/opensearch/api/actions/cluster/get_settings.rb +2 -2
  8. data/lib/opensearch/api/actions/cluster/health.rb +1 -1
  9. data/lib/opensearch/api/actions/cluster/pending_tasks.rb +1 -1
  10. data/lib/opensearch/api/actions/cluster/put_component_template.rb +2 -2
  11. data/lib/opensearch/api/actions/cluster/put_settings.rb +2 -2
  12. data/lib/opensearch/api/actions/cluster/reroute.rb +2 -2
  13. data/lib/opensearch/api/actions/cluster/state.rb +1 -1
  14. data/lib/opensearch/api/actions/replication/autofollow_stats.rb +1 -1
  15. data/lib/opensearch/api/actions/replication/create_replication_rule.rb +1 -1
  16. data/lib/opensearch/api/actions/replication/follower_stats.rb +1 -1
  17. data/lib/opensearch/api/actions/replication/leader_stats.rb +1 -1
  18. data/lib/opensearch/api/actions/replication/pause.rb +2 -2
  19. data/lib/opensearch/api/actions/replication/resume.rb +1 -1
  20. data/lib/opensearch/api/actions/replication/start.rb +2 -2
  21. data/lib/opensearch/api/actions/replication/status.rb +2 -2
  22. data/lib/opensearch/api/actions/replication/stop.rb +2 -2
  23. data/lib/opensearch/api/actions/replication/update_settings.rb +2 -2
  24. data/lib/opensearch/api/actions/sm/create_policy.rb +1 -1
  25. data/lib/opensearch/api/actions/sm/delete_policy.rb +1 -1
  26. data/lib/opensearch/api/actions/sm/explain_policy.rb +1 -1
  27. data/lib/opensearch/api/actions/sm/get_policies.rb +4 -4
  28. data/lib/opensearch/api/actions/sm/get_policy.rb +1 -1
  29. data/lib/opensearch/api/actions/sm/start_policy.rb +1 -1
  30. data/lib/opensearch/api/actions/sm/stop_policy.rb +1 -1
  31. data/lib/opensearch/api/actions/sm/update_policy.rb +1 -1
  32. data/lib/opensearch/api.rb +1 -1
  33. data/lib/opensearch/transport/client.rb +1 -7
  34. data/lib/opensearch/transport/transport/base.rb +1 -1
  35. data/lib/opensearch/transport/transport/serializer/{multi_json.rb → json.rb} +8 -4
  36. data/lib/opensearch/transport.rb +2 -2
  37. data/lib/opensearch/version.rb +1 -1
  38. data/opensearch-ruby.gemspec +1 -2
  39. data/spec/spec_helper.rb +1 -1
  40. data/test/transport/integration/transport_test.rb +1 -1
  41. data/test/transport/unit/serializer_test.rb +5 -5
  42. data.tar.gz.sig +0 -0
  43. metadata +7 -27
  44. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52165e3bcc6883923f6bbfc57aeaf73b0cd9d054983804de6432baece83483ee
4
- data.tar.gz: 0eb577153a23b0d91f091e901e8a209b6a880da271a5e426a27586bdccaa2710
3
+ metadata.gz: 3872c0c4466fe1c37a1732bf74624264530deb5da6e9a5abeb5343ca8b940ffb
4
+ data.tar.gz: 9c92adf323965443993e90da36d64b3200b717303c7dac47a0e20179e025af9d
5
5
  SHA512:
6
- metadata.gz: 900fd3c53f3b222fece0968e1094a87f5ce2cd6a7174d8a54470d74a19af5db6982351459d5efdedd03545ac824123daefb2373ae109a263fca50bbd755ba357
7
- data.tar.gz: c72d67452b64da318baf2d9f71b2aff32ebb7c0e6f1eb493b5c91ddd7ab3b54590108b56dcc2ce5a705868cbf2c7772742029d55a85629de7a42cea129ce52e2
6
+ metadata.gz: f998b61dc76a8f5ff77be3dd75f5a52088cebc3f81a0ce7f011f90485d37a7a48b7701bf745b1d8487070b870131639cc5ac5ca3faa1e702efbd0532edc60f8f
7
+ data.tar.gz: cdbd89cb59925c945b065e3bf20dca9ca37fb51488b12f89b507b1ab2268e4f604d052a0f9d7c2a180b4d3ad55046741c1f4259dc2fdb3fffcf450467027300e
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- ��a�*cmF [$�lnG���j��m:�&��+wZI���L�Ҫwi1��¹���" B^+�c��z�ޗ�U?�G�[��jI>_ U�~��x��� ��
2
- �T���P���&�C Cm���z��8�A�� ����_'4�8���_�����C��y�����?��g��x,N
3
- ^�£�տ����P%���!9,�4�|��M�Rw(o�� w�,�uhą��J�q9��R����D�mp8=�;�
1
+ Sy�¨?:/�7�P*'2c��К���f���M���?��qe�i_lb����33������rDy�� bD��t6R�cU�z�2B=��յ%��E��U��ID��$ң�ߏ��w0 �y��m0���V�S�w�2+f�D��4H�b$a��{W"�x�U���3B�������S�ָ���&��������K�W�DZ
2
+ A
data/README.md CHANGED
@@ -59,14 +59,12 @@ If you don't use Bundler, you may need to require the library explicitly (like `
59
59
 
60
60
  Currently these libraries will be automatically detected and used:
61
61
  - [Patron](https://github.com/toland/patron) through [faraday-patron](https://github.com/lostisland/faraday-patron)
62
- - [Typhoeus](https://github.com/typhoeus/typhoeus) through [faraday-typhoeus](https://github.com/dleavitt/faraday-typhoeus) for Faraday 2 or higher, or Faraday's built-in adapter for Faraday 1.
62
+ - [Typhoeus](https://github.com/typhoeus/typhoeus) through [faraday-typhoeus](https://github.com/dleavitt/faraday-typhoeus)
63
63
  - [HTTPClient](https://rubygems.org/gems/httpclient) through [faraday-httpclient](https://github.com/lostisland/faraday-httpclient)
64
64
  - [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent) through [faraday-net_http_persistent](https://github.com/lostisland/faraday-net_http_persistent)
65
65
 
66
66
  **Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: You need to use v1.4.0 or up since older versions are not compatible with Faraday 1.0 or higher.
67
67
 
68
- **Note on [Faraday](https://rubygems.org/gems/faraday)**: If you use Faraday 2.0 or higher, if the adapter is in a separate gem, you will likely need to declare that gem as well. Only the Net::HTTP adapter gem is included by default. Faraday 1.x includes most common adapter gems already.
69
-
70
68
  ## DSL Features
71
69
 
72
70
  The `opensearch-dsl` library provides a Ruby API for the `OpenSearch Query DSL`.
@@ -17,8 +17,8 @@ module OpenSearch
17
17
  #
18
18
  # @option args [String] :name *Required* The name of the component template to delete. Supports wildcard (*) expressions.
19
19
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
20
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
- # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
20
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
21
+ # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
22
  def delete_component_template(args = {})
23
23
  args = Utils.clone_and_normalize_arguments(args)
24
24
  raise ArgumentError, "Required argument 'name' missing" if args['name'].nil?
@@ -18,7 +18,7 @@ module OpenSearch
18
18
  # @option args [String] :name *Required* The name of the component template. Wildcard (*) expressions are supported.
19
19
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
20
20
  # @option args [Boolean] :local When `true`, the request retrieves information from the local node only. When `false, information is retrieved from the cluster manager node.
21
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
22
  def exists_component_template(args = {})
23
23
  args = Utils.clone_and_normalize_arguments(args)
24
24
  raise ArgumentError, "Required argument 'name' missing" if args['name'].nil?
@@ -18,7 +18,7 @@ module OpenSearch
18
18
  # @option args [String] :cluster_manager_timeout (default: 30s) The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
19
19
  # @option args [Boolean] :flat_settings Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of `"cluster": { "max_shards_per_node": 500 }` is `"cluster.max_shards_per_node": "500"`.
20
20
  # @option args [Boolean] :local When `true`, the request retrieves information from the local node only. When `false`, information is retrieved from the cluster manager node.
21
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
22
  # @option args [String] :name The name of the component template to retrieve. Wildcard (`*`) expressions are supported.
23
23
  def get_component_template(args = {})
24
24
  args = Utils.clone_and_normalize_arguments(args)
@@ -18,8 +18,8 @@ module OpenSearch
18
18
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
19
19
  # @option args [Boolean] :flat_settings Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of `"cluster": { "max_shards_per_node": 500 }` is `"cluster.max_shards_per_node": "500"`.
20
20
  # @option args [Boolean] :include_defaults When `true`, returns default cluster settings from the local node.
21
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
22
- # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
+ # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
23
23
  def get_settings(args = {})
24
24
  args = Utils.clone_and_normalize_arguments(args)
25
25
  headers = args.delete('headers') || {}
@@ -20,7 +20,7 @@ module OpenSearch
20
20
  # @option args [Enumerable<String>, String] :expand_wildcards (default: open) Specifies the type of index that wildcard expressions can match. Supports comma-separated values.
21
21
  # @option args [String] :level (default: cluster) Controls the amount of detail included in the cluster health response.
22
22
  # @option args [Boolean] :local Whether to return information from the local node only instead of from the cluster manager node.
23
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
23
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
24
24
  # @option args [String] :timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
25
25
  # @option args [Integer, String] :wait_for_active_shards (default: 0) Waits until the specified number of shards is active before returning a response. Use `all` for all shards.
26
26
  # @option args [String] :wait_for_events Waits until all currently queued events with the given priority are processed.
@@ -18,7 +18,7 @@ module OpenSearch
18
18
  #
19
19
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
20
20
  # @option args [Boolean] :local When `true`, the request retrieves information from the local node only. When `false`, information is retrieved from the cluster manager node.
21
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
22
  def pending_tasks(args = {})
23
23
  args = Utils.clone_and_normalize_arguments(args)
24
24
  headers = args.delete('headers') || {}
@@ -18,8 +18,8 @@ module OpenSearch
18
18
  # @option args [String] :name *Required* The name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`, `logs-settings`, `metrics-mappings`, `metrics-settings`, `synthetics-mapping`, and `synthetics-settings`. OpenSearch uses these templates to configure backing indexes for its data streams. If you want to overwrite one of these templates, set the replacement template `version` to a higher value than the current version. If you want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the [Cluster Update Settings API](https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/).
19
19
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
20
20
  # @option args [Boolean] :create When `true`, this request cannot replace or update existing component templates.
21
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
22
- # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
+ # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
23
23
  # @option args [Hash] :body *Required* The template definition.
24
24
  def put_component_template(args = {})
25
25
  args = Utils.clone_and_normalize_arguments(args)
@@ -17,8 +17,8 @@ module OpenSearch
17
17
  #
18
18
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
19
19
  # @option args [Boolean] :flat_settings Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of `"cluster": { "max_shards_per_node": 500 }` is `"cluster.max_shards_per_node": "500"`.
20
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
- # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
20
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
21
+ # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
22
  # @option args [Hash] :body *Required* The cluster settings to update.
23
23
  def put_settings(args = {})
24
24
  args = Utils.clone_and_normalize_arguments(args)
@@ -18,10 +18,10 @@ module OpenSearch
18
18
  # @option args [String] :cluster_manager_timeout The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units).
19
19
  # @option args [Boolean] :dry_run When `true`, the request simulates the operation and returns the resulting state.
20
20
  # @option args [Boolean] :explain When `true`, the response contains an explanation of why reroute certain commands can or cannot be executed.
21
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
22
22
  # @option args [Enumerable<String>, String] :metric Limits the information returned to the specified metrics.
23
23
  # @option args [Boolean] :retry_failed When `true`, retries shard allocation if it was blocked because of too many subsequent failures.
24
- # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
24
+ # @option args [String] :timeout A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
25
25
  # @option args [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`)
26
26
  def reroute(args = {})
27
27
  args = Utils.clone_and_normalize_arguments(args)
@@ -21,7 +21,7 @@ module OpenSearch
21
21
  # @option args [Boolean] :flat_settings Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of `"cluster": { "max_shards_per_node": 500 }` is `"cluster.max_shards_per_node": "500"`.
22
22
  # @option args [Boolean] :ignore_unavailable Whether the specified concrete indexes should be ignored when unavailable (missing or closed).
23
23
  # @option args [Boolean] :local Whether to return information from the local node only instead of from the cluster manager node.
24
- # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
24
+ # @option args [String] :master_timeout DEPRECATED A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
25
25
  # @option args [Integer] :wait_for_metadata_version Wait for the metadata version to be equal or greater than the specified metadata version.
26
26
  # @option args [String] :wait_for_timeout The maximum time to wait for `wait_for_metadata_version` before timing out.
27
27
  # @option args [Enumerable<String>] :metric Limits the information returned to only the [specified metric groups](https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/#metric-groups).
@@ -13,7 +13,7 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Gets information about auto-follow activity and any replication rules configured on the specified cluster.
16
+ # Retrieves information about any auto-follow activity and any replication rules configured on the specified cluster.
17
17
  #
18
18
  def autofollow_stats(args = {})
19
19
  args = Utils.clone_and_normalize_arguments(args)
@@ -13,7 +13,7 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Automatically starts replication on indexes matching a specified pattern.
16
+ # Automatically starts the replication on indexes matching a specified pattern.
17
17
  #
18
18
  # @option args [Hash] :body *Required*
19
19
  def create_replication_rule(args = {})
@@ -13,7 +13,7 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Gets information about follower (syncing) indexes on a specified cluster.
16
+ # Retrieves information about any follower (syncing) indexes on a specified cluster.
17
17
  #
18
18
  def follower_stats(args = {})
19
19
  args = Utils.clone_and_normalize_arguments(args)
@@ -13,7 +13,7 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Gets information about replicated leader indexes on a specified cluster.
16
+ # Retrieves information about any replicated leader indexes on a specified cluster.
17
17
  #
18
18
  def leader_stats(args = {})
19
19
  args = Utils.clone_and_normalize_arguments(args)
@@ -13,9 +13,9 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Pauses replication of the leader index.
16
+ # Pauses the replication of the leader index.
17
17
  #
18
- # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on.
18
+ # @option args [String] :index *Required* The name of the data stream, index, or index alias to perform bulk actions on.
19
19
  # @option args [Hash] :body *Required*
20
20
  def pause(args = {})
21
21
  args = Utils.clone_and_normalize_arguments(args)
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Resumes replication of the leader index.
17
17
  #
18
- # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on.
18
+ # @option args [String] :index *Required* The name of the data stream, index, or index alias to perform bulk actions on.
19
19
  # @option args [Hash] :body *Required*
20
20
  def resume(args = {})
21
21
  args = Utils.clone_and_normalize_arguments(args)
@@ -13,9 +13,9 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Initiate replication of an index from the leader cluster to the follower cluster.
16
+ # Initiates the replication of an index from the leader cluster to the follower cluster.
17
17
  #
18
- # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on.
18
+ # @option args [String] :index *Required* The name of the data stream, index, or index alias to perform bulk actions on.
19
19
  # @option args [Hash] :body *Required*
20
20
  def start(args = {})
21
21
  args = Utils.clone_and_normalize_arguments(args)
@@ -13,9 +13,9 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Gets the status of index replication.
16
+ # Retrieves the the status of an index replication.
17
17
  #
18
- # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on.
18
+ # @option args [String] :index *Required* The name of the data stream, index, or index alias to perform bulk actions on.
19
19
  def status(args = {})
20
20
  args = Utils.clone_and_normalize_arguments(args)
21
21
  raise ArgumentError, "Required argument 'index' missing" if args['index'].nil?
@@ -13,9 +13,9 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Terminates replication and converts the follower index to a standard index.
16
+ # Terminates the replication and converts the follower index to a standard index.
17
17
  #
18
- # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on.
18
+ # @option args [String] :index *Required* The name of the data stream, index, or index alias to perform bulk actions on.
19
19
  # @option args [Hash] :body *Required*
20
20
  def stop(args = {})
21
21
  args = Utils.clone_and_normalize_arguments(args)
@@ -13,9 +13,9 @@ module OpenSearch
13
13
  module API
14
14
  module Replication
15
15
  module Actions
16
- # Updates settings on the follower index.
16
+ # Updates any settings on the follower index.
17
17
  #
18
- # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on.
18
+ # @option args [String] :index *Required* The name of the data stream, index, or index alias to perform bulk actions on.
19
19
  # @option args [Hash] :body *Required*
20
20
  def update_settings(args = {})
21
21
  args = Utils.clone_and_normalize_arguments(args)
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Creates a snapshot management policy.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management policy name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to create.
19
19
  # @option args [Hash] :body
20
20
  def create_policy(args = {})
21
21
  args = Utils.clone_and_normalize_arguments(args)
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Deletes a snapshot management policy.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management policy name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to delete.
19
19
  def delete_policy(args = {})
20
20
  args = Utils.clone_and_normalize_arguments(args)
21
21
  raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil?
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Explains the state of the snapshot management policy.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management policy name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to explain.
19
19
  def explain_policy(args = {})
20
20
  args = Utils.clone_and_normalize_arguments(args)
21
21
  raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil?
@@ -15,11 +15,11 @@ module OpenSearch
15
15
  module Actions
16
16
  # Retrieves all snapshot management policies with optional pagination and filtering.
17
17
  #
18
- # @option args [Integer] :from (default: 0) The index to retrieve snapshot management policies from.
19
- # @option args [String] :queryString Filters the returned snapshot management policies based on query string.
18
+ # @option args [Integer] :from (default: 0) The starting index from which to retrieve snapshot management policies.
19
+ # @option args [String] :queryString The query string to filter the returned snapshot management policies.
20
20
  # @option args [Integer] :size The number of snapshot management policies to return.
21
- # @option args [String] :sortField The name of the query field to sort on.
22
- # @option args [String] :sortOrder (default: asc) The order to sort the snapshot management policy result.
21
+ # @option args [String] :sortField The name of the field to sort the snapshot management policies by.
22
+ # @option args [String] :sortOrder (default: asc) The order to sort the snapshot management policies.
23
23
  def get_policies(args = {})
24
24
  args = Utils.clone_and_normalize_arguments(args)
25
25
  headers = args.delete('headers') || {}
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Retrieves a specific snapshot management policy by name.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to retrieve.
19
19
  def get_policy(args = {})
20
20
  args = Utils.clone_and_normalize_arguments(args)
21
21
  raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil?
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Starts a snapshot management policy.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management policy name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to start.
19
19
  def start_policy(args = {})
20
20
  args = Utils.clone_and_normalize_arguments(args)
21
21
  raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil?
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Stops a snapshot management policy.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management policy name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to stop.
19
19
  def stop_policy(args = {})
20
20
  args = Utils.clone_and_normalize_arguments(args)
21
21
  raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil?
@@ -15,7 +15,7 @@ module OpenSearch
15
15
  module Actions
16
16
  # Updates an existing snapshot management policy. Requires `if_seq_no` and `if_primary_term`.
17
17
  #
18
- # @option args [String] :policy_name *Required* The snapshot management policy name.
18
+ # @option args [String] :policy_name *Required* The name of the snapshot management policy to update.
19
19
  # @option args [Integer] :if_primary_term *Required* The primary term of the policy to update.
20
20
  # @option args [Integer] :if_seq_no *Required* The sequence number of the policy to update.
21
21
  # @option args [Hash] :body
@@ -19,7 +19,7 @@ module OpenSearch
19
19
  'filter_path' # Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
20
20
  ]).freeze
21
21
 
22
- DEFAULT_SERIALIZER = MultiJson
22
+ DEFAULT_SERIALIZER = Transport::Transport::Serializer::JSON.new
23
23
 
24
24
  def self.serializer
25
25
  settings[:serializer] || DEFAULT_SERIALIZER
@@ -188,10 +188,6 @@ module OpenSearch
188
188
  # Performs a request through delegation to {#transport}.
189
189
  def perform_request(method, path, params = {}, body = nil, headers = {})
190
190
  method = @send_get_body_as if method == 'GET' && body
191
- if (opaque_id = params.delete('opaque_id'))
192
- opaque_id = @opaque_id_prefix ? "#{@opaque_id_prefix}#{opaque_id}" : opaque_id
193
- headers.merge!('X-Opaque-Id' => opaque_id)
194
- end
195
191
  if @options[:request_signer]
196
192
  connection = transport.get_connection
197
193
  headers = @options[:request_signer].sign_request(
@@ -370,10 +366,8 @@ module OpenSearch
370
366
  #
371
367
  def __auto_detect_adapter
372
368
  # Get the Faraday adapter list without initializing it.
373
- adapter = if Faraday::Adapter.respond_to?(:registered_middleware) # Faraday 2.x
369
+ adapter = if Faraday::Adapter.respond_to?(:registered_middleware)
374
370
  ->(name) { Faraday::Adapter.registered_middleware[name] }
375
- elsif Faraday::Adapter.respond_to?(:fetch_middleware) # Faraday 1.x
376
- ->(name) { Faraday::Adapter.fetch_middleware(name) }
377
371
  else
378
372
  {} # fallback behavior that should never happen
379
373
  end
@@ -37,7 +37,7 @@ module OpenSearch
37
37
  DEFAULT_RELOAD_AFTER = 10_000 # Requests
38
38
  DEFAULT_RESURRECT_AFTER = 60 # Seconds
39
39
  DEFAULT_MAX_RETRIES = 3 # Requests
40
- DEFAULT_SERIALIZER_CLASS = Serializer::MultiJson
40
+ DEFAULT_SERIALIZER_CLASS = Serializer::JSON
41
41
  SANITIZED_PASSWORD = '*' * rand(1..14)
42
42
 
43
43
  attr_reader :hosts, :options, :connections, :counter, :last_request_at, :protocol
@@ -38,21 +38,25 @@ module OpenSearch
38
38
  end
39
39
  end
40
40
 
41
- # A default JSON serializer (using [MultiJSON](http://rubygems.org/gems/multi_json))
41
+ # A default JSON serializer (using [json](http://rubygems.org/gems/json))
42
42
  #
43
- class MultiJson
43
+ class JSON
44
44
  include Base
45
45
 
46
46
  # De-serialize a Hash from JSON string
47
47
  #
48
48
  def load(string, options = {})
49
- ::MultiJson.load(string, options)
49
+ ::JSON.parse(string, options)
50
50
  end
51
51
 
52
52
  # Serialize a Hash to JSON string
53
53
  #
54
54
  def dump(object, options = {})
55
- ::MultiJson.dump(object, options)
55
+ if options.delete(:pretty)
56
+ ::JSON.pretty_generate(object, options)
57
+ else
58
+ ::JSON.generate(object, options)
59
+ end
56
60
  end
57
61
  end
58
62
  end
@@ -27,11 +27,11 @@
27
27
  require 'uri'
28
28
  require 'time'
29
29
  require 'timeout'
30
- require 'multi_json'
30
+ require 'json'
31
31
  require 'faraday'
32
32
 
33
33
  require 'opensearch/transport/transport/loggable'
34
- require 'opensearch/transport/transport/serializer/multi_json'
34
+ require 'opensearch/transport/transport/serializer/json'
35
35
  require 'opensearch/transport/transport/sniffer'
36
36
  require 'opensearch/transport/transport/response'
37
37
  require 'opensearch/transport/transport/errors'
@@ -25,5 +25,5 @@
25
25
  # under the License.
26
26
 
27
27
  module OpenSearch
28
- VERSION = '4.0.0-beta.3'.freeze
28
+ VERSION = '4.0.0-beta.5'.freeze
29
29
  end
@@ -64,7 +64,6 @@ Gem::Specification.new do |s|
64
64
 
65
65
  s.required_ruby_version = '>= 3.0'
66
66
 
67
- s.add_dependency 'faraday', '>= 1.0', '< 3'
67
+ s.add_dependency 'faraday', '~> 2.0'
68
68
  s.add_dependency "logger"
69
- s.add_dependency 'multi_json', '>= 1.0'
70
69
  end
data/spec/spec_helper.rb CHANGED
@@ -48,7 +48,7 @@ if defined?(JRUBY_VERSION)
48
48
  require 'pry-nav'
49
49
  else
50
50
  require 'faraday/patron'
51
- require 'faraday/typhoeus' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2')
51
+ require 'faraday/typhoeus'
52
52
  require 'opensearch/transport/transport/http/curb'
53
53
  require 'curb'
54
54
  end
@@ -37,7 +37,7 @@ class OpenSearch::Transport::ClientIntegrationTest < Minitest::Test
37
37
  # Require the library so autodetection finds it.
38
38
  require 'typhoeus'
39
39
  # Require the adapter so autodetection finds it.
40
- require 'faraday/typhoeus' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2')
40
+ require 'faraday/typhoeus'
41
41
 
42
42
  transport = OpenSearch::Transport::Transport::HTTP::Faraday.new \
43
43
  :hosts => [ { host: @host, port: @port } ] do |f|
@@ -30,11 +30,11 @@ class OpenSearch::Transport::Transport::SerializerTest < Minitest::Test
30
30
 
31
31
  context "Serializer" do
32
32
 
33
- should "use MultiJson by default" do
34
- ::MultiJson.expects(:load)
35
- ::MultiJson.expects(:dump)
36
- OpenSearch::Transport::Transport::Serializer::MultiJson.new.load('{}')
37
- OpenSearch::Transport::Transport::Serializer::MultiJson.new.dump({})
33
+ should "use JSON by default" do
34
+ ::JSON.expects(:parse)
35
+ ::JSON.expects(:generate)
36
+ OpenSearch::Transport::Transport::Serializer::JSON.new.load('{}')
37
+ OpenSearch::Transport::Transport::Serializer::JSON.new.dump({})
38
38
  end
39
39
 
40
40
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opensearch-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.pre.beta.3
4
+ version: 4.0.0.pre.beta.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -31,28 +31,22 @@ cert_chain:
31
31
  m0rB25J1sO2yjlalRdBoV5p7OKaWG4CGMr+q6vCC2za7yrtZiYOOv+KpWmheTwds
32
32
  P1nbdIL2eAXGfNU3cbtYisS1sSYi7VSkS52pVk8Jgtw=
33
33
  -----END CERTIFICATE-----
34
- date: 2025-03-24 00:00:00.000000000 Z
34
+ date: 2025-05-01 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: faraday
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '1.0'
43
- - - "<"
40
+ - - "~>"
44
41
  - !ruby/object:Gem::Version
45
- version: '3'
42
+ version: '2.0'
46
43
  type: :runtime
47
44
  prerelease: false
48
45
  version_requirements: !ruby/object:Gem::Requirement
49
46
  requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: '1.0'
53
- - - "<"
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
- version: '3'
49
+ version: '2.0'
56
50
  - !ruby/object:Gem::Dependency
57
51
  name: logger
58
52
  requirement: !ruby/object:Gem::Requirement
@@ -67,20 +61,6 @@ dependencies:
67
61
  - - ">="
68
62
  - !ruby/object:Gem::Version
69
63
  version: '0'
70
- - !ruby/object:Gem::Dependency
71
- name: multi_json
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '1.0'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '1.0'
84
64
  description: |
85
65
  OpenSearch Ruby is a Ruby client for OpenSearch. You can use the client to
86
66
  execute OpenSearch API commands, and build OpenSearch queries and aggregations
@@ -649,7 +629,7 @@ files:
649
629
  - lib/opensearch/transport/transport/http/manticore.rb
650
630
  - lib/opensearch/transport/transport/loggable.rb
651
631
  - lib/opensearch/transport/transport/response.rb
652
- - lib/opensearch/transport/transport/serializer/multi_json.rb
632
+ - lib/opensearch/transport/transport/serializer/json.rb
653
633
  - lib/opensearch/transport/transport/sniffer.rb
654
634
  - lib/opensearch/version.rb
655
635
  - opensearch-ruby.gemspec
metadata.gz.sig CHANGED
Binary file