opensearch-ruby 4.0.0.pre.beta.1 → 4.0.0.pre.beta.3
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
- checksums.yaml.gz.sig +0 -0
- data/USER_GUIDE.md +23 -5
- data/lib/opensearch/api/actions/asynchronous_search/delete.rb +2 -4
- data/lib/opensearch/api/actions/asynchronous_search/get.rb +1 -1
- data/lib/opensearch/api/actions/asynchronous_search/search.rb +4 -4
- data/lib/opensearch/api/actions/asynchronous_search/stats.rb +1 -1
- data/lib/opensearch/api/actions/cat/aliases.rb +8 -8
- data/lib/opensearch/api/actions/cat/all_pit_segments.rb +7 -7
- data/lib/opensearch/api/actions/cat/allocation.rb +10 -10
- data/lib/opensearch/api/actions/cat/cluster_manager.rb +8 -8
- data/lib/opensearch/api/actions/cat/count.rb +6 -6
- data/lib/opensearch/api/actions/cat/fielddata.rb +7 -7
- data/lib/opensearch/api/actions/cat/health.rb +6 -6
- data/lib/opensearch/api/actions/cat/indices.rb +16 -16
- data/lib/opensearch/api/actions/cat/master.rb +8 -8
- data/lib/opensearch/api/actions/cat/nodeattrs.rb +8 -8
- data/lib/opensearch/api/actions/cat/nodes.rb +12 -12
- data/lib/opensearch/api/actions/cat/pending_tasks.rb +10 -10
- data/lib/opensearch/api/actions/cat/pit_segments.rb +7 -7
- data/lib/opensearch/api/actions/cat/plugins.rb +9 -9
- data/lib/opensearch/api/actions/cat/recovery.rb +10 -10
- data/lib/opensearch/api/actions/cat/repositories.rb +9 -9
- data/lib/opensearch/api/actions/cat/segment_replication.rb +19 -18
- data/lib/opensearch/api/actions/cat/segments.rb +8 -8
- data/lib/opensearch/api/actions/cat/shards.rb +11 -11
- data/lib/opensearch/api/actions/cat/snapshots.rb +10 -10
- data/lib/opensearch/api/actions/cat/tasks.rb +9 -9
- data/lib/opensearch/api/actions/cat/templates.rb +9 -9
- data/lib/opensearch/api/actions/cat/thread_pool.rb +9 -9
- data/lib/opensearch/api/actions/clear_scroll.rb +1 -3
- data/lib/opensearch/api/actions/cluster/allocation_explain.rb +4 -4
- data/lib/opensearch/api/actions/cluster/delete_component_template.rb +5 -7
- data/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb +2 -4
- data/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb +3 -5
- data/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb +1 -3
- data/lib/opensearch/api/actions/cluster/exists_component_template.rb +4 -4
- data/lib/opensearch/api/actions/cluster/get_component_template.rb +6 -4
- data/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb +2 -2
- data/lib/opensearch/api/actions/cluster/get_settings.rb +5 -5
- data/lib/opensearch/api/actions/cluster/get_weighted_routing.rb +1 -1
- data/lib/opensearch/api/actions/cluster/health.rb +14 -14
- data/lib/opensearch/api/actions/cluster/pending_tasks.rb +5 -5
- data/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb +4 -4
- data/lib/opensearch/api/actions/cluster/put_component_template.rb +6 -6
- data/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb +3 -3
- data/lib/opensearch/api/actions/cluster/put_settings.rb +5 -5
- data/lib/opensearch/api/actions/cluster/put_weighted_routing.rb +1 -1
- data/lib/opensearch/api/actions/cluster/reroute.rb +6 -6
- data/lib/opensearch/api/actions/cluster/state.rb +10 -10
- data/lib/opensearch/api/actions/cluster/stats.rb +5 -5
- data/lib/opensearch/api/actions/count.rb +1 -1
- data/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb +1 -3
- data/lib/opensearch/api/actions/delete.rb +1 -3
- data/lib/opensearch/api/actions/delete_all_pits.rb +1 -3
- data/lib/opensearch/api/actions/delete_by_query.rb +2 -2
- data/lib/opensearch/api/actions/delete_by_query_rethrottle.rb +1 -1
- data/lib/opensearch/api/actions/delete_pit.rb +1 -3
- data/lib/opensearch/api/actions/delete_script.rb +1 -3
- data/lib/opensearch/api/actions/flow_framework/delete.rb +1 -3
- data/lib/opensearch/api/actions/indices/delete.rb +1 -3
- data/lib/opensearch/api/actions/indices/delete_alias.rb +1 -3
- data/lib/opensearch/api/actions/indices/delete_data_stream.rb +1 -3
- data/lib/opensearch/api/actions/indices/delete_index_template.rb +1 -3
- data/lib/opensearch/api/actions/indices/delete_template.rb +1 -3
- data/lib/opensearch/api/actions/indices/forcemerge.rb +1 -1
- data/lib/opensearch/api/actions/indices/put_template.rb +1 -1
- data/lib/opensearch/api/actions/indices/upgrade.rb +0 -1
- data/lib/opensearch/api/actions/ingest/delete_pipeline.rb +5 -7
- data/lib/opensearch/api/actions/ingest/get_pipeline.rb +3 -3
- data/lib/opensearch/api/actions/ingest/processor_grok.rb +2 -2
- data/lib/opensearch/api/actions/ingest/put_pipeline.rb +5 -5
- data/lib/opensearch/api/actions/ingest/simulate.rb +3 -3
- data/lib/opensearch/api/actions/ism/delete_policy.rb +1 -3
- data/lib/opensearch/api/actions/knn/delete_model.rb +1 -3
- data/lib/opensearch/api/actions/ltr/stats.rb +41 -0
- data/lib/opensearch/api/actions/ml/chunk_model.rb +40 -0
- data/lib/opensearch/api/actions/ml/create_controller.rb +37 -0
- data/lib/opensearch/api/actions/ml/create_memory.rb +32 -0
- data/lib/opensearch/api/actions/ml/create_message.rb +37 -0
- data/lib/opensearch/api/actions/ml/create_model_meta.rb +32 -0
- data/lib/opensearch/api/actions/ml/delete_agent.rb +1 -3
- data/lib/opensearch/api/actions/ml/delete_connector.rb +1 -3
- data/lib/opensearch/api/actions/ml/delete_controller.rb +36 -0
- data/lib/opensearch/api/actions/ml/delete_memory.rb +36 -0
- data/lib/opensearch/api/actions/ml/delete_model.rb +1 -3
- data/lib/opensearch/api/actions/ml/delete_model_group.rb +1 -3
- data/lib/opensearch/api/actions/ml/delete_task.rb +1 -3
- data/lib/opensearch/api/actions/ml/execute_agent.rb +37 -0
- data/lib/opensearch/api/actions/ml/execute_algorithm.rb +37 -0
- data/lib/opensearch/api/actions/ml/get_agent.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_all_memories.rb +38 -0
- data/lib/opensearch/api/actions/ml/get_all_messages.rb +43 -0
- data/lib/opensearch/api/actions/ml/get_all_tools.rb +31 -0
- data/lib/opensearch/api/actions/ml/get_connector.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_controller.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_memory.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_message.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_message_traces.rb +43 -0
- data/lib/opensearch/api/actions/ml/get_model.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_profile.rb +32 -0
- data/lib/opensearch/api/actions/ml/get_profile_models.rb +35 -0
- data/lib/opensearch/api/actions/ml/get_profile_tasks.rb +35 -0
- data/lib/opensearch/api/actions/ml/get_stats.rb +36 -0
- data/lib/opensearch/api/actions/ml/get_tool.rb +36 -0
- data/lib/opensearch/api/actions/ml/load_model.rb +36 -0
- data/lib/opensearch/api/actions/ml/predict.rb +40 -0
- data/lib/opensearch/api/actions/ml/predict_model.rb +37 -0
- data/lib/opensearch/api/actions/ml/register_model_meta.rb +32 -0
- data/lib/opensearch/api/actions/ml/search_agents.rb +32 -0
- data/lib/opensearch/api/actions/ml/search_connectors.rb +32 -0
- data/lib/opensearch/api/actions/ml/search_memory.rb +32 -0
- data/lib/opensearch/api/actions/ml/search_message.rb +37 -0
- data/lib/opensearch/api/actions/ml/search_model_group.rb +32 -0
- data/lib/opensearch/api/actions/ml/search_models.rb +1 -1
- data/lib/opensearch/api/actions/ml/search_tasks.rb +32 -0
- data/lib/opensearch/api/actions/ml/train.rb +37 -0
- data/lib/opensearch/api/actions/ml/train_predict.rb +37 -0
- data/lib/opensearch/api/actions/ml/undeploy_model.rb +2 -3
- data/lib/opensearch/api/actions/ml/unload_model.rb +35 -0
- data/lib/opensearch/api/actions/ml/update_connector.rb +37 -0
- data/lib/opensearch/api/actions/ml/update_controller.rb +37 -0
- data/lib/opensearch/api/actions/ml/update_memory.rb +37 -0
- data/lib/opensearch/api/actions/ml/update_message.rb +37 -0
- data/lib/opensearch/api/actions/ml/update_model.rb +37 -0
- data/lib/opensearch/api/actions/ml/update_model_group.rb +37 -0
- data/lib/opensearch/api/actions/ml/upload_chunk.rb +40 -0
- data/lib/opensearch/api/actions/ml/upload_model.rb +32 -0
- data/lib/opensearch/api/actions/notifications/delete_config.rb +1 -3
- data/lib/opensearch/api/actions/notifications/delete_configs.rb +1 -3
- data/lib/opensearch/api/actions/observability/delete_object.rb +1 -3
- data/lib/opensearch/api/actions/observability/delete_objects.rb +1 -3
- data/lib/opensearch/api/actions/query/datasource_delete.rb +1 -3
- data/lib/opensearch/api/actions/reindex.rb +3 -1
- data/lib/opensearch/api/actions/reindex_rethrottle.rb +1 -1
- data/lib/opensearch/api/actions/replication/delete_replication_rule.rb +1 -3
- data/lib/opensearch/api/actions/rollups/delete.rb +1 -3
- data/lib/opensearch/api/actions/scroll.rb +1 -1
- data/lib/opensearch/api/actions/search_pipeline/delete.rb +1 -3
- data/lib/opensearch/api/actions/search_shards.rb +0 -1
- data/lib/opensearch/api/actions/security/authinfo.rb +3 -3
- data/lib/opensearch/api/actions/security/authtoken.rb +1 -1
- data/lib/opensearch/api/actions/security/config_upgrade_check.rb +1 -1
- data/lib/opensearch/api/actions/security/config_upgrade_perform.rb +1 -1
- data/lib/opensearch/api/actions/security/create_allowlist.rb +1 -1
- data/lib/opensearch/api/actions/security/create_role.rb +1 -1
- data/lib/opensearch/api/actions/security/create_role_mapping.rb +1 -1
- data/lib/opensearch/api/actions/security/create_tenant.rb +1 -1
- data/lib/opensearch/api/actions/security/create_update_tenancy_config.rb +1 -1
- data/lib/opensearch/api/actions/security/create_user.rb +1 -1
- data/lib/opensearch/api/actions/security/create_user_legacy.rb +1 -1
- data/lib/opensearch/api/actions/security/delete_action_group.rb +2 -4
- data/lib/opensearch/api/actions/security/delete_distinguished_name.rb +3 -5
- data/lib/opensearch/api/actions/security/delete_role.rb +2 -4
- data/lib/opensearch/api/actions/security/delete_role_mapping.rb +2 -4
- data/lib/opensearch/api/actions/security/delete_tenant.rb +2 -4
- data/lib/opensearch/api/actions/security/delete_user.rb +2 -4
- data/lib/opensearch/api/actions/security/delete_user_legacy.rb +1 -3
- data/lib/opensearch/api/actions/security/flush_cache.rb +2 -4
- data/lib/opensearch/api/actions/security/generate_obo_token.rb +1 -1
- data/lib/opensearch/api/actions/security/generate_user_token.rb +2 -2
- data/lib/opensearch/api/actions/security/generate_user_token_legacy.rb +1 -1
- data/lib/opensearch/api/actions/security/get_account_details.rb +1 -1
- data/lib/opensearch/api/actions/security/get_all_certificates.rb +2 -2
- data/lib/opensearch/api/actions/security/get_allowlist.rb +1 -1
- data/lib/opensearch/api/actions/security/get_configuration.rb +1 -1
- data/lib/opensearch/api/actions/security/get_dashboards_info.rb +1 -1
- data/lib/opensearch/api/actions/security/get_distinguished_name.rb +3 -3
- data/lib/opensearch/api/actions/security/get_distinguished_names.rb +2 -2
- data/lib/opensearch/api/actions/security/get_node_certificates.rb +4 -4
- data/lib/opensearch/api/actions/security/get_permissions_info.rb +1 -1
- data/lib/opensearch/api/actions/security/get_role.rb +1 -1
- data/lib/opensearch/api/actions/security/get_role_mapping.rb +2 -2
- data/lib/opensearch/api/actions/security/get_sslinfo.rb +2 -2
- data/lib/opensearch/api/actions/security/get_tenancy_config.rb +1 -1
- data/lib/opensearch/api/actions/security/get_tenant.rb +1 -1
- data/lib/opensearch/api/actions/security/get_user.rb +1 -1
- data/lib/opensearch/api/actions/security/health.rb +2 -2
- data/lib/opensearch/api/actions/security/migrate.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_action_group.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_action_groups.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_allowlist.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_audit_configuration.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_configuration.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_distinguished_name.rb +5 -5
- data/lib/opensearch/api/actions/security/patch_distinguished_names.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_role.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_role_mapping.rb +2 -2
- data/lib/opensearch/api/actions/security/patch_role_mappings.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_tenant.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_tenants.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_user.rb +1 -1
- data/lib/opensearch/api/actions/security/patch_users.rb +1 -1
- data/lib/opensearch/api/actions/security/post_dashboards_info.rb +1 -1
- data/lib/opensearch/api/actions/security/reload_http_certificates.rb +1 -1
- data/lib/opensearch/api/actions/security/reload_transport_certificates.rb +1 -1
- data/lib/opensearch/api/actions/security/tenant_info.rb +1 -1
- data/lib/opensearch/api/actions/security/update_configuration.rb +1 -1
- data/lib/opensearch/api/actions/security/update_distinguished_name.rb +2 -2
- data/lib/opensearch/api/actions/security/validate.rb +1 -1
- data/lib/opensearch/api/actions/security/who_am_i.rb +1 -1
- data/lib/opensearch/api/actions/security/who_am_i_protected.rb +1 -1
- data/lib/opensearch/api/actions/sm/create_policy.rb +1 -1
- data/lib/opensearch/api/actions/sm/delete_policy.rb +2 -4
- data/lib/opensearch/api/actions/sm/explain_policy.rb +1 -1
- data/lib/opensearch/api/actions/sm/get_policies.rb +5 -5
- data/lib/opensearch/api/actions/sm/get_policy.rb +1 -1
- data/lib/opensearch/api/actions/sm/start_policy.rb +1 -1
- data/lib/opensearch/api/actions/sm/stop_policy.rb +1 -1
- data/lib/opensearch/api/actions/sm/update_policy.rb +1 -1
- data/lib/opensearch/api/actions/snapshot/cleanup_repository.rb +3 -3
- data/lib/opensearch/api/actions/snapshot/clone.rb +6 -6
- data/lib/opensearch/api/actions/snapshot/create.rb +6 -6
- data/lib/opensearch/api/actions/snapshot/create_repository.rb +6 -6
- data/lib/opensearch/api/actions/snapshot/delete.rb +4 -6
- data/lib/opensearch/api/actions/snapshot/delete_repository.rb +5 -7
- data/lib/opensearch/api/actions/snapshot/get.rb +5 -5
- data/lib/opensearch/api/actions/snapshot/get_repository.rb +4 -4
- data/lib/opensearch/api/actions/snapshot/restore.rb +5 -5
- data/lib/opensearch/api/actions/snapshot/status.rb +4 -4
- data/lib/opensearch/api/actions/snapshot/verify_repository.rb +3 -3
- data/lib/opensearch/api/actions/tasks/cancel.rb +5 -5
- data/lib/opensearch/api/actions/tasks/get.rb +3 -3
- data/lib/opensearch/api/actions/tasks/list.rb +7 -7
- data/lib/opensearch/api/actions/transforms/delete.rb +1 -3
- data/lib/opensearch/api/actions/update_by_query.rb +2 -2
- data/lib/opensearch/api/actions/wlm/delete_query_group.rb +1 -3
- data/lib/opensearch/api/utils.rb +1 -1
- data/lib/opensearch/transport/client.rb +21 -6
- data/lib/opensearch/transport/transport/base.rb +3 -8
- data/lib/opensearch/version.rb +1 -1
- data/lib/opensearch.rb +4 -0
- data/opensearch-ruby.gemspec +1 -0
- data/test/transport/unit/transport_base_test.rb +0 -26
- data.tar.gz.sig +0 -0
- metadata +62 -2
- metadata.gz.sig +0 -0
@@ -13,12 +13,12 @@ module OpenSearch
|
|
13
13
|
module API
|
14
14
|
module Snapshot
|
15
15
|
module Actions
|
16
|
-
# Returns information about a repository.
|
16
|
+
# Returns information about a snapshot repository.
|
17
17
|
#
|
18
|
-
# @option args [String] :cluster_manager_timeout
|
19
|
-
# @option args [Boolean] :local
|
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
|
+
# @option args [Boolean] :local Whether to get information from the local node.
|
20
20
|
# @option args [String] :master_timeout DEPRECATED Explicit operation timeout for connection to cluster-manager node
|
21
|
-
# @option args [Enumerable<String>, String] :repository A comma-separated list of repository names
|
21
|
+
# @option args [Enumerable<String>, String] :repository A comma-separated list of repository names.
|
22
22
|
def get_repository(args = {})
|
23
23
|
args = Utils.clone_and_normalize_arguments(args)
|
24
24
|
_repository = args.delete('repository')
|
@@ -15,12 +15,12 @@ module OpenSearch
|
|
15
15
|
module Actions
|
16
16
|
# Restores a snapshot.
|
17
17
|
#
|
18
|
-
# @option args [String] :repository *Required*
|
19
|
-
# @option args [String] :snapshot *Required*
|
20
|
-
# @option args [String] :cluster_manager_timeout
|
18
|
+
# @option args [String] :repository *Required* The name of the repository containing the snapshot
|
19
|
+
# @option args [String] :snapshot *Required* The name of the snapshot to restore.
|
20
|
+
# @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).
|
21
21
|
# @option args [String] :master_timeout DEPRECATED Explicit operation timeout for connection to cluster-manager node
|
22
|
-
# @option args [Boolean] :wait_for_completion
|
23
|
-
# @option args [Hash] :body
|
22
|
+
# @option args [Boolean] :wait_for_completion -| Whether to return a response after the restore operation has completed. When `false`, the request returns a response when the restore operation initializes. When `true`, the request returns a response when the restore operation completes.
|
23
|
+
# @option args [Hash] :body Determines which settings and indexes to restore when restoring a snapshot
|
24
24
|
def restore(args = {})
|
25
25
|
args = Utils.clone_and_normalize_arguments(args)
|
26
26
|
raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil?
|
@@ -15,11 +15,11 @@ module OpenSearch
|
|
15
15
|
module Actions
|
16
16
|
# Returns information about the status of a snapshot.
|
17
17
|
#
|
18
|
-
# @option args [String] :cluster_manager_timeout
|
19
|
-
# @option args [Boolean] :ignore_unavailable Whether to ignore unavailable snapshots,
|
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
|
+
# @option args [Boolean] :ignore_unavailable Whether to ignore any unavailable snapshots, When `false`, a `SnapshotMissingException` is thrown.
|
20
20
|
# @option args [String] :master_timeout DEPRECATED Explicit operation timeout for connection to cluster-manager node
|
21
|
-
# @option args [String] :repository
|
22
|
-
# @option args [Enumerable<String>, String] :snapshot A comma-separated list of snapshot names
|
21
|
+
# @option args [String] :repository The name of the repository containing the snapshot.
|
22
|
+
# @option args [Enumerable<String>, String] :snapshot A comma-separated list of snapshot names.
|
23
23
|
def status(args = {})
|
24
24
|
args = Utils.clone_and_normalize_arguments(args)
|
25
25
|
_repository = args.delete('repository')
|
@@ -15,10 +15,10 @@ module OpenSearch
|
|
15
15
|
module Actions
|
16
16
|
# Verifies a repository.
|
17
17
|
#
|
18
|
-
# @option args [String] :repository *Required*
|
19
|
-
# @option args [String] :cluster_manager_timeout
|
18
|
+
# @option args [String] :repository *Required* The name of the repository containing the snapshot.
|
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 [String] :master_timeout DEPRECATED Explicit operation timeout for connection to cluster-manager node
|
21
|
-
# @option args [String] :timeout
|
21
|
+
# @option args [String] :timeout The amount of time to wait for a response.
|
22
22
|
def verify_repository(args = {})
|
23
23
|
args = Utils.clone_and_normalize_arguments(args)
|
24
24
|
raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil?
|
@@ -15,11 +15,11 @@ module OpenSearch
|
|
15
15
|
module Actions
|
16
16
|
# Cancels a task, if it can be cancelled through an API.
|
17
17
|
#
|
18
|
-
# @option args [Enumerable<String>, String] :actions
|
19
|
-
# @option args [Enumerable<String>] :nodes
|
20
|
-
# @option args [String] :parent_task_id
|
21
|
-
# @option args [Boolean] :wait_for_completion
|
22
|
-
# @option args [
|
18
|
+
# @option args [Enumerable<String>, String] :actions A comma-separated list of actions that should be returned. Keep empty to return all.
|
19
|
+
# @option args [Enumerable<String>] :nodes A comma-separated list of node IDs or names used to limit the returned information. Use `_local` to return information from the node you're connecting to, specify the node name to get information from a specific node, or keep the parameter empty to get information from all nodes.
|
20
|
+
# @option args [String] :parent_task_id Returns tasks with a specified parent task ID (`node_id:task_number`). Keep empty or set to -1 to return all.
|
21
|
+
# @option args [Boolean] :wait_for_completion Waits for the matching task to complete. When `true`, the request is blocked until the task has completed.
|
22
|
+
# @option args [String] :task_id The task ID.
|
23
23
|
def cancel(args = {})
|
24
24
|
args = Utils.clone_and_normalize_arguments(args)
|
25
25
|
_task_id = args.delete('task_id')
|
@@ -15,9 +15,9 @@ module OpenSearch
|
|
15
15
|
module Actions
|
16
16
|
# Returns information about a task.
|
17
17
|
#
|
18
|
-
# @option args [String] :task_id *Required*
|
19
|
-
# @option args [String] :timeout
|
20
|
-
# @option args [Boolean] :wait_for_completion
|
18
|
+
# @option args [String] :task_id *Required* The task ID.
|
19
|
+
# @option args [String] :timeout (default: 30s) The amount of time to wait for a response.
|
20
|
+
# @option args [Boolean] :wait_for_completion Waits for the matching task to complete. When `true`, the request is blocked until the task has completed.
|
21
21
|
def get(args = {})
|
22
22
|
args = Utils.clone_and_normalize_arguments(args)
|
23
23
|
raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil?
|
@@ -15,13 +15,13 @@ module OpenSearch
|
|
15
15
|
module Actions
|
16
16
|
# Returns a list of tasks.
|
17
17
|
#
|
18
|
-
# @option args [Enumerable<String>, String] :actions
|
19
|
-
# @option args [Boolean] :detailed
|
20
|
-
# @option args [String] :group_by
|
21
|
-
# @option args [Enumerable<String>] :nodes
|
22
|
-
# @option args [String] :parent_task_id
|
23
|
-
# @option args [String] :timeout
|
24
|
-
# @option args [Boolean] :wait_for_completion
|
18
|
+
# @option args [Enumerable<String>, String] :actions A comma-separated list of actions that should be returned. Keep empty to return all.
|
19
|
+
# @option args [Boolean] :detailed When `true`, the response includes detailed information about shard recoveries.
|
20
|
+
# @option args [String] :group_by (default: nodes) Groups tasks by parent/child relationships or nodes.
|
21
|
+
# @option args [Enumerable<String>] :nodes A comma-separated list of node IDs or names used to limit the returned information. Use `_local` to return information from the node you're connecting to, specify the node name to get information from a specific node, or keep the parameter empty to get information from all nodes.
|
22
|
+
# @option args [String] :parent_task_id Returns tasks with a specified parent task ID (`node_id:task_number`). Keep empty or set to -1 to return all.
|
23
|
+
# @option args [String] :timeout The amount of time to wait for a response.
|
24
|
+
# @option args [Boolean] :wait_for_completion Waits for the matching task to complete. When `true`, the request is blocked until the task has completed.
|
25
25
|
def list(args = {})
|
26
26
|
args = Utils.clone_and_normalize_arguments(args)
|
27
27
|
headers = args.delete('headers') || {}
|
@@ -16,21 +16,19 @@ module OpenSearch
|
|
16
16
|
# Delete an index transform.
|
17
17
|
#
|
18
18
|
# @option args [String] :id *Required* Transform to delete
|
19
|
-
# @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request
|
20
19
|
def delete(args = {})
|
21
20
|
args = Utils.clone_and_normalize_arguments(args)
|
22
21
|
raise ArgumentError, "Required argument 'id' missing" if args['id'].nil?
|
23
22
|
|
24
23
|
_id = args.delete('id')
|
25
24
|
|
26
|
-
ignore = args.delete('ignore') || []
|
27
25
|
headers = args.delete('headers') || {}
|
28
26
|
body = args.delete('body')
|
29
27
|
method = 'DELETE'
|
30
28
|
url = Utils.build_url('_plugins/_transform', _id)
|
31
29
|
|
32
30
|
Utils.validate_query_params! args
|
33
|
-
transport.perform_delete_request method, url, args, body, headers
|
31
|
+
transport.perform_delete_request method, url, args, body, headers
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
@@ -17,7 +17,7 @@ module OpenSearch
|
|
17
17
|
# for example to pick up a mapping change.
|
18
18
|
#
|
19
19
|
# @option args [Enumerable<String>, String] :index *Required* Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams or indexes, omit this parameter or use `*` or `_all`.
|
20
|
-
# @option args [Enumerable<String
|
20
|
+
# @option args [Boolean, Enumerable<String>, String] :_source Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
|
21
21
|
# @option args [Enumerable<String>] :_source_excludes List of fields to exclude from the returned `_source` field.
|
22
22
|
# @option args [Enumerable<String>] :_source_includes List of fields to extract and return from the `_source` field.
|
23
23
|
# @option args [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 indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
|
@@ -43,7 +43,7 @@ module OpenSearch
|
|
43
43
|
# @option args [String] :search_timeout Explicit timeout for each search request.
|
44
44
|
# @option args [String] :search_type The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.
|
45
45
|
# @option args [Integer] :size Deprecated, use `max_docs` instead.
|
46
|
-
# @option args [
|
46
|
+
# @option args [Integer, String] :slices The number of slices this task should be divided into.
|
47
47
|
# @option args [Enumerable<String>] :sort A comma-separated list of <field>:<direction> pairs.
|
48
48
|
# @option args [Enumerable<String>] :stats Specific `tag` of the request for logging and statistical purposes.
|
49
49
|
# @option args [Integer] :terminate_after Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers.
|
@@ -16,21 +16,19 @@ module OpenSearch
|
|
16
16
|
# Deletes the specified query group.
|
17
17
|
#
|
18
18
|
# @option args [String] :name *Required* The name of the query group.
|
19
|
-
# @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request
|
20
19
|
def delete_query_group(args = {})
|
21
20
|
args = Utils.clone_and_normalize_arguments(args)
|
22
21
|
raise ArgumentError, "Required argument 'name' missing" if args['name'].nil?
|
23
22
|
|
24
23
|
_name = args.delete('name')
|
25
24
|
|
26
|
-
ignore = args.delete('ignore') || []
|
27
25
|
headers = args.delete('headers') || {}
|
28
26
|
body = args.delete('body')
|
29
27
|
method = 'DELETE'
|
30
28
|
url = Utils.build_url('_wlm/query_group', _name)
|
31
29
|
|
32
30
|
Utils.validate_query_params! args
|
33
|
-
transport.perform_delete_request method, url, args, body, headers
|
31
|
+
transport.perform_delete_request method, url, args, body, headers
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
data/lib/opensearch/api/utils.rb
CHANGED
@@ -14,7 +14,7 @@ require 'cgi'
|
|
14
14
|
module OpenSearch
|
15
15
|
module API
|
16
16
|
module Utils
|
17
|
-
NON_URL_ARGS = Set.new(%w[body headers
|
17
|
+
NON_URL_ARGS = Set.new(%w[body headers]).freeze
|
18
18
|
BULK_OPERATIONS = Set.new(%w[index create delete update]).freeze
|
19
19
|
|
20
20
|
# @return a new hash with all keys converted to strings and url param values escaped
|
@@ -101,8 +101,12 @@ module OpenSearch
|
|
101
101
|
#
|
102
102
|
# @option arguments [Boolean] :reload_on_failure Reload connections after failure (false by default)
|
103
103
|
#
|
104
|
+
# @option arguments [Boolean] :ignore_404_on_delete Whether to ignore 404/NotFound error on http DELETE (false by default)
|
105
|
+
#
|
104
106
|
# @option arguments [Integer] :request_timeout The request timeout to be passed to transport in options
|
105
107
|
#
|
108
|
+
# @option arguments [Object] :request_signer An object that responds to `#sign_request` and returns a hash of headers
|
109
|
+
#
|
106
110
|
# @option arguments [Symbol] :adapter A specific adapter for Faraday (e.g. `:patron`)
|
107
111
|
#
|
108
112
|
# @option arguments [Hash] :transport_options Options to be passed to the `Faraday::Connection` constructor
|
@@ -134,7 +138,7 @@ module OpenSearch
|
|
134
138
|
#
|
135
139
|
def initialize(arguments = {}, &block)
|
136
140
|
@options = arguments.transform_keys(&:to_sym)
|
137
|
-
@arguments = @options
|
141
|
+
@arguments = @options.clone
|
138
142
|
@arguments[:logger] ||= @arguments[:log] ? DEFAULT_LOGGER.call : nil
|
139
143
|
@arguments[:tracer] ||= @arguments[:trace] ? DEFAULT_TRACER.call : nil
|
140
144
|
@arguments[:reload_connections] ||= false
|
@@ -144,6 +148,8 @@ module OpenSearch
|
|
144
148
|
@arguments[:transport_options] ||= {}
|
145
149
|
@arguments[:http] ||= {}
|
146
150
|
@options[:http] ||= {}
|
151
|
+
@options[:ignore_404_on_delete] ||= false
|
152
|
+
@options[:request_signer] ||= nil
|
147
153
|
|
148
154
|
set_api_key if (@api_key = @arguments[:api_key])
|
149
155
|
set_compatibility_header if ENV['ELASTIC_CLIENT_APIVERSIONING']
|
@@ -180,13 +186,22 @@ module OpenSearch
|
|
180
186
|
end
|
181
187
|
|
182
188
|
# Performs a request through delegation to {#transport}.
|
183
|
-
def perform_request(method, path, params = {}, body = nil, headers =
|
189
|
+
def perform_request(method, path, params = {}, body = nil, headers = {})
|
184
190
|
method = @send_get_body_as if method == 'GET' && body
|
185
|
-
if (opaque_id = params.delete(
|
186
|
-
headers = {} if headers.nil?
|
191
|
+
if (opaque_id = params.delete('opaque_id'))
|
187
192
|
opaque_id = @opaque_id_prefix ? "#{@opaque_id_prefix}#{opaque_id}" : opaque_id
|
188
193
|
headers.merge!('X-Opaque-Id' => opaque_id)
|
189
194
|
end
|
195
|
+
if @options[:request_signer]
|
196
|
+
connection = transport.get_connection
|
197
|
+
headers = @options[:request_signer].sign_request(
|
198
|
+
method: method, path: path, params: params, body: body, headers: headers,
|
199
|
+
host: connection.host[:host],
|
200
|
+
port: connection.host[:port],
|
201
|
+
url: connection.full_url(path, params),
|
202
|
+
logger: @arguments[:logger]
|
203
|
+
)
|
204
|
+
end
|
190
205
|
transport.perform_request(method, path, params, body, headers)
|
191
206
|
end
|
192
207
|
|
@@ -206,10 +221,10 @@ module OpenSearch
|
|
206
221
|
raise e
|
207
222
|
end
|
208
223
|
|
209
|
-
def perform_delete_request(*args
|
224
|
+
def perform_delete_request(*args)
|
210
225
|
perform_request(*args).body
|
211
226
|
rescue StandardError => e
|
212
|
-
if
|
227
|
+
if @options[:ignore_404_on_delete]
|
213
228
|
return false if e.class.to_s =~ /NotFound/
|
214
229
|
return false if e.message =~ /Not\s*Found/i
|
215
230
|
end
|
@@ -282,8 +282,6 @@ module OpenSearch
|
|
282
282
|
|
283
283
|
params = params.clone
|
284
284
|
|
285
|
-
ignore = Array(params.delete(:ignore)).compact.map(&:to_i)
|
286
|
-
|
287
285
|
begin
|
288
286
|
tries += 1
|
289
287
|
connection = get_connection or raise(Error, 'Cannot get new connection from pool.')
|
@@ -343,10 +341,9 @@ module OpenSearch
|
|
343
341
|
duration
|
344
342
|
end
|
345
343
|
|
346
|
-
#
|
347
|
-
log_fatal "[#{response.status}] #{response.body}" unless ignore.include?(response.status.to_i)
|
344
|
+
log_fatal "[#{response.status}] #{response.body}"
|
348
345
|
|
349
|
-
__raise_transport_error response
|
346
|
+
__raise_transport_error response
|
350
347
|
end
|
351
348
|
|
352
349
|
if response.body && !response.body.empty? && response.headers && response.headers['content-type'] =~ /json/
|
@@ -358,9 +355,7 @@ module OpenSearch
|
|
358
355
|
'n/a'
|
359
356
|
end
|
360
357
|
|
361
|
-
|
362
|
-
__log_response method, path, params, body, url, response, json, took, duration
|
363
|
-
end
|
358
|
+
__log_response method, path, params, body, url, response, json, took, duration
|
364
359
|
|
365
360
|
if tracer
|
366
361
|
__trace method, path, params, connection.connection.headers, body, url, response, nil, 'N/A',
|
data/lib/opensearch/version.rb
CHANGED
data/lib/opensearch.rb
CHANGED
@@ -64,6 +64,10 @@ module OpenSearch
|
|
64
64
|
@list ||= OpenSearch::API::Namespace.new(transport, OpenSearch::API::List::Actions)
|
65
65
|
end
|
66
66
|
|
67
|
+
def ltr
|
68
|
+
@ltr ||= OpenSearch::API::Namespace.new(transport, OpenSearch::API::Ltr::Actions)
|
69
|
+
end
|
70
|
+
|
67
71
|
def ml
|
68
72
|
@ml ||= OpenSearch::API::Namespace.new(transport, OpenSearch::API::Ml::Actions)
|
69
73
|
end
|
data/opensearch-ruby.gemspec
CHANGED
@@ -281,21 +281,6 @@ class OpenSearch::Transport::Transport::BaseTest < Minitest::Test
|
|
281
281
|
end
|
282
282
|
end
|
283
283
|
|
284
|
-
should "not raise an error when the :ignore argument has been passed" do
|
285
|
-
@transport.stubs(:get_connection).returns(stub_everything :failures => 1)
|
286
|
-
|
287
|
-
assert_raise OpenSearch::Transport::Transport::Errors::BadRequest do
|
288
|
-
@transport.perform_request 'GET', '/' do
|
289
|
-
OpenSearch::Transport::Transport::Response.new 400, 'CLIENT ERROR'
|
290
|
-
end
|
291
|
-
end
|
292
|
-
|
293
|
-
# No `BadRequest` error
|
294
|
-
@transport.perform_request 'GET', '/', :ignore => 400 do
|
295
|
-
OpenSearch::Transport::Transport::Response.new 400, 'CLIENT ERROR'
|
296
|
-
end
|
297
|
-
end
|
298
|
-
|
299
284
|
should "mark the connection as dead on failure" do
|
300
285
|
c = stub_everything :failures => 1
|
301
286
|
@transport.expects(:get_connection).returns(c)
|
@@ -467,17 +452,6 @@ class OpenSearch::Transport::Transport::BaseTest < Minitest::Test
|
|
467
452
|
end
|
468
453
|
end
|
469
454
|
|
470
|
-
should "not log a failed OpenSearch request as fatal" do
|
471
|
-
@block = Proc.new { |c, u| puts "ERROR" }
|
472
|
-
@block.expects(:call).returns(OpenSearch::Transport::Transport::Response.new 500, 'ERROR')
|
473
|
-
|
474
|
-
@transport.expects(:__log_response).once
|
475
|
-
@transport.logger.expects(:fatal).never
|
476
|
-
|
477
|
-
# No `BadRequest` error
|
478
|
-
@transport.perform_request('POST', '_search', :ignore => 500, &@block)
|
479
|
-
end
|
480
|
-
|
481
455
|
should "log and re-raise a Ruby exception" do
|
482
456
|
@block = Proc.new { |c, u| puts "ERROR" }
|
483
457
|
@block.expects(:call).raises(StandardError)
|
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.
|
4
|
+
version: 4.0.0.pre.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
m0rB25J1sO2yjlalRdBoV5p7OKaWG4CGMr+q6vCC2za7yrtZiYOOv+KpWmheTwds
|
32
32
|
P1nbdIL2eAXGfNU3cbtYisS1sSYi7VSkS52pVk8Jgtw=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2025-
|
34
|
+
date: 2025-03-24 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: faraday
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - "<"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '3'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: logger
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: multi_json
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,21 +263,67 @@ files:
|
|
249
263
|
- lib/opensearch/api/actions/list/help.rb
|
250
264
|
- lib/opensearch/api/actions/list/indices.rb
|
251
265
|
- lib/opensearch/api/actions/list/shards.rb
|
266
|
+
- lib/opensearch/api/actions/ltr/stats.rb
|
252
267
|
- lib/opensearch/api/actions/mget.rb
|
268
|
+
- lib/opensearch/api/actions/ml/chunk_model.rb
|
253
269
|
- lib/opensearch/api/actions/ml/create_connector.rb
|
270
|
+
- lib/opensearch/api/actions/ml/create_controller.rb
|
271
|
+
- lib/opensearch/api/actions/ml/create_memory.rb
|
272
|
+
- lib/opensearch/api/actions/ml/create_message.rb
|
273
|
+
- lib/opensearch/api/actions/ml/create_model_meta.rb
|
254
274
|
- lib/opensearch/api/actions/ml/delete_agent.rb
|
255
275
|
- lib/opensearch/api/actions/ml/delete_connector.rb
|
276
|
+
- lib/opensearch/api/actions/ml/delete_controller.rb
|
277
|
+
- lib/opensearch/api/actions/ml/delete_memory.rb
|
256
278
|
- lib/opensearch/api/actions/ml/delete_model.rb
|
257
279
|
- lib/opensearch/api/actions/ml/delete_model_group.rb
|
258
280
|
- lib/opensearch/api/actions/ml/delete_task.rb
|
259
281
|
- lib/opensearch/api/actions/ml/deploy_model.rb
|
282
|
+
- lib/opensearch/api/actions/ml/execute_agent.rb
|
283
|
+
- lib/opensearch/api/actions/ml/execute_algorithm.rb
|
284
|
+
- lib/opensearch/api/actions/ml/get_agent.rb
|
285
|
+
- lib/opensearch/api/actions/ml/get_all_memories.rb
|
286
|
+
- lib/opensearch/api/actions/ml/get_all_messages.rb
|
287
|
+
- lib/opensearch/api/actions/ml/get_all_tools.rb
|
288
|
+
- lib/opensearch/api/actions/ml/get_connector.rb
|
289
|
+
- lib/opensearch/api/actions/ml/get_controller.rb
|
290
|
+
- lib/opensearch/api/actions/ml/get_memory.rb
|
291
|
+
- lib/opensearch/api/actions/ml/get_message.rb
|
292
|
+
- lib/opensearch/api/actions/ml/get_message_traces.rb
|
293
|
+
- lib/opensearch/api/actions/ml/get_model.rb
|
260
294
|
- lib/opensearch/api/actions/ml/get_model_group.rb
|
295
|
+
- lib/opensearch/api/actions/ml/get_profile.rb
|
296
|
+
- lib/opensearch/api/actions/ml/get_profile_models.rb
|
297
|
+
- lib/opensearch/api/actions/ml/get_profile_tasks.rb
|
298
|
+
- lib/opensearch/api/actions/ml/get_stats.rb
|
261
299
|
- lib/opensearch/api/actions/ml/get_task.rb
|
300
|
+
- lib/opensearch/api/actions/ml/get_tool.rb
|
301
|
+
- lib/opensearch/api/actions/ml/load_model.rb
|
302
|
+
- lib/opensearch/api/actions/ml/predict.rb
|
303
|
+
- lib/opensearch/api/actions/ml/predict_model.rb
|
262
304
|
- lib/opensearch/api/actions/ml/register_agents.rb
|
263
305
|
- lib/opensearch/api/actions/ml/register_model.rb
|
264
306
|
- lib/opensearch/api/actions/ml/register_model_group.rb
|
307
|
+
- lib/opensearch/api/actions/ml/register_model_meta.rb
|
308
|
+
- lib/opensearch/api/actions/ml/search_agents.rb
|
309
|
+
- lib/opensearch/api/actions/ml/search_connectors.rb
|
310
|
+
- lib/opensearch/api/actions/ml/search_memory.rb
|
311
|
+
- lib/opensearch/api/actions/ml/search_message.rb
|
312
|
+
- lib/opensearch/api/actions/ml/search_model_group.rb
|
265
313
|
- lib/opensearch/api/actions/ml/search_models.rb
|
314
|
+
- lib/opensearch/api/actions/ml/search_tasks.rb
|
315
|
+
- lib/opensearch/api/actions/ml/train.rb
|
316
|
+
- lib/opensearch/api/actions/ml/train_predict.rb
|
266
317
|
- lib/opensearch/api/actions/ml/undeploy_model.rb
|
318
|
+
- lib/opensearch/api/actions/ml/unload_model.rb
|
319
|
+
- lib/opensearch/api/actions/ml/update_connector.rb
|
320
|
+
- lib/opensearch/api/actions/ml/update_controller.rb
|
321
|
+
- lib/opensearch/api/actions/ml/update_memory.rb
|
322
|
+
- lib/opensearch/api/actions/ml/update_message.rb
|
323
|
+
- lib/opensearch/api/actions/ml/update_model.rb
|
324
|
+
- lib/opensearch/api/actions/ml/update_model_group.rb
|
325
|
+
- lib/opensearch/api/actions/ml/upload_chunk.rb
|
326
|
+
- lib/opensearch/api/actions/ml/upload_model.rb
|
267
327
|
- lib/opensearch/api/actions/msearch.rb
|
268
328
|
- lib/opensearch/api/actions/msearch_template.rb
|
269
329
|
- lib/opensearch/api/actions/mtermvectors.rb
|
metadata.gz.sig
CHANGED
Binary file
|