elasticsearch-api 8.0.0.pre1 → 8.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/api-spec-testing/rspec_matchers.rb +1 -1
- data/api-spec-testing/test_file/action.rb +103 -48
- data/api-spec-testing/test_file.rb +9 -3
- data/api-spec-testing/wipe_cluster.rb +2 -1
- data/elasticsearch-api.gemspec +8 -1
- data/lib/elasticsearch/api/actions/async_search/delete.rb +2 -3
- data/lib/elasticsearch/api/actions/async_search/get.rb +2 -3
- data/lib/elasticsearch/api/actions/async_search/status.rb +2 -3
- data/lib/elasticsearch/api/actions/async_search/submit.rb +3 -4
- data/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb +3 -4
- data/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/bulk.rb +5 -10
- data/lib/elasticsearch/api/actions/cat/aliases.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/allocation.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/count.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/health.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/help.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/indices.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/master.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/ml_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/ml_datafeeds.rb +2 -4
- data/lib/elasticsearch/api/actions/cat/ml_jobs.rb +2 -4
- data/lib/elasticsearch/api/actions/cat/ml_trained_models.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/nodes.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/plugins.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/recovery.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/repositories.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/segments.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/shards.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/tasks.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/templates.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +2 -3
- data/lib/elasticsearch/api/actions/cat/transforms.rb +2 -3
- data/lib/elasticsearch/api/actions/clear_scroll.rb +2 -3
- data/lib/elasticsearch/api/actions/close_point_in_time.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/health.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/state.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/stats.rb +2 -3
- data/lib/elasticsearch/api/actions/count.rb +9 -5
- data/lib/elasticsearch/api/actions/create.rb +1 -7
- data/lib/elasticsearch/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb +2 -3
- data/lib/elasticsearch/api/actions/cross_cluster_replication/follow.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/follow_info.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/follow_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/forget_follower.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb +2 -3
- data/lib/elasticsearch/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb +2 -3
- data/lib/elasticsearch/api/actions/cross_cluster_replication/pause_follow.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb +2 -3
- data/lib/elasticsearch/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb +2 -3
- data/lib/elasticsearch/api/actions/cross_cluster_replication/resume_follow.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/stats.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/unfollow.rb +3 -4
- data/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +2 -3
- data/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +2 -3
- data/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb +3 -4
- data/lib/elasticsearch/api/actions/delete.rb +3 -16
- data/lib/elasticsearch/api/actions/delete_by_query.rb +3 -7
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +2 -3
- data/lib/elasticsearch/api/actions/delete_script.rb +2 -3
- data/lib/elasticsearch/api/actions/enrich/delete_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/enrich/execute_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/enrich/get_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/enrich/put_policy.rb +2 -3
- data/lib/elasticsearch/api/actions/enrich/stats.rb +3 -4
- data/lib/elasticsearch/api/actions/eql/delete.rb +2 -3
- data/lib/elasticsearch/api/actions/eql/get.rb +2 -3
- data/lib/elasticsearch/api/actions/eql/get_status.rb +2 -3
- data/lib/elasticsearch/api/actions/eql/search.rb +2 -2
- data/lib/elasticsearch/api/actions/exists.rb +2 -3
- data/lib/elasticsearch/api/actions/exists_source.rb +3 -16
- data/lib/elasticsearch/api/actions/explain.rb +2 -3
- data/lib/elasticsearch/api/actions/features/get_features.rb +3 -4
- data/lib/elasticsearch/api/actions/features/reset_features.rb +3 -4
- data/lib/elasticsearch/api/actions/field_caps.rb +3 -4
- data/lib/elasticsearch/api/actions/fleet/global_checkpoints.rb +3 -4
- data/lib/elasticsearch/api/actions/fleet/msearch.rb +82 -0
- data/lib/elasticsearch/api/actions/fleet/search.rb +65 -0
- data/lib/elasticsearch/api/actions/get.rb +2 -3
- data/lib/elasticsearch/api/actions/get_script.rb +2 -3
- data/lib/elasticsearch/api/actions/get_script_context.rb +3 -4
- data/lib/elasticsearch/api/actions/get_script_languages.rb +3 -4
- data/lib/elasticsearch/api/actions/get_source.rb +2 -3
- data/lib/elasticsearch/api/actions/graph/explore.rb +3 -4
- data/lib/elasticsearch/api/actions/index.rb +2 -3
- data/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/add_block.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/analyze.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/clone.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/close.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/create.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/create_data_stream.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/data_streams_stats.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/disk_usage.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/exists.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/field_usage_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/flush.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +4 -4
- data/lib/elasticsearch/api/actions/indices/get.rb +4 -4
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/get_data_stream.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/modify_data_stream.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/open.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/promote_data_stream.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/recovery.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/refresh.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/resolve_index.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/rollover.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/segments.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/shrink.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +2 -3
- data/lib/elasticsearch/api/actions/indices/split.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/stats.rb +2 -4
- data/lib/elasticsearch/api/actions/indices/unfreeze.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +4 -15
- data/lib/elasticsearch/api/actions/info.rb +3 -4
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +2 -3
- data/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +2 -3
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +3 -4
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +3 -3
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +2 -3
- data/lib/elasticsearch/api/actions/knn_search.rb +4 -5
- data/lib/elasticsearch/api/actions/license/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/license/get.rb +3 -4
- data/lib/elasticsearch/api/actions/license/get_basic_status.rb +3 -4
- data/lib/elasticsearch/api/actions/license/get_trial_status.rb +3 -4
- data/lib/elasticsearch/api/actions/license/post.rb +3 -4
- data/lib/elasticsearch/api/actions/license/post_start_basic.rb +3 -4
- data/lib/elasticsearch/api/actions/license/post_start_trial.rb +3 -4
- data/lib/elasticsearch/api/actions/logstash/delete_pipeline.rb +2 -3
- data/lib/elasticsearch/api/actions/logstash/get_pipeline.rb +2 -3
- data/lib/elasticsearch/api/actions/logstash/put_pipeline.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/close_job.rb +2 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_filter.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb +5 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/flush_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/forecast.rb +4 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_buckets.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_calendars.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_categories.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb +2 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb +2 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_filters.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_influencers.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb +2 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_jobs.rb +2 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb +55 -0
- data/lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb +2 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_records.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/infer_trained_model_deployment.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/info.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/open_job.rb +4 -4
- data/lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/post_data.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_calendar.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_filter.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/reset_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb +7 -5
- data/lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/update_filter.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/update_job.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb +2 -3
- data/lib/elasticsearch/api/actions/machine_learning/validate.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/validate_detector.rb +3 -4
- data/lib/elasticsearch/api/actions/mget.rb +3 -4
- data/lib/elasticsearch/api/actions/migration/deprecations.rb +3 -4
- data/lib/elasticsearch/api/actions/migration/get_feature_upgrade_status.rb +3 -4
- data/lib/elasticsearch/api/actions/migration/post_feature_upgrade.rb +3 -4
- data/lib/elasticsearch/api/actions/monitoring/bulk.rb +2 -3
- data/lib/elasticsearch/api/actions/msearch.rb +3 -4
- data/lib/elasticsearch/api/actions/msearch_template.rb +3 -4
- data/lib/elasticsearch/api/actions/mtermvectors.rb +2 -3
- data/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb +2 -3
- data/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb +2 -3
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -4
- data/lib/elasticsearch/api/actions/nodes/info.rb +3 -4
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +2 -3
- data/lib/elasticsearch/api/actions/nodes/stats.rb +3 -4
- data/lib/elasticsearch/api/actions/nodes/usage.rb +2 -3
- data/lib/elasticsearch/api/actions/open_point_in_time.rb +4 -5
- data/lib/elasticsearch/api/actions/ping.rb +3 -4
- data/lib/elasticsearch/api/actions/put_script.rb +2 -3
- data/lib/elasticsearch/api/actions/rank_eval.rb +3 -4
- data/lib/elasticsearch/api/actions/reindex.rb +3 -4
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +2 -3
- data/lib/elasticsearch/api/actions/render_search_template.rb +2 -3
- data/lib/elasticsearch/api/actions/rollup/delete_job.rb +2 -3
- data/lib/elasticsearch/api/actions/rollup/get_jobs.rb +2 -3
- data/lib/elasticsearch/api/actions/rollup/get_rollup_caps.rb +2 -3
- data/lib/elasticsearch/api/actions/rollup/get_rollup_index_caps.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/put_job.rb +2 -3
- data/lib/elasticsearch/api/actions/rollup/rollup.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/rollup_search.rb +4 -17
- data/lib/elasticsearch/api/actions/rollup/start_job.rb +2 -3
- data/lib/elasticsearch/api/actions/rollup/stop_job.rb +2 -3
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +3 -4
- data/lib/elasticsearch/api/actions/scroll.rb +2 -3
- data/lib/elasticsearch/api/actions/search.rb +2 -2
- data/lib/elasticsearch/api/actions/search_mvt.rb +4 -5
- data/lib/elasticsearch/api/actions/search_shards.rb +3 -4
- data/lib/elasticsearch/api/actions/search_template.rb +3 -4
- data/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb +2 -3
- data/lib/elasticsearch/api/actions/searchable_snapshots/clear_cache.rb +3 -4
- data/lib/elasticsearch/api/actions/searchable_snapshots/mount.rb +2 -3
- data/lib/elasticsearch/api/actions/searchable_snapshots/stats.rb +3 -4
- data/lib/elasticsearch/api/actions/security/authenticate.rb +3 -4
- data/lib/elasticsearch/api/actions/security/change_password.rb +2 -3
- data/lib/elasticsearch/api/actions/security/clear_api_key_cache.rb +3 -4
- data/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb +2 -3
- data/lib/elasticsearch/api/actions/security/clear_cached_realms.rb +2 -3
- data/lib/elasticsearch/api/actions/security/clear_cached_roles.rb +2 -3
- data/lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb +2 -3
- data/lib/elasticsearch/api/actions/security/create_api_key.rb +3 -4
- data/lib/elasticsearch/api/actions/security/create_service_token.rb +2 -3
- data/lib/elasticsearch/api/actions/security/delete_privileges.rb +2 -3
- data/lib/elasticsearch/api/actions/security/delete_role.rb +2 -3
- data/lib/elasticsearch/api/actions/security/delete_role_mapping.rb +2 -3
- data/lib/elasticsearch/api/actions/security/delete_service_token.rb +2 -3
- data/lib/elasticsearch/api/actions/security/delete_user.rb +2 -3
- data/lib/elasticsearch/api/actions/security/disable_user.rb +2 -3
- data/lib/elasticsearch/api/actions/security/enable_user.rb +2 -3
- data/lib/elasticsearch/api/actions/security/enroll_kibana.rb +3 -4
- data/lib/elasticsearch/api/actions/security/enroll_node.rb +3 -4
- data/lib/elasticsearch/api/actions/security/get_api_key.rb +3 -4
- data/lib/elasticsearch/api/actions/security/get_builtin_privileges.rb +3 -4
- data/lib/elasticsearch/api/actions/security/get_privileges.rb +2 -3
- data/lib/elasticsearch/api/actions/security/get_role.rb +2 -3
- data/lib/elasticsearch/api/actions/security/get_role_mapping.rb +2 -3
- data/lib/elasticsearch/api/actions/security/get_service_accounts.rb +2 -3
- data/lib/elasticsearch/api/actions/security/get_service_credentials.rb +2 -3
- data/lib/elasticsearch/api/actions/security/get_token.rb +3 -4
- data/lib/elasticsearch/api/actions/security/get_user.rb +2 -3
- data/lib/elasticsearch/api/actions/security/get_user_privileges.rb +3 -4
- data/lib/elasticsearch/api/actions/security/grant_api_key.rb +3 -4
- data/lib/elasticsearch/api/actions/security/has_privileges.rb +2 -3
- data/lib/elasticsearch/api/actions/security/invalidate_api_key.rb +3 -4
- data/lib/elasticsearch/api/actions/security/invalidate_token.rb +3 -4
- data/lib/elasticsearch/api/actions/security/oidc_authenticate.rb +48 -0
- data/lib/elasticsearch/api/actions/security/oidc_logout.rb +48 -0
- data/lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb +48 -0
- data/lib/elasticsearch/api/actions/security/put_privileges.rb +3 -4
- data/lib/elasticsearch/api/actions/security/put_role.rb +2 -3
- data/lib/elasticsearch/api/actions/security/put_role_mapping.rb +2 -3
- data/lib/elasticsearch/api/actions/security/put_user.rb +2 -3
- data/lib/elasticsearch/api/actions/security/query_api_keys.rb +3 -4
- data/lib/elasticsearch/api/actions/security/saml_authenticate.rb +3 -4
- data/lib/elasticsearch/api/actions/security/saml_complete_logout.rb +3 -4
- data/lib/elasticsearch/api/actions/security/saml_invalidate.rb +3 -4
- data/lib/elasticsearch/api/actions/security/saml_logout.rb +3 -4
- data/lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb +3 -4
- data/lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb +2 -3
- data/lib/elasticsearch/api/actions/shutdown/delete_node.rb +1 -2
- data/lib/elasticsearch/api/actions/shutdown/get_node.rb +1 -2
- data/lib/elasticsearch/api/actions/shutdown/put_node.rb +1 -2
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/clone.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/create.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/get.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/status.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb +3 -4
- data/lib/elasticsearch/api/actions/sql/clear_cursor.rb +3 -4
- data/lib/elasticsearch/api/actions/sql/delete_async.rb +2 -3
- data/lib/elasticsearch/api/actions/sql/get_async.rb +2 -3
- data/lib/elasticsearch/api/actions/sql/get_async_status.rb +2 -3
- data/lib/elasticsearch/api/actions/sql/query.rb +3 -4
- data/lib/elasticsearch/api/actions/sql/translate.rb +3 -4
- data/lib/elasticsearch/api/actions/ssl/certificates.rb +3 -4
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +2 -3
- data/lib/elasticsearch/api/actions/tasks/get.rb +2 -3
- data/lib/elasticsearch/api/actions/tasks/list.rb +3 -4
- data/lib/elasticsearch/api/actions/terms_enum.rb +3 -4
- data/lib/elasticsearch/api/actions/termvectors.rb +3 -4
- data/lib/elasticsearch/api/actions/text_structure/find_structure.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/delete_transform.rb +3 -3
- data/lib/elasticsearch/api/actions/transform/get_transform.rb +2 -3
- data/lib/elasticsearch/api/actions/transform/get_transform_stats.rb +2 -3
- data/lib/elasticsearch/api/actions/transform/preview_transform.rb +4 -4
- data/lib/elasticsearch/api/actions/transform/put_transform.rb +3 -3
- data/lib/elasticsearch/api/actions/transform/reset_transform.rb +52 -0
- data/lib/elasticsearch/api/actions/transform/start_transform.rb +2 -3
- data/lib/elasticsearch/api/actions/transform/stop_transform.rb +2 -3
- data/lib/elasticsearch/api/actions/transform/update_transform.rb +3 -3
- data/lib/elasticsearch/api/actions/transform/upgrade_transforms.rb +4 -4
- data/lib/elasticsearch/api/actions/update.rb +3 -16
- data/lib/elasticsearch/api/actions/update_by_query.rb +3 -7
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/ack_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/activate_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/deactivate_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/delete_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/execute_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/get_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/put_watch.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/query_watches.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/start.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/stats.rb +2 -3
- data/lib/elasticsearch/api/actions/watcher/stop.rb +3 -4
- data/lib/elasticsearch/api/actions/xpack/info.rb +3 -4
- data/lib/elasticsearch/api/actions/xpack/usage.rb +3 -4
- data/lib/elasticsearch/api/utils.rb +2 -3
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/bulk_spec.rb +10 -29
- data/spec/elasticsearch/api/actions/count_spec.rb +2 -5
- data/spec/elasticsearch/api/actions/delete_document_spec.rb +9 -9
- data/spec/elasticsearch/api/actions/fleet/msearch_spec.rb +44 -0
- data/spec/elasticsearch/api/actions/fleet/search_spec.rb +44 -0
- data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +0 -10
- data/spec/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats_spec.rb +56 -0
- data/spec/elasticsearch/api/actions/update_document_spec.rb +10 -10
- data/spec/elasticsearch/api/rest_api_yaml_spec.rb +8 -3
- data/spec/elasticsearch/api/utils_spec.rb +9 -21
- data/spec/skipped_tests_free.yml +8 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/unit_tests_platinum/unit/security/oidc_authenticate_test.rb +40 -0
- data/spec/unit_tests_platinum/unit/security/oidc_logout_test.rb +40 -0
- data/spec/unit_tests_platinum/unit/security/oidc_prepare_authentication_test.rb +40 -0
- data/spec/unit_tests_platinum/unit/transform/reset_transform_spec.rb +34 -0
- data/utils/README.md +5 -0
- data/utils/thor/generate_source.rb +20 -11
- data/utils/thor/generator/files_helper.rb +1 -1
- data/utils/thor/templates/_method_setup.erb +0 -1
- data/utils/thor/templates/method.erb +2 -0
- metadata +43 -8
@@ -28,7 +28,7 @@ describe Elasticsearch::API::Utils do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'encodes special characters' do
|
31
|
-
expect(utils.__escape('foo bar')).to eq('foo
|
31
|
+
expect(utils.__escape('foo bar')).to eq('foo%20bar')
|
32
32
|
expect(utils.__escape('foo/bar')).to eq('foo%2Fbar')
|
33
33
|
expect(utils.__escape('foo^bar')).to eq('foo%5Ebar')
|
34
34
|
end
|
@@ -36,18 +36,6 @@ describe Elasticsearch::API::Utils do
|
|
36
36
|
it 'does not encode asterisks' do
|
37
37
|
expect(utils.__escape('*')).to eq('*')
|
38
38
|
end
|
39
|
-
|
40
|
-
it 'users CGI.escape by default' do
|
41
|
-
expect(CGI).to receive(:escape).and_call_original
|
42
|
-
expect(utils.__escape('foo bar')).to eq('foo+bar')
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'uses the escape_utils gem when available', unless: defined?(JRUBY_VERSION) do
|
46
|
-
require 'escape_utils'
|
47
|
-
expect(CGI).not_to receive(:escape)
|
48
|
-
expect(EscapeUtils).to receive(:escape_url).and_call_original
|
49
|
-
expect(utils.__escape('foo bar')).to eq('foo+bar')
|
50
|
-
end
|
51
39
|
end
|
52
40
|
|
53
41
|
describe '#__listify' do
|
@@ -73,7 +61,7 @@ describe Elasticsearch::API::Utils do
|
|
73
61
|
|
74
62
|
context 'when the escape option is set to false' do
|
75
63
|
it 'does not escape the characters' do
|
76
|
-
expect(utils.__listify(['foo', 'bar^bam'], :
|
64
|
+
expect(utils.__listify(['foo', 'bar^bam'], escape: false)).to eq('foo,bar^bam')
|
77
65
|
end
|
78
66
|
end
|
79
67
|
end
|
@@ -100,19 +88,19 @@ describe Elasticsearch::API::Utils do
|
|
100
88
|
context 'when the input is an array of hashes' do
|
101
89
|
let(:result) do
|
102
90
|
utils.__bulkify [
|
103
|
-
{ :
|
104
|
-
{ :
|
105
|
-
{ :
|
91
|
+
{ index: { _index: 'myindexA', _id: '1', data: { title: 'Test' } } },
|
92
|
+
{ update: { _index: 'myindexB', _id: '2', data: { doc: { title: 'Update' } } } },
|
93
|
+
{ delete: { _index: 'myindexC', _id: '3' } }
|
106
94
|
]
|
107
95
|
end
|
108
96
|
|
109
97
|
let(:expected_string) do
|
110
98
|
<<-PAYLOAD.gsub(/^\s+/, '')
|
111
|
-
{"index":{"_index":"myindexA","
|
99
|
+
{"index":{"_index":"myindexA","_id":"1"}}
|
112
100
|
{"title":"Test"}
|
113
|
-
{"update":{"_index":"myindexB","
|
101
|
+
{"update":{"_index":"myindexB","_id":"2"}}
|
114
102
|
{"doc":{"title":"Update"}}
|
115
|
-
{"delete":{"_index":"myindexC","
|
103
|
+
{"delete":{"_index":"myindexC","_id":"3"}}
|
116
104
|
PAYLOAD
|
117
105
|
end
|
118
106
|
|
@@ -316,7 +304,7 @@ describe Elasticsearch::API::Utils do
|
|
316
304
|
end
|
317
305
|
|
318
306
|
let(:unsupported_params) do
|
319
|
-
[ { :
|
307
|
+
[ { foo: { explanation: 'NOT_SUPPORTED'} }, :moo ]
|
320
308
|
end
|
321
309
|
|
322
310
|
|
data/spec/skipped_tests_free.yml
CHANGED
@@ -22,3 +22,11 @@
|
|
22
22
|
-
|
23
23
|
:file: 'indices.get_alias/10_basic.yml'
|
24
24
|
:description: 'Get alias against closed indices'
|
25
|
+
|
26
|
+
# https://github.com/elastic/elasticsearch-ruby/issues/1563
|
27
|
+
-
|
28
|
+
:file: 'tsdb/80_index_resize.yml'
|
29
|
+
:description: 'shrink'
|
30
|
+
-
|
31
|
+
:file: 'tsdb/80_index_resize.yml'
|
32
|
+
:description: 'clone'
|
data/spec/spec_helper.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
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
|
+
require 'test_helper'
|
19
|
+
|
20
|
+
module Elasticsearch
|
21
|
+
module Test
|
22
|
+
class SecurityOidcAuthenticateTest < Minitest::Test
|
23
|
+
context 'Security: OIDC Authenticate' do
|
24
|
+
subject { FakeClient.new }
|
25
|
+
|
26
|
+
should 'perform correct request' do
|
27
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
28
|
+
assert_equal('POST', method)
|
29
|
+
assert_equal('_security/oidc/authenticate', url)
|
30
|
+
assert_equal({}, params)
|
31
|
+
assert_equal(body, {})
|
32
|
+
true
|
33
|
+
end.returns(FakeResponse.new)
|
34
|
+
|
35
|
+
subject.security.oidc_authenticate(body: {})
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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
|
+
require 'test_helper'
|
19
|
+
|
20
|
+
module Elasticsearch
|
21
|
+
module Test
|
22
|
+
class SecurityOidcLogoutTest < Minitest::Test
|
23
|
+
context 'Security: OIDC Logout' do
|
24
|
+
subject { FakeClient.new }
|
25
|
+
|
26
|
+
should 'perform correct request' do
|
27
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
28
|
+
assert_equal('POST', method)
|
29
|
+
assert_equal('_security/oidc/logout', url)
|
30
|
+
assert_equal({}, params)
|
31
|
+
assert_equal(body, {})
|
32
|
+
true
|
33
|
+
end.returns(FakeResponse.new)
|
34
|
+
|
35
|
+
subject.security.oidc_logout(body: {})
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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
|
+
require 'test_helper'
|
19
|
+
|
20
|
+
module Elasticsearch
|
21
|
+
module Test
|
22
|
+
class SecurityOidcPrepareAuthenticationTest < Minitest::Test
|
23
|
+
context 'Security: OIDC Prepare_Authentication' do
|
24
|
+
subject { FakeClient.new }
|
25
|
+
|
26
|
+
should 'perform correct request' do
|
27
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
28
|
+
assert_equal('POST', method)
|
29
|
+
assert_equal('_security/oidc/prepare', url)
|
30
|
+
assert_equal({}, params)
|
31
|
+
assert_equal(body, {})
|
32
|
+
true
|
33
|
+
end.returns(FakeResponse.new)
|
34
|
+
|
35
|
+
subject.security.oidc_prepare_authentication(body: {})
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client.transform#reset_transform' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'POST',
|
24
|
+
'_transform/1/_reset',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{}
|
28
|
+
]
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'performs the request' do
|
32
|
+
expect(client_double.transform.reset_transform(transform_id: 1)).to be_a Elasticsearch::API::Response
|
33
|
+
end
|
34
|
+
end
|
data/utils/README.md
CHANGED
@@ -18,6 +18,11 @@ $ thor code:generate
|
|
18
18
|
|
19
19
|
- The Ruby code will be generated in `elasticsearch-api/lib/elasticsearch/api/actions`.
|
20
20
|
- The generator runs Rubocop to autolint and clean up the generated files.
|
21
|
+
- You can use the environment variable `IGNORE_VERSION` to ignore the current version of the client when generating the source code documentation urls. This is currently used when generating code from `main`:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ IGNORE_VERSION=true thor code:generate
|
25
|
+
```
|
21
26
|
|
22
27
|
### Development
|
23
28
|
|
@@ -74,6 +74,10 @@ module Elasticsearch
|
|
74
74
|
@full_namespace = __full_namespace
|
75
75
|
@namespace_depth = @full_namespace.size > 0 ? @full_namespace.size - 1 : 0
|
76
76
|
@module_namespace = @full_namespace[0, @namespace_depth]
|
77
|
+
|
78
|
+
# Don't generate code for internal APIs:
|
79
|
+
next if @module_namespace.flatten.first == '_internal'
|
80
|
+
|
77
81
|
@method_name = @full_namespace.last
|
78
82
|
@parts = __endpoint_parts
|
79
83
|
@params = @spec['params'] || {}
|
@@ -136,6 +140,7 @@ module Elasticsearch
|
|
136
140
|
|
137
141
|
def __http_method
|
138
142
|
return '_id ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @endpoint_name == 'index'
|
143
|
+
return post_and_get if @endpoint_name == 'count'
|
139
144
|
|
140
145
|
default_method = @spec['url']['paths'].map { |a| a['methods'] }.flatten.first
|
141
146
|
if @spec['body'] && default_method == 'GET'
|
@@ -143,20 +148,24 @@ module Elasticsearch
|
|
143
148
|
if @spec['body']['required']
|
144
149
|
'Elasticsearch::API::HTTP_POST'
|
145
150
|
else
|
146
|
-
|
147
|
-
<<~SRC
|
148
|
-
if body
|
149
|
-
Elasticsearch::API::HTTP_POST
|
150
|
-
else
|
151
|
-
Elasticsearch::API::HTTP_GET
|
152
|
-
end
|
153
|
-
SRC
|
151
|
+
post_and_get
|
154
152
|
end
|
155
153
|
else
|
156
154
|
"Elasticsearch::API::HTTP_#{default_method}"
|
157
155
|
end
|
158
156
|
end
|
159
157
|
|
158
|
+
def post_and_get
|
159
|
+
# the METHOD is defined after doing arguments.delete(:body), so we need to check for `body`
|
160
|
+
<<~SRC
|
161
|
+
if body
|
162
|
+
Elasticsearch::API::HTTP_POST
|
163
|
+
else
|
164
|
+
Elasticsearch::API::HTTP_GET
|
165
|
+
end
|
166
|
+
SRC
|
167
|
+
end
|
168
|
+
|
160
169
|
def __http_path
|
161
170
|
return "\"#{__parse_path(@paths.first)}\"" if @paths.size == 1
|
162
171
|
|
@@ -182,9 +191,9 @@ module Elasticsearch
|
|
182
191
|
|
183
192
|
def __parse_path(path)
|
184
193
|
path.gsub(/^\//, '')
|
185
|
-
|
186
|
-
|
187
|
-
|
194
|
+
.gsub(/\/$/, '')
|
195
|
+
.gsub('{', "\#{Utils.__listify(_")
|
196
|
+
.gsub('}', ')}')
|
188
197
|
end
|
189
198
|
|
190
199
|
def __path_variables
|
@@ -49,7 +49,7 @@ module Elasticsearch
|
|
49
49
|
regex = /([0-9]{1,2}\.[0-9x]{1,2})/
|
50
50
|
version = Elasticsearch::API::VERSION.match(regex)[0]
|
51
51
|
# TODO - How do we fix this so it doesn't depend on which branch we're running from
|
52
|
-
if
|
52
|
+
if ENV['IGNORE_VERSION']
|
53
53
|
documentation_url
|
54
54
|
else
|
55
55
|
documentation_url.gsub(/\/(current|master|main)\//, "/#{version}/")
|
@@ -16,7 +16,6 @@
|
|
16
16
|
# specific language governing permissions and limitations
|
17
17
|
# under the License.
|
18
18
|
%>
|
19
|
-
<%= ' '*(@namespace_depth+4) %>arguments = arguments.clone
|
20
19
|
<%- if @method_name == 'search' -%>
|
21
20
|
arguments[:index] = UNDERSCORE_ALL if ! arguments[:index] && arguments[:type]
|
22
21
|
<%- end -%>
|
@@ -33,12 +33,14 @@ module Elasticsearch
|
|
33
33
|
<%= ' '*(@namespace_depth+2) %>end
|
34
34
|
<%- else -%>
|
35
35
|
<%- if @method_name == 'get_field_mapping' %>
|
36
|
+
arguments = arguments.clone
|
36
37
|
_fields = arguments.delete(:field) || arguments.delete(:fields)
|
37
38
|
raise ArgumentError, "Required argument 'field' missing" unless _fields
|
38
39
|
<%- else -%>
|
39
40
|
<%- @required_parts.each do |required| %><%# Arguments -%>
|
40
41
|
<%= ' '*(@namespace_depth+3) + "raise ArgumentError, \"Required argument '#{required}' missing\" unless arguments[:#{required}]" + "\n" -%>
|
41
42
|
<%- end -%>
|
43
|
+
arguments = arguments.clone
|
42
44
|
<%- end -%>
|
43
45
|
headers = arguments.delete(:headers) || {}
|
44
46
|
<%- #Body %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -193,7 +193,7 @@ dependencies:
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
196
|
+
name: activesupport
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - ">="
|
@@ -207,7 +207,7 @@ dependencies:
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
210
|
+
name: jbuilder
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
213
|
- - ">="
|
@@ -221,7 +221,21 @@ dependencies:
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
224
|
+
name: cane
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: escape_utils
|
225
239
|
requirement: !ruby/object:Gem::Requirement
|
226
240
|
requirements:
|
227
241
|
- - ">="
|
@@ -414,6 +428,8 @@ files:
|
|
414
428
|
- lib/elasticsearch/api/actions/features/reset_features.rb
|
415
429
|
- lib/elasticsearch/api/actions/field_caps.rb
|
416
430
|
- lib/elasticsearch/api/actions/fleet/global_checkpoints.rb
|
431
|
+
- lib/elasticsearch/api/actions/fleet/msearch.rb
|
432
|
+
- lib/elasticsearch/api/actions/fleet/search.rb
|
417
433
|
- lib/elasticsearch/api/actions/get.rb
|
418
434
|
- lib/elasticsearch/api/actions/get_script.rb
|
419
435
|
- lib/elasticsearch/api/actions/get_script_context.rb
|
@@ -534,6 +550,7 @@ files:
|
|
534
550
|
- lib/elasticsearch/api/actions/machine_learning/get_influencers.rb
|
535
551
|
- lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb
|
536
552
|
- lib/elasticsearch/api/actions/machine_learning/get_jobs.rb
|
553
|
+
- lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb
|
537
554
|
- lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb
|
538
555
|
- lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb
|
539
556
|
- lib/elasticsearch/api/actions/machine_learning/get_records.rb
|
@@ -647,6 +664,9 @@ files:
|
|
647
664
|
- lib/elasticsearch/api/actions/security/has_privileges.rb
|
648
665
|
- lib/elasticsearch/api/actions/security/invalidate_api_key.rb
|
649
666
|
- lib/elasticsearch/api/actions/security/invalidate_token.rb
|
667
|
+
- lib/elasticsearch/api/actions/security/oidc_authenticate.rb
|
668
|
+
- lib/elasticsearch/api/actions/security/oidc_logout.rb
|
669
|
+
- lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb
|
650
670
|
- lib/elasticsearch/api/actions/security/put_privileges.rb
|
651
671
|
- lib/elasticsearch/api/actions/security/put_role.rb
|
652
672
|
- lib/elasticsearch/api/actions/security/put_role_mapping.rb
|
@@ -700,6 +720,7 @@ files:
|
|
700
720
|
- lib/elasticsearch/api/actions/transform/get_transform_stats.rb
|
701
721
|
- lib/elasticsearch/api/actions/transform/preview_transform.rb
|
702
722
|
- lib/elasticsearch/api/actions/transform/put_transform.rb
|
723
|
+
- lib/elasticsearch/api/actions/transform/reset_transform.rb
|
703
724
|
- lib/elasticsearch/api/actions/transform/start_transform.rb
|
704
725
|
- lib/elasticsearch/api/actions/transform/stop_transform.rb
|
705
726
|
- lib/elasticsearch/api/actions/transform/update_transform.rb
|
@@ -806,6 +827,8 @@ files:
|
|
806
827
|
- spec/elasticsearch/api/actions/features/reset_features_spec.rb
|
807
828
|
- spec/elasticsearch/api/actions/field_caps_spec.rb
|
808
829
|
- spec/elasticsearch/api/actions/fleet/global_checkpoints_spec.rb
|
830
|
+
- spec/elasticsearch/api/actions/fleet/msearch_spec.rb
|
831
|
+
- spec/elasticsearch/api/actions/fleet/search_spec.rb
|
809
832
|
- spec/elasticsearch/api/actions/get_document_source_spec.rb
|
810
833
|
- spec/elasticsearch/api/actions/get_document_spec.rb
|
811
834
|
- spec/elasticsearch/api/actions/get_script_spec.rb
|
@@ -858,6 +881,7 @@ files:
|
|
858
881
|
- spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb
|
859
882
|
- spec/elasticsearch/api/actions/ingest/simulate_spec.rb
|
860
883
|
- spec/elasticsearch/api/actions/json_builders_spec.rb
|
884
|
+
- spec/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats_spec.rb
|
861
885
|
- spec/elasticsearch/api/actions/machine_learning/get_trained_model_deployment_stats_spec.rb
|
862
886
|
- spec/elasticsearch/api/actions/machine_learning/infer_trained_model_deployment_spec.rb
|
863
887
|
- spec/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part_spec.rb
|
@@ -1045,12 +1069,16 @@ files:
|
|
1045
1069
|
- spec/unit_tests_platinum/unit/security/grant_api_key_test.rb
|
1046
1070
|
- spec/unit_tests_platinum/unit/security/has_privileges_test.rb
|
1047
1071
|
- spec/unit_tests_platinum/unit/security/invalidate_token_test.rb
|
1072
|
+
- spec/unit_tests_platinum/unit/security/oidc_authenticate_test.rb
|
1073
|
+
- spec/unit_tests_platinum/unit/security/oidc_logout_test.rb
|
1074
|
+
- spec/unit_tests_platinum/unit/security/oidc_prepare_authentication_test.rb
|
1048
1075
|
- spec/unit_tests_platinum/unit/security/put_privileges_test.rb
|
1049
1076
|
- spec/unit_tests_platinum/unit/security/put_role_mapping_test.rb
|
1050
1077
|
- spec/unit_tests_platinum/unit/security/put_role_test.rb
|
1051
1078
|
- spec/unit_tests_platinum/unit/security/put_user_test.rb
|
1052
1079
|
- spec/unit_tests_platinum/unit/ssl/certificates_test.rb
|
1053
1080
|
- spec/unit_tests_platinum/unit/text_structure/find_structure_test.rb
|
1081
|
+
- spec/unit_tests_platinum/unit/transform/reset_transform_spec.rb
|
1054
1082
|
- spec/unit_tests_platinum/unit/transform/upgrade_transforms_spec.rb
|
1055
1083
|
- spec/unit_tests_platinum/unit/usage_test.rb
|
1056
1084
|
- spec/unit_tests_platinum/unit/watcher/ack_watch_test.rb
|
@@ -1099,11 +1127,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1099
1127
|
version: '2.5'
|
1100
1128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1101
1129
|
requirements:
|
1102
|
-
- - "
|
1130
|
+
- - ">="
|
1103
1131
|
- !ruby/object:Gem::Version
|
1104
|
-
version:
|
1132
|
+
version: '0'
|
1105
1133
|
requirements: []
|
1106
|
-
rubygems_version: 3.
|
1134
|
+
rubygems_version: 3.3.3
|
1107
1135
|
signing_key:
|
1108
1136
|
specification_version: 4
|
1109
1137
|
summary: Ruby API for Elasticsearch.
|
@@ -1155,6 +1183,8 @@ test_files:
|
|
1155
1183
|
- spec/elasticsearch/api/actions/features/reset_features_spec.rb
|
1156
1184
|
- spec/elasticsearch/api/actions/field_caps_spec.rb
|
1157
1185
|
- spec/elasticsearch/api/actions/fleet/global_checkpoints_spec.rb
|
1186
|
+
- spec/elasticsearch/api/actions/fleet/msearch_spec.rb
|
1187
|
+
- spec/elasticsearch/api/actions/fleet/search_spec.rb
|
1158
1188
|
- spec/elasticsearch/api/actions/get_document_source_spec.rb
|
1159
1189
|
- spec/elasticsearch/api/actions/get_document_spec.rb
|
1160
1190
|
- spec/elasticsearch/api/actions/get_script_spec.rb
|
@@ -1207,6 +1237,7 @@ test_files:
|
|
1207
1237
|
- spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb
|
1208
1238
|
- spec/elasticsearch/api/actions/ingest/simulate_spec.rb
|
1209
1239
|
- spec/elasticsearch/api/actions/json_builders_spec.rb
|
1240
|
+
- spec/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats_spec.rb
|
1210
1241
|
- spec/elasticsearch/api/actions/machine_learning/get_trained_model_deployment_stats_spec.rb
|
1211
1242
|
- spec/elasticsearch/api/actions/machine_learning/infer_trained_model_deployment_spec.rb
|
1212
1243
|
- spec/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part_spec.rb
|
@@ -1394,12 +1425,16 @@ test_files:
|
|
1394
1425
|
- spec/unit_tests_platinum/unit/security/grant_api_key_test.rb
|
1395
1426
|
- spec/unit_tests_platinum/unit/security/has_privileges_test.rb
|
1396
1427
|
- spec/unit_tests_platinum/unit/security/invalidate_token_test.rb
|
1428
|
+
- spec/unit_tests_platinum/unit/security/oidc_authenticate_test.rb
|
1429
|
+
- spec/unit_tests_platinum/unit/security/oidc_logout_test.rb
|
1430
|
+
- spec/unit_tests_platinum/unit/security/oidc_prepare_authentication_test.rb
|
1397
1431
|
- spec/unit_tests_platinum/unit/security/put_privileges_test.rb
|
1398
1432
|
- spec/unit_tests_platinum/unit/security/put_role_mapping_test.rb
|
1399
1433
|
- spec/unit_tests_platinum/unit/security/put_role_test.rb
|
1400
1434
|
- spec/unit_tests_platinum/unit/security/put_user_test.rb
|
1401
1435
|
- spec/unit_tests_platinum/unit/ssl/certificates_test.rb
|
1402
1436
|
- spec/unit_tests_platinum/unit/text_structure/find_structure_test.rb
|
1437
|
+
- spec/unit_tests_platinum/unit/transform/reset_transform_spec.rb
|
1403
1438
|
- spec/unit_tests_platinum/unit/transform/upgrade_transforms_spec.rb
|
1404
1439
|
- spec/unit_tests_platinum/unit/usage_test.rb
|
1405
1440
|
- spec/unit_tests_platinum/unit/watcher/ack_watch_test.rb
|