elasticsearch-api 8.12.2 → 8.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Rakefile +5 -3
- data/api-spec-testing/test_file/task_group.rb +1 -0
- data/api-spec-testing/test_file/test.rb +1 -1
- data/api-spec-testing/wipe_cluster.rb +5 -3
- data/lib/elasticsearch/api/actions/async_search/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/async_search/get.rb +3 -4
- data/lib/elasticsearch/api/actions/async_search/status.rb +5 -5
- data/lib/elasticsearch/api/actions/async_search/submit.rb +4 -5
- data/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb +3 -3
- data/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/bulk.rb +11 -11
- data/lib/elasticsearch/api/actions/cat/aliases.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/allocation.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/component_templates.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/count.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/health.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/help.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/indices.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/master.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/ml_data_frame_analytics.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/ml_datafeeds.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/ml_jobs.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/ml_trained_models.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/nodes.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/plugins.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/recovery.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/repositories.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/segments.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/shards.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/tasks.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/templates.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/transforms.rb +4 -5
- data/lib/elasticsearch/api/actions/clear_scroll.rb +6 -7
- data/lib/elasticsearch/api/actions/close_point_in_time.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +4 -5
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +4 -5
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/health.rb +4 -5
- data/lib/elasticsearch/api/actions/cluster/info.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +3 -4
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/state.rb +4 -5
- data/lib/elasticsearch/api/actions/cluster/stats.rb +4 -5
- data/lib/elasticsearch/api/actions/connector/check_in.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/delete.rb +5 -5
- data/lib/elasticsearch/api/actions/connector/get.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/last_sync.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/list.rb +8 -4
- data/lib/elasticsearch/api/actions/connector/post.rb +3 -3
- data/lib/elasticsearch/api/actions/connector/put.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/secret_delete.rb +64 -0
- data/lib/elasticsearch/api/actions/connector/secret_get.rb +64 -0
- data/lib/elasticsearch/api/actions/connector/secret_post.rb +57 -0
- data/lib/elasticsearch/api/actions/connector/secret_put.rb +66 -0
- data/lib/elasticsearch/api/actions/{connector_sync_job/cancel.rb → connector/sync_job_cancel.rb} +9 -8
- data/lib/elasticsearch/api/actions/{connector_sync_job/check_in.rb → connector/sync_job_check_in.rb} +9 -8
- data/lib/elasticsearch/api/actions/{connector_sync_job/delete.rb → connector/sync_job_delete.rb} +9 -8
- data/lib/elasticsearch/api/actions/{connector_sync_job/error.rb → connector/sync_job_error.rb} +9 -8
- data/lib/elasticsearch/api/actions/{connector_sync_job/get.rb → connector/sync_job_get.rb} +9 -8
- data/lib/elasticsearch/api/actions/{connector_sync_job/list.rb → connector/sync_job_list.rb} +6 -5
- data/lib/elasticsearch/api/actions/{connector_sync_job/post.rb → connector/sync_job_post.rb} +5 -5
- data/lib/elasticsearch/api/actions/{connector_sync_job/update_stats.rb → connector/sync_job_update_stats.rb} +9 -8
- data/lib/elasticsearch/api/actions/connector/update_active_filtering.rb +64 -0
- data/lib/elasticsearch/api/actions/connector/update_api_key_id.rb +66 -0
- data/lib/elasticsearch/api/actions/connector/update_configuration.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/update_error.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/update_filtering.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/update_filtering_validation.rb +66 -0
- data/lib/elasticsearch/api/actions/connector/update_index_name.rb +66 -0
- data/lib/elasticsearch/api/actions/connector/update_name.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/update_native.rb +66 -0
- data/lib/elasticsearch/api/actions/connector/update_pipeline.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/update_scheduling.rb +3 -4
- data/lib/elasticsearch/api/actions/connector/update_service_type.rb +66 -0
- data/lib/elasticsearch/api/actions/connector/update_status.rb +66 -0
- data/lib/elasticsearch/api/actions/count.rb +9 -10
- data/lib/elasticsearch/api/actions/create.rb +3 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/follow.rb +4 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/follow_info.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/follow_stats.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/forget_follower.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb +6 -6
- data/lib/elasticsearch/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/pause_follow.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/resume_follow.rb +5 -5
- data/lib/elasticsearch/api/actions/cross_cluster_replication/stats.rb +6 -4
- data/lib/elasticsearch/api/actions/cross_cluster_replication/unfollow.rb +5 -5
- data/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +3 -4
- data/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +3 -4
- data/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb +3 -3
- data/lib/elasticsearch/api/actions/delete.rb +5 -6
- data/lib/elasticsearch/api/actions/delete_by_query.rb +3 -4
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +3 -4
- data/lib/elasticsearch/api/actions/delete_script.rb +3 -4
- data/lib/elasticsearch/api/actions/enrich/delete_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/enrich/execute_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/enrich/get_policy.rb +4 -5
- data/lib/elasticsearch/api/actions/enrich/put_policy.rb +3 -4
- data/lib/elasticsearch/api/actions/enrich/stats.rb +3 -3
- data/lib/elasticsearch/api/actions/eql/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/eql/get.rb +3 -4
- data/lib/elasticsearch/api/actions/eql/get_status.rb +3 -4
- data/lib/elasticsearch/api/actions/eql/search.rb +3 -4
- data/lib/elasticsearch/api/actions/esql/async_query.rb +56 -0
- data/lib/elasticsearch/api/actions/esql/async_query_get.rb +63 -0
- data/lib/elasticsearch/api/actions/esql/query.rb +5 -8
- data/lib/elasticsearch/api/actions/exists.rb +5 -6
- data/lib/elasticsearch/api/actions/exists_source.rb +4 -5
- data/lib/elasticsearch/api/actions/explain.rb +4 -5
- data/lib/elasticsearch/api/actions/features/get_features.rb +3 -3
- data/lib/elasticsearch/api/actions/features/reset_features.rb +3 -3
- data/lib/elasticsearch/api/actions/field_caps.rb +10 -10
- data/lib/elasticsearch/api/actions/fleet/delete_secret.rb +2 -3
- data/lib/elasticsearch/api/actions/fleet/get_secret.rb +2 -3
- data/lib/elasticsearch/api/actions/fleet/global_checkpoints.rb +3 -4
- data/lib/elasticsearch/api/actions/fleet/msearch.rb +9 -12
- data/lib/elasticsearch/api/actions/fleet/post_secret.rb +2 -2
- data/lib/elasticsearch/api/actions/fleet/search.rb +4 -5
- data/lib/elasticsearch/api/actions/get.rb +5 -6
- data/lib/elasticsearch/api/actions/get_script.rb +3 -4
- data/lib/elasticsearch/api/actions/get_script_context.rb +3 -3
- data/lib/elasticsearch/api/actions/get_script_languages.rb +3 -3
- data/lib/elasticsearch/api/actions/get_source.rb +3 -4
- data/lib/elasticsearch/api/actions/graph/explore.rb +5 -6
- data/lib/elasticsearch/api/actions/health_report.rb +4 -5
- data/lib/elasticsearch/api/actions/index.rb +4 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb +4 -5
- data/lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb +3 -3
- data/lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb +3 -3
- 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 +3 -4
- 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 -3
- data/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/add_block.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/analyze.rb +9 -10
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +4 -5
- 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 +3 -4
- data/lib/elasticsearch/api/actions/indices/data_streams_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/delete.rb +5 -6
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +4 -7
- data/lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +5 -6
- data/lib/elasticsearch/api/actions/indices/disk_usage.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/downsample.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/exists.rb +5 -6
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +5 -6
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +5 -6
- data/lib/elasticsearch/api/actions/indices/explain_data_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/field_usage_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/flush.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/get.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_data_stream.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/get_template.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/modify_data_stream.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/open.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/promote_data_stream.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +4 -7
- data/lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/put_template.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/recovery.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/refresh.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/resolve_cluster.rb +64 -0
- data/lib/elasticsearch/api/actions/indices/resolve_index.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/rollover.rb +5 -4
- data/lib/elasticsearch/api/actions/indices/segments.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/shrink.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/split.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/stats.rb +4 -5
- data/lib/elasticsearch/api/actions/indices/unfreeze.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +9 -10
- data/lib/elasticsearch/api/actions/inference/delete_model.rb +13 -11
- data/lib/elasticsearch/api/actions/inference/get_model.rb +14 -12
- data/lib/elasticsearch/api/actions/inference/inference.rb +13 -11
- data/lib/elasticsearch/api/actions/inference/put_model.rb +13 -11
- data/lib/elasticsearch/api/actions/info.rb +3 -3
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +3 -4
- data/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb +3 -3
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +4 -5
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +3 -3
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +3 -4
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +4 -5
- data/lib/elasticsearch/api/actions/knn_search.rb +5 -6
- data/lib/elasticsearch/api/actions/license/delete.rb +3 -3
- data/lib/elasticsearch/api/actions/license/get.rb +3 -3
- data/lib/elasticsearch/api/actions/license/get_basic_status.rb +3 -3
- data/lib/elasticsearch/api/actions/license/get_trial_status.rb +3 -3
- data/lib/elasticsearch/api/actions/license/post.rb +3 -3
- data/lib/elasticsearch/api/actions/license/post_start_basic.rb +3 -3
- data/lib/elasticsearch/api/actions/license/post_start_trial.rb +3 -3
- data/lib/elasticsearch/api/actions/logstash/delete_pipeline.rb +3 -4
- data/lib/elasticsearch/api/actions/logstash/get_pipeline.rb +4 -5
- data/lib/elasticsearch/api/actions/logstash/put_pipeline.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/close_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/delete_filter.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb +3 -3
- data/lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb +3 -3
- data/lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/flush_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/forecast.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_buckets.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_calendars.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/get_categories.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_filters.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_influencers.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_jobs.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_records.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb +4 -7
- data/lib/elasticsearch/api/actions/machine_learning/info.rb +3 -3
- data/lib/elasticsearch/api/actions/machine_learning/open_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/post_data.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb +8 -9
- data/lib/elasticsearch/api/actions/machine_learning/put_calendar.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_filter.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/reset_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb +3 -3
- data/lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/update_filter.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/update_job.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb +3 -4
- data/lib/elasticsearch/api/actions/machine_learning/validate.rb +3 -3
- data/lib/elasticsearch/api/actions/machine_learning/validate_detector.rb +3 -3
- data/lib/elasticsearch/api/actions/mget.rb +4 -5
- data/lib/elasticsearch/api/actions/migration/deprecations.rb +4 -5
- data/lib/elasticsearch/api/actions/migration/get_feature_upgrade_status.rb +3 -3
- data/lib/elasticsearch/api/actions/migration/post_feature_upgrade.rb +3 -3
- data/lib/elasticsearch/api/actions/monitoring/bulk.rb +10 -11
- data/lib/elasticsearch/api/actions/msearch.rb +10 -13
- data/lib/elasticsearch/api/actions/msearch_template.rb +8 -11
- data/lib/elasticsearch/api/actions/mtermvectors.rb +9 -10
- data/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb +4 -7
- data/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb +3 -4
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -5
- data/lib/elasticsearch/api/actions/nodes/info.rb +4 -5
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +4 -5
- data/lib/elasticsearch/api/actions/nodes/stats.rb +4 -5
- data/lib/elasticsearch/api/actions/nodes/usage.rb +4 -5
- data/lib/elasticsearch/api/actions/open_point_in_time.rb +3 -4
- data/lib/elasticsearch/api/actions/ping.rb +7 -9
- data/lib/elasticsearch/api/actions/profiling/flamegraph.rb +53 -0
- data/lib/elasticsearch/api/actions/profiling/stacktraces.rb +53 -0
- data/lib/elasticsearch/api/actions/profiling/status.rb +3 -3
- data/lib/elasticsearch/api/actions/profiling/topn_functions.rb +53 -0
- data/lib/elasticsearch/api/actions/put_script.rb +3 -4
- data/lib/elasticsearch/api/actions/query_ruleset/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/query_ruleset/get.rb +3 -4
- data/lib/elasticsearch/api/actions/query_ruleset/list.rb +3 -3
- data/lib/elasticsearch/api/actions/query_ruleset/put.rb +3 -4
- data/lib/elasticsearch/api/actions/rank_eval.rb +4 -5
- data/lib/elasticsearch/api/actions/reindex.rb +3 -3
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +3 -4
- data/lib/elasticsearch/api/actions/render_search_template.rb +8 -9
- data/lib/elasticsearch/api/actions/rollup/delete_job.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/get_jobs.rb +4 -5
- data/lib/elasticsearch/api/actions/rollup/get_rollup_caps.rb +4 -5
- data/lib/elasticsearch/api/actions/rollup/get_rollup_index_caps.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/put_job.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/rollup_search.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/start_job.rb +3 -4
- data/lib/elasticsearch/api/actions/rollup/stop_job.rb +3 -4
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +3 -3
- data/lib/elasticsearch/api/actions/scroll.rb +8 -9
- data/lib/elasticsearch/api/actions/search.rb +9 -10
- data/lib/elasticsearch/api/actions/search_application/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/search_application/get.rb +3 -4
- data/lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb +4 -5
- data/lib/elasticsearch/api/actions/search_application/list.rb +3 -3
- data/lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb +2 -3
- data/lib/elasticsearch/api/actions/search_application/put.rb +3 -4
- data/lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb +3 -4
- data/lib/elasticsearch/api/actions/search_application/render_query.rb +3 -4
- data/lib/elasticsearch/api/actions/search_application/search.rb +6 -6
- data/lib/elasticsearch/api/actions/search_mvt.rb +3 -4
- data/lib/elasticsearch/api/actions/search_shards.rb +4 -5
- data/lib/elasticsearch/api/actions/search_template.rb +4 -5
- data/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb +4 -5
- data/lib/elasticsearch/api/actions/searchable_snapshots/clear_cache.rb +4 -5
- data/lib/elasticsearch/api/actions/searchable_snapshots/mount.rb +3 -4
- data/lib/elasticsearch/api/actions/searchable_snapshots/stats.rb +4 -5
- data/lib/elasticsearch/api/actions/security/activate_user_profile.rb +3 -3
- data/lib/elasticsearch/api/actions/security/authenticate.rb +3 -3
- data/lib/elasticsearch/api/actions/security/bulk_update_api_keys.rb +3 -3
- data/lib/elasticsearch/api/actions/security/change_password.rb +4 -5
- data/lib/elasticsearch/api/actions/security/clear_api_key_cache.rb +3 -4
- data/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb +3 -4
- data/lib/elasticsearch/api/actions/security/clear_cached_realms.rb +3 -4
- data/lib/elasticsearch/api/actions/security/clear_cached_roles.rb +3 -4
- data/lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb +3 -4
- data/lib/elasticsearch/api/actions/security/create_api_key.rb +3 -3
- data/lib/elasticsearch/api/actions/security/create_cross_cluster_api_key.rb +3 -3
- data/lib/elasticsearch/api/actions/security/create_service_token.rb +3 -4
- data/lib/elasticsearch/api/actions/security/delete_privileges.rb +3 -4
- data/lib/elasticsearch/api/actions/security/delete_role.rb +3 -4
- data/lib/elasticsearch/api/actions/security/delete_role_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/security/delete_service_token.rb +3 -4
- data/lib/elasticsearch/api/actions/security/delete_user.rb +3 -4
- data/lib/elasticsearch/api/actions/security/disable_user.rb +3 -4
- data/lib/elasticsearch/api/actions/security/disable_user_profile.rb +3 -4
- data/lib/elasticsearch/api/actions/security/enable_user.rb +3 -4
- data/lib/elasticsearch/api/actions/security/enable_user_profile.rb +3 -4
- data/lib/elasticsearch/api/actions/security/enroll_kibana.rb +3 -3
- data/lib/elasticsearch/api/actions/security/enroll_node.rb +3 -3
- data/lib/elasticsearch/api/actions/security/get_api_key.rb +4 -3
- data/lib/elasticsearch/api/actions/security/get_builtin_privileges.rb +3 -3
- data/lib/elasticsearch/api/actions/security/get_privileges.rb +4 -5
- data/lib/elasticsearch/api/actions/security/get_role.rb +6 -7
- data/lib/elasticsearch/api/actions/security/get_role_mapping.rb +4 -5
- data/lib/elasticsearch/api/actions/security/get_service_accounts.rb +4 -5
- data/lib/elasticsearch/api/actions/security/get_service_credentials.rb +3 -4
- data/lib/elasticsearch/api/actions/security/get_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/security/get_token.rb +3 -3
- data/lib/elasticsearch/api/actions/security/get_user.rb +6 -7
- data/lib/elasticsearch/api/actions/security/get_user_privileges.rb +3 -3
- data/lib/elasticsearch/api/actions/security/get_user_profile.rb +3 -4
- data/lib/elasticsearch/api/actions/security/grant_api_key.rb +3 -3
- data/lib/elasticsearch/api/actions/security/has_privileges.rb +4 -5
- data/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb +3 -3
- data/lib/elasticsearch/api/actions/security/invalidate_api_key.rb +3 -3
- data/lib/elasticsearch/api/actions/security/invalidate_token.rb +3 -3
- data/lib/elasticsearch/api/actions/security/oidc_authenticate.rb +3 -3
- data/lib/elasticsearch/api/actions/security/oidc_logout.rb +3 -3
- data/lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb +3 -3
- data/lib/elasticsearch/api/actions/security/put_privileges.rb +3 -3
- data/lib/elasticsearch/api/actions/security/put_role.rb +3 -4
- data/lib/elasticsearch/api/actions/security/put_role_mapping.rb +3 -4
- data/lib/elasticsearch/api/actions/security/put_user.rb +3 -4
- data/lib/elasticsearch/api/actions/security/query_api_keys.rb +5 -3
- data/lib/elasticsearch/api/actions/security/query_user.rb +57 -0
- data/lib/elasticsearch/api/actions/security/saml_authenticate.rb +3 -3
- data/lib/elasticsearch/api/actions/security/saml_complete_logout.rb +3 -3
- data/lib/elasticsearch/api/actions/security/saml_invalidate.rb +3 -3
- data/lib/elasticsearch/api/actions/security/saml_logout.rb +3 -3
- data/lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb +3 -3
- data/lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb +3 -4
- data/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb +3 -3
- data/lib/elasticsearch/api/actions/security/update_api_key.rb +3 -4
- data/lib/elasticsearch/api/actions/security/update_cross_cluster_api_key.rb +3 -4
- data/lib/elasticsearch/api/actions/security/update_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/security/update_user_profile_data.rb +3 -4
- data/lib/elasticsearch/api/actions/shutdown/delete_node.rb +2 -3
- data/lib/elasticsearch/api/actions/shutdown/get_node.rb +3 -4
- data/lib/elasticsearch/api/actions/shutdown/put_node.rb +2 -3
- data/lib/elasticsearch/api/actions/simulate/ingest.rb +4 -5
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot/clone.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot/create.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +5 -6
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +5 -6
- data/lib/elasticsearch/api/actions/snapshot/get.rb +5 -6
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +6 -7
- data/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot/status.rb +6 -7
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb +4 -5
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb +3 -4
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb +3 -3
- data/lib/elasticsearch/api/actions/sql/clear_cursor.rb +3 -3
- data/lib/elasticsearch/api/actions/sql/delete_async.rb +3 -4
- data/lib/elasticsearch/api/actions/sql/get_async.rb +3 -4
- data/lib/elasticsearch/api/actions/sql/get_async_status.rb +3 -4
- data/lib/elasticsearch/api/actions/sql/query.rb +3 -3
- data/lib/elasticsearch/api/actions/sql/translate.rb +3 -3
- data/lib/elasticsearch/api/actions/ssl/certificates.rb +3 -3
- data/lib/elasticsearch/api/actions/synonyms/delete_synonym.rb +3 -8
- data/lib/elasticsearch/api/actions/synonyms/delete_synonym_rule.rb +3 -8
- data/lib/elasticsearch/api/actions/synonyms/get_synonym.rb +3 -8
- data/lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb +3 -8
- data/lib/elasticsearch/api/actions/synonyms/get_synonyms_sets.rb +3 -7
- data/lib/elasticsearch/api/actions/synonyms/put_synonym.rb +3 -8
- data/lib/elasticsearch/api/actions/synonyms/put_synonym_rule.rb +3 -8
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +4 -5
- data/lib/elasticsearch/api/actions/tasks/get.rb +3 -4
- data/lib/elasticsearch/api/actions/tasks/list.rb +3 -3
- data/lib/elasticsearch/api/actions/terms_enum.rb +5 -6
- data/lib/elasticsearch/api/actions/termvectors.rb +12 -12
- data/lib/elasticsearch/api/actions/text_structure/find_field_structure.rb +64 -0
- data/lib/elasticsearch/api/actions/text_structure/find_message_structure.rb +64 -0
- data/lib/elasticsearch/api/actions/text_structure/find_structure.rb +9 -9
- data/lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb +54 -0
- data/lib/elasticsearch/api/actions/transform/delete_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/get_transform.rb +4 -5
- data/lib/elasticsearch/api/actions/transform/get_transform_stats.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/preview_transform.rb +8 -9
- data/lib/elasticsearch/api/actions/transform/put_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/reset_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/schedule_now_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/start_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/stop_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/update_transform.rb +3 -4
- data/lib/elasticsearch/api/actions/transform/upgrade_transforms.rb +3 -3
- data/lib/elasticsearch/api/actions/update.rb +5 -6
- data/lib/elasticsearch/api/actions/update_by_query.rb +3 -4
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/ack_watch.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/activate_watch.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/deactivate_watch.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/delete_watch.rb +5 -6
- data/lib/elasticsearch/api/actions/watcher/execute_watch.rb +4 -5
- data/lib/elasticsearch/api/actions/watcher/get_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/watcher/get_watch.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/put_watch.rb +3 -4
- data/lib/elasticsearch/api/actions/watcher/query_watches.rb +3 -3
- data/lib/elasticsearch/api/actions/watcher/start.rb +3 -3
- data/lib/elasticsearch/api/actions/watcher/stats.rb +4 -5
- data/lib/elasticsearch/api/actions/watcher/stop.rb +3 -3
- data/lib/elasticsearch/api/actions/watcher/update_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/xpack/info.rb +3 -3
- data/lib/elasticsearch/api/actions/xpack/usage.rb +3 -3
- data/lib/elasticsearch/api/version.rb +1 -1
- data/lib/elasticsearch/api.rb +1 -2
- data/spec/elasticsearch/api/actions/connector/update_active_filtering_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector/update_api_key_id_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector/update_filtering_validation_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector/update_index_name_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector/update_native_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector/update_service_type_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector/update_status_spec.rb +38 -0
- data/spec/elasticsearch/api/actions/connector_secret/delete_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/connector_secret/get_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/connector_secret/post_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/connector_secret/put_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/connector_sync_job/cancel_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/check_in_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/delete_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/error_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/get_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/list_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/post_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/connector_sync_job/update_stats_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/esql/async_query_get._spec.rb +35 -0
- data/spec/elasticsearch/api/actions/esql/async_query_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/indices/resolve_cluster_spec.rb +51 -0
- data/spec/elasticsearch/api/actions/inference/delete_model_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/inference/get_model_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/inference/inference_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/inference/put_model_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/profiling/flamegraph_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/profiling/stacktraces_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/profiling/topn_functions_spec.rb +35 -0
- data/spec/{platinum/unit/text_structure/find_structure_test.rb → elasticsearch/api/actions/security/query_user_spec.rb} +26 -17
- data/spec/elasticsearch/api/actions/text_structure/find_field_structure_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/text_structure/find_message_structure_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/text_structure/find_structure_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/text_structure/test_grok_pattern_spec.rb +35 -0
- data/spec/elasticsearch/api/perform_request_spec.rb +1 -1
- data/spec/free/integration/health_spec.rb +28 -0
- data/spec/free/integration/spec_helper.rb +28 -0
- data/spec/platinum/integration/api_key/api_key_cross_cluster_spec.rb +6 -15
- data/spec/platinum/integration/api_key/api_key_query_with_aggs_spec.rb +120 -0
- data/spec/platinum/integration/platinum_helper.rb +1 -1
- data/spec/platinum/integration/security/users_query_spec.rb +49 -0
- data/spec/rest_api/rest_api_yaml_spec.rb +6 -0
- data/spec/rest_api/skipped_tests_free.yml +45 -0
- data/spec/rest_api/skipped_tests_platinum.yml +6 -0
- data/{lib/elasticsearch/api/namespace/connector_sync_job.rb → spec/rspec_formatter.rb} +9 -14
- data/spec/spec_helper.rb +10 -3
- data/utils/Gemfile +1 -1
- data/utils/{endpoint_spec.rb → thor/endpoint_spec.rb} +1 -2
- data/utils/{endpoint_specifics.rb → thor/endpoint_specifics.rb} +5 -5
- data/utils/thor/generate_source.rb +9 -89
- data/utils/thor/generator/build_hash_helper.rb +64 -0
- data/utils/thor/generator/docs_helper.rb +62 -0
- data/utils/thor/generator/files_helper.rb +25 -22
- data/utils/thor/templates/_body.erb +1 -1
- data/utils/thor/templates/_documentation_top.erb +11 -12
- data/utils/thor/templates/_method_setup.erb +6 -6
- data/utils/thor/templates/_perform_request.erb +1 -1
- data/utils/thor/templates/method.erb +14 -14
- metadata +90 -16
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
require 'spec_helper'
|
19
19
|
require 'elastic-transport'
|
20
|
-
require_relative '../../../utils/endpoint_spec'
|
20
|
+
require_relative '../../../utils/thor/endpoint_spec'
|
21
21
|
require_relative '../../../utils/thor/generator/files_helper'
|
22
22
|
|
23
23
|
describe 'Perform request args' do
|
@@ -0,0 +1,28 @@
|
|
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
|
+
# TODO: These tests won't be necessary once we migrate to the new YAML tests
|
18
|
+
require_relative './spec_helper'
|
19
|
+
|
20
|
+
describe "Health basic test" do
|
21
|
+
it 'performs the request' do
|
22
|
+
response = CLIENT.health_report
|
23
|
+
expect(response.status).to eq 200
|
24
|
+
expect(response['cluster_name']).not_to be_nil
|
25
|
+
expect(response.dig('indicators', 'master_is_stable', 'symptom')).to eq 'The cluster has a stable master node'
|
26
|
+
expect(response.dig('indicators', 'master_is_stable', 'status')).to eq 'green'
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
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
|
+
require 'elasticsearch'
|
18
|
+
|
19
|
+
host = ENV['TEST_ES_SERVER'] || 'http://localhost:9200'
|
20
|
+
raise URI::InvalidURIError unless host =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
|
21
|
+
|
22
|
+
test_suite = ENV['TEST_SUITE'] || 'free'
|
23
|
+
password = ENV['ELASTIC_PASSWORD'] || 'changeme'
|
24
|
+
uri = URI.parse(host)
|
25
|
+
transport_options = {}
|
26
|
+
host = "http://elastic:#{password}@#{uri.host}:#{uri.port}".freeze
|
27
|
+
|
28
|
+
CLIENT = Elasticsearch::Client.new(host: host, transport_options: transport_options)
|
@@ -30,7 +30,7 @@ describe 'API keys API' do
|
|
30
30
|
username: user,
|
31
31
|
body: {
|
32
32
|
password: password,
|
33
|
-
roles: [
|
33
|
+
roles: ['admin_role'],
|
34
34
|
full_name: 'Admin user'
|
35
35
|
}
|
36
36
|
)
|
@@ -45,31 +45,22 @@ describe 'API keys API' do
|
|
45
45
|
it 'updates api key' do
|
46
46
|
response = ADMIN_CLIENT.security.create_cross_cluster_api_key(
|
47
47
|
body: {
|
48
|
-
name:
|
49
|
-
expiration:
|
48
|
+
name: 'my-cc-api-key',
|
49
|
+
expiration: '1d',
|
50
50
|
access: {
|
51
51
|
search: [
|
52
|
-
{
|
53
|
-
names: ["logs*"],
|
54
|
-
query: {
|
55
|
-
term: { "category": "shared" }
|
56
|
-
},
|
57
|
-
field_security: {
|
58
|
-
grant: ["*"],
|
59
|
-
except: ["private"]
|
60
|
-
}
|
61
|
-
}
|
52
|
+
{ names: ['logs*'] }
|
62
53
|
],
|
63
54
|
replication: [
|
64
55
|
{
|
65
|
-
names: [
|
56
|
+
names: ['archive'],
|
66
57
|
allow_restricted_indices: false
|
67
58
|
}
|
68
59
|
]
|
69
60
|
},
|
70
61
|
metadata: {
|
71
62
|
answer: 42,
|
72
|
-
tag:
|
63
|
+
tag: 'dev'
|
73
64
|
}
|
74
65
|
}
|
75
66
|
)
|
@@ -0,0 +1,120 @@
|
|
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_relative '../platinum_helper'
|
19
|
+
|
20
|
+
describe 'API keys' do
|
21
|
+
before do
|
22
|
+
ADMIN_CLIENT.security.put_role(
|
23
|
+
name: 'admin_role',
|
24
|
+
body: { cluster: ['manage_api_key'] }
|
25
|
+
)
|
26
|
+
ADMIN_CLIENT.security.put_role(
|
27
|
+
name: 'user_role',
|
28
|
+
body: {
|
29
|
+
cluster: ['manage_own_api_key'],
|
30
|
+
}
|
31
|
+
)
|
32
|
+
ADMIN_CLIENT.security.put_user(
|
33
|
+
username: 'api_key_manager',
|
34
|
+
body: {
|
35
|
+
password: 'x-pack-test-password',
|
36
|
+
roles: [ 'admin_role' ],
|
37
|
+
full_name: 'API key manager'
|
38
|
+
}
|
39
|
+
)
|
40
|
+
|
41
|
+
ADMIN_CLIENT.security.put_user(
|
42
|
+
username: 'api_key_user',
|
43
|
+
body: {
|
44
|
+
password: 'x-pack-test-password',
|
45
|
+
roles: [ 'user_role' ],
|
46
|
+
full_name: 'API key user'
|
47
|
+
}
|
48
|
+
)
|
49
|
+
end
|
50
|
+
after do
|
51
|
+
ADMIN_CLIENT.security.delete_role(name: "admin_role", ignore: 404)
|
52
|
+
ADMIN_CLIENT.security.delete_role(name: "user_role", ignore: 404)
|
53
|
+
ADMIN_CLIENT.security.delete_user(username: "api_key_user", ignore: 404)
|
54
|
+
ADMIN_CLIENT.security.delete_user(username: "api_key_manager", ignore: 404)
|
55
|
+
end
|
56
|
+
|
57
|
+
def client(headers)
|
58
|
+
Elasticsearch::Client.new(
|
59
|
+
host: "https://#{HOST_URI.host}:#{HOST_URI.port}",
|
60
|
+
transport_options: TRANSPORT_OPTIONS.merge(headers: headers)
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
let(:manager_auth) do
|
65
|
+
{ Authorization: "Basic YXBpX2tleV9tYW5hZ2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" }
|
66
|
+
end
|
67
|
+
let(:user_auth) do
|
68
|
+
{ Authorization: "Basic YXBpX2tleV9tYW5hZ2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" }
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'queries api key with args' do
|
72
|
+
# api_key_manager authorization:
|
73
|
+
client = client(manager_auth)
|
74
|
+
response = client.security.create_api_key(
|
75
|
+
body: {
|
76
|
+
name: 'manager-api-key',
|
77
|
+
expiration: '10d',
|
78
|
+
metadata: {
|
79
|
+
letter: 'a',
|
80
|
+
number: 42
|
81
|
+
}
|
82
|
+
}
|
83
|
+
)
|
84
|
+
expect(response.status).to eq 200
|
85
|
+
id = response['id']
|
86
|
+
api_key = response['api_key']
|
87
|
+
expect(response['encoded']).to eq Base64.strict_encode64("#{id}:#{api_key}")
|
88
|
+
|
89
|
+
client = client(user_auth)
|
90
|
+
response = client.security.create_api_key(
|
91
|
+
body: {
|
92
|
+
name: 'user-api-key',
|
93
|
+
expiration: '1d',
|
94
|
+
metadata: {
|
95
|
+
letter: 'a',
|
96
|
+
number: 1
|
97
|
+
}
|
98
|
+
}
|
99
|
+
)
|
100
|
+
expect(response.status).to eq 200
|
101
|
+
id = response['id']
|
102
|
+
api_key = response['api_key']
|
103
|
+
expect(response['encoded']).to eq Base64.strict_encode64("#{id}:#{api_key}")
|
104
|
+
|
105
|
+
response = client.security.query_api_keys(
|
106
|
+
body: {
|
107
|
+
size: 0,
|
108
|
+
aggs: {
|
109
|
+
my_buckets: {
|
110
|
+
composite: {
|
111
|
+
sources: [{ key_name: { terms: { field: "name" } } } ]
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
)
|
117
|
+
expect(response.dig('aggregations', 'my_buckets', 'buckets').find { |a| a.dig('key', 'key_name') == 'manager-api-key'})
|
118
|
+
expect(response.dig('aggregations', 'my_buckets', 'buckets').find { |a| a.dig('key', 'key_name') == 'user-api-key'})
|
119
|
+
end
|
120
|
+
end
|
@@ -37,6 +37,6 @@ ADMIN_CLIENT = Elasticsearch::Client.new(host: HOST, transport_options: TRANSPOR
|
|
37
37
|
|
38
38
|
RSpec.configure do |config|
|
39
39
|
config.add_formatter('documentation')
|
40
|
-
config.add_formatter('RSpec::Core::Formatters::HtmlFormatter', "tmp/platinum-integration.html")
|
40
|
+
config.add_formatter('RSpec::Core::Formatters::HtmlFormatter', "tmp/platinum-#{ENV['RUBY_VERSION']}-manual-integration.html")
|
41
41
|
config.color_mode = :on
|
42
42
|
end
|
@@ -0,0 +1,49 @@
|
|
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_relative '../platinum_helper'
|
19
|
+
|
20
|
+
describe 'security/Query User' do
|
21
|
+
before do
|
22
|
+
ADMIN_CLIENT.security.put_user(
|
23
|
+
username: "query_users_test",
|
24
|
+
body: {
|
25
|
+
password: "x-pack-test-password",
|
26
|
+
roles: [ "manage_users_role" ],
|
27
|
+
full_name: "Read User"
|
28
|
+
}
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'queries users' do
|
33
|
+
response = ADMIN_CLIENT.security.query_user(body: {})
|
34
|
+
expect(response.status).to eq 200
|
35
|
+
expect(response['count']).to be > 0
|
36
|
+
expect(response['total']).to be > 0
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'queries user and finds created one' do
|
40
|
+
body = {
|
41
|
+
query: { wildcard: { username: 'query_users_*' } }
|
42
|
+
}
|
43
|
+
response = ADMIN_CLIENT.security.query_user(body: body)
|
44
|
+
expect(response.status).to eq 200
|
45
|
+
expect(response['count']).to be 1
|
46
|
+
expect(response['total']).to be 1
|
47
|
+
expect(response['users'].first['username']).to eq 'query_users_test'
|
48
|
+
end
|
49
|
+
end
|
@@ -30,6 +30,8 @@ describe 'Rest API YAML tests' do
|
|
30
30
|
exit 1
|
31
31
|
end
|
32
32
|
|
33
|
+
CLUSTER_FEATURES = ADMIN_CLIENT.features.get_features['features'].map { |f| f['name'] }
|
34
|
+
|
33
35
|
# Traverse YAML files and create TestFile object:
|
34
36
|
REST_API_YAML_FILES.each do |file|
|
35
37
|
begin
|
@@ -46,6 +48,10 @@ describe 'Rest API YAML tests' do
|
|
46
48
|
let(:client) { DEFAULT_CLIENT }
|
47
49
|
|
48
50
|
test_file.tests.each do |test|
|
51
|
+
# To support new features skipping in YAML tests. This will go away with new YAML tests:
|
52
|
+
if (feature_to_skip = test.skip&.first&.[]('skip')&.[]('cluster_features'))
|
53
|
+
next unless CLUSTER_FEATURES.include? feature_to_skip
|
54
|
+
end
|
49
55
|
context test.description do
|
50
56
|
if test.skip_test?(ADMIN_CLIENT)
|
51
57
|
skip 'Test contains feature(s) not yet supported or version is not satisfied'
|
@@ -31,9 +31,54 @@
|
|
31
31
|
-
|
32
32
|
:file: 'cluster.desired_nodes/10_basic.yml'
|
33
33
|
:description: 'Test update desired nodes is idempotent with different order'
|
34
|
+
-
|
35
|
+
:file: 'cluster.desired_nodes/10_basic.yml'
|
36
|
+
:description: 'Test node version must be at least the current master version'
|
37
|
+
-
|
38
|
+
:file: 'cluster.desired_nodes/10_basic.yml'
|
39
|
+
:description: 'Test node version must have content'
|
34
40
|
-
|
35
41
|
:file: 'search.vectors/40_knn_search.yml'
|
36
42
|
:description: 'Direct kNN queries are disallowed'
|
37
43
|
-
|
38
44
|
:file: 'search.vectors/45_knn_search_byte.yml'
|
39
45
|
:description: 'Direct kNN queries are disallowed'
|
46
|
+
-
|
47
|
+
:file: 'tsdb/25_id_generation.yml'
|
48
|
+
:description: 'generates a consistent id'
|
49
|
+
-
|
50
|
+
:file: 'indices.resolve_cluster/10_basic_resolve_cluster.yml'
|
51
|
+
:description: 'Resolve cluster using alias and index that does not exist'
|
52
|
+
-
|
53
|
+
:file: 'health/10_basic.yml' # Migrated to written manually
|
54
|
+
:description: 'cluster health basic test'
|
55
|
+
-
|
56
|
+
:file: 'cat.allocation/10_basic.yml'
|
57
|
+
:description: 'One index'
|
58
|
+
-
|
59
|
+
:file: 'cat.allocation/10_basic.yml'
|
60
|
+
:description: 'Node ID'
|
61
|
+
-
|
62
|
+
:file: 'cat.allocation/10_basic.yml'
|
63
|
+
:description: 'All Nodes'
|
64
|
+
-
|
65
|
+
:file: 'cat.allocation/10_basic.yml'
|
66
|
+
:description: 'Column headers'
|
67
|
+
-
|
68
|
+
:file: 'cat.allocation/10_basic.yml'
|
69
|
+
:description: 'Bytes'
|
70
|
+
-
|
71
|
+
:file: 'search.vectors/120_knn_query_multiple_shards.yml'
|
72
|
+
:description: 'Search for 2 knn queries combines scores from them'
|
73
|
+
-
|
74
|
+
:file: 'search.vectors/140_knn_query_with_other_queries.yml'
|
75
|
+
:description: 'Function score query with knn query'
|
76
|
+
-
|
77
|
+
:file: 'search.vectors/60_knn_search_filter_alias.yml'
|
78
|
+
:description: 'kNN filter alias'
|
79
|
+
-
|
80
|
+
:file: 'cluster.desired_nodes/11_old_format.yml'
|
81
|
+
:description: 'Test node version must be at least the current master version'
|
82
|
+
-
|
83
|
+
:file: 'cluster.desired_nodes/11_old_format.yml'
|
84
|
+
:description: 'Test node version must have content'
|
@@ -112,3 +112,9 @@
|
|
112
112
|
-
|
113
113
|
:file: 'esql/60_usage.yml'
|
114
114
|
:description: 'Basic ESQL usage output (telemetry)'
|
115
|
+
-
|
116
|
+
:file: 'users/40_query.yml'
|
117
|
+
:description: 'Test query user'
|
118
|
+
-
|
119
|
+
:file: 'api_key/21_query_with_aggs.yml'
|
120
|
+
:description: 'Test composite aggs api key'
|
@@ -15,22 +15,17 @@
|
|
15
15
|
# specific language governing permissions and limitations
|
16
16
|
# under the License.
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
module ConnectorSyncJob
|
21
|
-
module Actions; end
|
18
|
+
class RSpecCustomFormatter < RSpec::Core::Formatters::JsonFormatter
|
19
|
+
RSpec::Core::Formatters.register self
|
22
20
|
|
23
|
-
|
24
|
-
#
|
25
|
-
class ConnectorSyncJobClient
|
26
|
-
include Common::Client, Common::Client::Base, ConnectorSyncJob::Actions
|
27
|
-
end
|
21
|
+
LOGFILE = File.new("tmp/rspec-#{ENV['TEST_SUITE']}-#{RUBY_VERSION}.log", 'w')
|
28
22
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
def close(_notification)
|
24
|
+
@output_hash[:examples].map do |example|
|
25
|
+
regexp = /\S+\/\S+/
|
26
|
+
filename = example[:full_description].match(/\S+\/\S+/)[0]
|
27
|
+
log ="#{filename} | #{example[:status]} | #{example[:run_time]} | #{example[:full_description]}\n"
|
28
|
+
File.write(LOGFILE, log, mode: 'a')
|
34
29
|
end
|
35
30
|
end
|
36
31
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -22,7 +22,7 @@ end
|
|
22
22
|
if defined?(JRUBY_VERSION)
|
23
23
|
require 'pry-nav'
|
24
24
|
else
|
25
|
-
require '
|
25
|
+
require 'debug'
|
26
26
|
end
|
27
27
|
require 'yaml'
|
28
28
|
require 'active_support/isolated_execution_state' unless RUBY_VERSION < '2.7.0'
|
@@ -59,8 +59,15 @@ end
|
|
59
59
|
RSpec.configure do |config|
|
60
60
|
config.include(HelperModule)
|
61
61
|
config.add_formatter('documentation')
|
62
|
-
|
63
|
-
|
62
|
+
if defined?(JRUBY_VERSION)
|
63
|
+
config.add_formatter('RSpec::Core::Formatters::HtmlFormatter', "tmp/elasticsearch-#{ENV['TEST_SUITE']}-jruby-#{JRUBY_VERSION}.html")
|
64
|
+
else
|
65
|
+
config.add_formatter('RSpec::Core::Formatters::HtmlFormatter', "tmp/elasticsearch-#{ENV['TEST_SUITE']}-#{RUBY_VERSION}.html")
|
66
|
+
end
|
67
|
+
if ENV['BUILDKITE']
|
68
|
+
require_relative "./rspec_formatter.rb"
|
69
|
+
config.add_formatter('RSpecCustomFormatter')
|
70
|
+
end
|
64
71
|
config.color_mode = :on
|
65
72
|
end
|
66
73
|
|
data/utils/Gemfile
CHANGED
@@ -32,7 +32,7 @@ module Elasticsearch
|
|
32
32
|
|
33
33
|
full_namespace = parse_full_namespace
|
34
34
|
@namespace_depth = full_namespace.size > 0 ? full_namespace.size - 1 : 0
|
35
|
-
@module_namespace = full_namespace[0, namespace_depth]
|
35
|
+
@module_namespace = full_namespace[0, @namespace_depth]
|
36
36
|
@method_name = full_namespace.last
|
37
37
|
|
38
38
|
@path_parts = parse_endpoint_parts(@spec)
|
@@ -56,7 +56,6 @@ module Elasticsearch
|
|
56
56
|
:http_path,
|
57
57
|
:required_parts,
|
58
58
|
:http_method,
|
59
|
-
:namespace_depth,
|
60
59
|
:path_params,
|
61
60
|
:perform_request_opts
|
62
61
|
|
@@ -136,11 +136,11 @@ module Elasticsearch
|
|
136
136
|
|
137
137
|
def bulk_body_helper
|
138
138
|
<<~SRC
|
139
|
-
if body.is_a? Array
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
139
|
+
payload = if body.is_a? Array
|
140
|
+
Elasticsearch::API::Utils.__bulkify(body)
|
141
|
+
else
|
142
|
+
body
|
143
|
+
end
|
144
144
|
SRC
|
145
145
|
end
|
146
146
|
|
@@ -22,8 +22,10 @@ require 'pathname'
|
|
22
22
|
require 'multi_json'
|
23
23
|
require 'coderay'
|
24
24
|
require 'pry'
|
25
|
+
require_relative 'generator/build_hash_helper'
|
26
|
+
require_relative 'generator/docs_helper'
|
25
27
|
require_relative 'generator/files_helper'
|
26
|
-
require_relative '
|
28
|
+
require_relative './endpoint_spec'
|
27
29
|
|
28
30
|
module Elasticsearch
|
29
31
|
module API
|
@@ -41,20 +43,17 @@ module Elasticsearch
|
|
41
43
|
namespace 'code'
|
42
44
|
include Thor::Actions
|
43
45
|
include EndpointSpecifics
|
46
|
+
include DocsHelper
|
44
47
|
|
45
48
|
desc 'generate', 'Generate source code and tests from the REST API JSON specification'
|
46
49
|
method_option :verbose, type: :boolean, default: false, desc: 'Output more information'
|
47
50
|
method_option :tests, type: :boolean, default: false, desc: 'Generate test files'
|
48
51
|
|
49
52
|
def generate
|
50
|
-
@build_hash =
|
51
|
-
File.read(File.expand_path('../../../tmp/rest-api-spec/build_hash',__dir__))
|
52
|
-
else
|
53
|
-
original_build_hash
|
54
|
-
end
|
55
|
-
|
53
|
+
@build_hash = BuildHashHelper.build_hash
|
56
54
|
self.class.source_root File.expand_path(__dir__)
|
57
55
|
generate_source
|
56
|
+
|
58
57
|
# -- Tree output
|
59
58
|
print_tree if options[:verbose]
|
60
59
|
end
|
@@ -68,101 +67,22 @@ module Elasticsearch
|
|
68
67
|
FilesHelper.files.each do |filepath|
|
69
68
|
@spec = EndpointSpec.new(filepath)
|
70
69
|
say_status 'json', @spec.path, :yellow
|
71
|
-
|
72
70
|
# Don't generate code for internal APIs:
|
73
71
|
next if @spec.module_namespace.flatten.first == '_internal'
|
74
72
|
|
75
73
|
path_to_file = output.join(@spec.module_namespace.join('/')).join("#{@spec.method_name}.rb")
|
76
74
|
dir = output.join(@spec.module_namespace.join('/'))
|
77
|
-
|
78
75
|
empty_directory(dir, verbose: false)
|
79
76
|
|
80
77
|
# Write the file with the ERB template:
|
81
78
|
template('templates/method.erb', path_to_file, force: true)
|
82
79
|
|
80
|
+
# Optionals:
|
83
81
|
print_source_code(path_to_file) if options[:verbose]
|
84
|
-
|
85
82
|
generate_tests if options[:tests]
|
86
|
-
|
87
|
-
puts
|
88
83
|
end
|
89
|
-
|
90
84
|
run_rubocop
|
91
|
-
add_hash
|
92
|
-
end
|
93
|
-
|
94
|
-
def add_hash
|
95
|
-
Dir.glob("#{FilesHelper.output_dir}/**/*.rb").each do |file|
|
96
|
-
content = File.read(file)
|
97
|
-
new_content = content.gsub(/(^#\sunder\sthe\sLicense.\n#)/) do |_|
|
98
|
-
match = Regexp.last_match
|
99
|
-
"#{match[1]}\n#{build_hash_comment}"
|
100
|
-
end
|
101
|
-
File.open(file, 'w') { |f| f.puts new_content }
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def build_hash_comment
|
106
|
-
[
|
107
|
-
"Auto generated from build hash #{@build_hash}",
|
108
|
-
'@see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec',
|
109
|
-
''
|
110
|
-
].map { |b| "# #{b}" }.join("\n").strip
|
111
|
-
end
|
112
|
-
|
113
|
-
def original_build_hash
|
114
|
-
content = File.read("#{FilesHelper.output_dir}/info.rb")
|
115
|
-
return unless (match = content.match(/Auto generated from build hash ([a-f0-9]+)/))
|
116
|
-
|
117
|
-
match[1]
|
118
|
-
end
|
119
|
-
|
120
|
-
# Create the hierarchy of directories based on API namespaces
|
121
|
-
#
|
122
|
-
def create_directories(key, value)
|
123
|
-
return if value['documentation']
|
124
|
-
|
125
|
-
empty_directory @output.join(key)
|
126
|
-
create_directory_hierarchy * value.to_a.first
|
127
|
-
end
|
128
|
-
|
129
|
-
def docs_helper(name, info)
|
130
|
-
info['type'] = 'String' if info['type'] == 'enum' # Rename 'enums' to 'strings'
|
131
|
-
info['type'] = 'Integer' if info['type'] == 'int' # Rename 'int' to 'Integer'
|
132
|
-
tipo = info['type'] ? info['type'].capitalize : 'String'
|
133
|
-
description = info['description'] ? info['description'].strip : '[TODO]'
|
134
|
-
options = info['options'] ? "(options: #{info['options'].join(', ').strip})" : nil
|
135
|
-
required = info['required'] ? '(*Required*)' : ''
|
136
|
-
deprecated = info['deprecated'] ? '*Deprecated*' : ''
|
137
|
-
optionals = [required, deprecated, options].join(' ').strip
|
138
|
-
|
139
|
-
"# @option arguments [#{tipo}] :#{name} #{description} #{optionals}\n"
|
140
|
-
end
|
141
|
-
|
142
|
-
def stability_doc_helper(stability)
|
143
|
-
return if stability == 'stable'
|
144
|
-
|
145
|
-
if stability == 'experimental'
|
146
|
-
<<~MSG
|
147
|
-
# This functionality is Experimental and may be changed or removed
|
148
|
-
# completely in a future release. Elastic will take a best effort approach
|
149
|
-
# to fix any issues, but experimental features are not subject to the
|
150
|
-
# support SLA of official GA features.
|
151
|
-
MSG
|
152
|
-
elsif stability == 'beta'
|
153
|
-
<<~MSG
|
154
|
-
# This functionality is in Beta and is subject to change. The design and
|
155
|
-
# code is less mature than official GA features and is being provided
|
156
|
-
# as-is with no warranties. Beta features are not subject to the support
|
157
|
-
# SLA of official GA features.
|
158
|
-
MSG
|
159
|
-
else
|
160
|
-
<<~MSG
|
161
|
-
# This functionality is subject to potential breaking changes within a
|
162
|
-
# minor version, meaning that your referencing code may break when this
|
163
|
-
# library is upgraded.
|
164
|
-
MSG
|
165
|
-
end
|
85
|
+
BuildHashHelper.add_hash(@build_hash)
|
166
86
|
end
|
167
87
|
|
168
88
|
def generate_tests
|
@@ -200,7 +120,7 @@ module Elasticsearch
|
|
200
120
|
end
|
201
121
|
|
202
122
|
def run_rubocop
|
203
|
-
system("rubocop -c ./thor/.rubocop.yml --format autogenconf -
|
123
|
+
system("rubocop -c ./thor/.rubocop.yml --format autogenconf -a #{FilesHelper::output_dir}")
|
204
124
|
end
|
205
125
|
end
|
206
126
|
end
|