diff --git a/specification/_global/delete/examples/request/DeleteRequestExample1.yaml b/specification/_global/delete/examples/request/DeleteRequestExample1.yaml index f63f899496..b0ab79db88 100644 --- a/specification/_global/delete/examples/request/DeleteRequestExample1.yaml +++ b/specification/_global/delete/examples/request/DeleteRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_doc/1"' + - language: Java + code: | + client.delete(d -> d + .id("1") + .index("my-index-000001") + ); diff --git a/specification/_global/delete_by_query_rethrottle/examples/request/DeleteByQueryRethrottleRequestExample1.yaml b/specification/_global/delete_by_query_rethrottle/examples/request/DeleteByQueryRethrottleRequestExample1.yaml index 79647771e8..eda73fba47 100644 --- a/specification/_global/delete_by_query_rethrottle/examples/request/DeleteByQueryRethrottleRequestExample1.yaml +++ b/specification/_global/delete_by_query_rethrottle/examples/request/DeleteByQueryRethrottleRequestExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_delete_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"' + - language: Java + code: | + client.deleteByQueryRethrottle(d -> d + .requestsPerSecond(-1.0F) + .taskId("r1A2WoRbTwKZ516z6NEs5A:36619") + ); diff --git a/specification/_global/delete_script/examples/request/DeleteScriptRequestExample1.yaml b/specification/_global/delete_script/examples/request/DeleteScriptRequestExample1.yaml index a65d29fd24..b3c9e105cf 100644 --- a/specification/_global/delete_script/examples/request/DeleteScriptRequestExample1.yaml +++ b/specification/_global/delete_script/examples/request/DeleteScriptRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_scripts/my-search-template"' + - language: Java + code: | + client.deleteScript(d -> d + .id("my-search-template") + ); diff --git a/specification/_global/exists/examples/request/DocumentExistsRequestExample1.yaml b/specification/_global/exists/examples/request/DocumentExistsRequestExample1.yaml index 9d2a905460..dd2cca32d4 100644 --- a/specification/_global/exists/examples/request/DocumentExistsRequestExample1.yaml +++ b/specification/_global/exists/examples/request/DocumentExistsRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_doc/0"' + - language: Java + code: | + client.exists(e -> e + .id("0") + .index("my-index-000001") + ); diff --git a/specification/_global/exists_source/examples/request/ExistsSourceRequestExample1.yaml b/specification/_global/exists_source/examples/request/ExistsSourceRequestExample1.yaml index 1e5cb53f47..5e759ef9d5 100644 --- a/specification/_global/exists_source/examples/request/ExistsSourceRequestExample1.yaml +++ b/specification/_global/exists_source/examples/request/ExistsSourceRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_source/1"' + - language: Java + code: | + client.existsSource(e -> e + .id("1") + .index("my-index-000001") + ); diff --git a/specification/_global/get_script/examples/request/GetScriptRequestExample1.yaml b/specification/_global/get_script/examples/request/GetScriptRequestExample1.yaml index 019c999121..e135beaf68 100644 --- a/specification/_global/get_script/examples/request/GetScriptRequestExample1.yaml +++ b/specification/_global/get_script/examples/request/GetScriptRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_scripts/my-search-template"' + - language: Java + code: | + client.getScript(g -> g + .id("my-search-template") + ); diff --git a/specification/_global/get_source/examples/request/GetSourceRequestExample1.yaml b/specification/_global/get_source/examples/request/GetSourceRequestExample1.yaml index 78bb88e8bb..6470ad8596 100644 --- a/specification/_global/get_source/examples/request/GetSourceRequestExample1.yaml +++ b/specification/_global/get_source/examples/request/GetSourceRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_source/1"' + - language: Java + code: | + client.getSource(g -> g + .id("1") + .index("my-index-000001") + ); diff --git a/specification/_global/health_report/examples/request/HealthReportRequestExample1.yaml b/specification/_global/health_report/examples/request/HealthReportRequestExample1.yaml index 2f62818227..e1eac5c51b 100644 --- a/specification/_global/health_report/examples/request/HealthReportRequestExample1.yaml +++ b/specification/_global/health_report/examples/request/HealthReportRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->healthReport(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_health_report"' + - language: Java + code: | + client.healthReport(h -> h); diff --git a/specification/_global/reindex_rethrottle/examples/request/ReindexRethrottleRequestExample1.yaml b/specification/_global/reindex_rethrottle/examples/request/ReindexRethrottleRequestExample1.yaml index f69b4fe1a4..a96d2256a6 100644 --- a/specification/_global/reindex_rethrottle/examples/request/ReindexRethrottleRequestExample1.yaml +++ b/specification/_global/reindex_rethrottle/examples/request/ReindexRethrottleRequestExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"' + - language: Java + code: | + client.reindexRethrottle(r -> r + .requestsPerSecond(-1.0F) + .taskId("r1A2WoRbTwKZ516z6NEs5A:36619") + ); diff --git a/specification/_global/search_shards/examples/request/SearchShardsRequestExample1.yaml b/specification/_global/search_shards/examples/request/SearchShardsRequestExample1.yaml index 2ffc8c6e25..2c3ea338f1 100644 --- a/specification/_global/search_shards/examples/request/SearchShardsRequestExample1.yaml +++ b/specification/_global/search_shards/examples/request/SearchShardsRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_search_shards"' + - language: Java + code: | + client.searchShards(s -> s + .index("my-index-000001") + ); diff --git a/specification/_global/update_by_query_rethrottle/examples/request/UpdateByQueryRethrottleRequestExample1.yaml b/specification/_global/update_by_query_rethrottle/examples/request/UpdateByQueryRethrottleRequestExample1.yaml index cf38b7f56d..41401d5e45 100644 --- a/specification/_global/update_by_query_rethrottle/examples/request/UpdateByQueryRethrottleRequestExample1.yaml +++ b/specification/_global/update_by_query_rethrottle/examples/request/UpdateByQueryRethrottleRequestExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_update_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"' + - language: Java + code: | + client.updateByQueryRethrottle(u -> u + .requestsPerSecond(-1.0F) + .taskId("r1A2WoRbTwKZ516z6NEs5A:36619") + ); diff --git a/specification/async_search/delete/examples/request/AsyncSearchDeleteExample1.yaml b/specification/async_search/delete/examples/request/AsyncSearchDeleteExample1.yaml index f5113a9b90..4e3da24646 100644 --- a/specification/async_search/delete/examples/request/AsyncSearchDeleteExample1.yaml +++ b/specification/async_search/delete/examples/request/AsyncSearchDeleteExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="' + - language: Java + code: | + client.asyncSearch().delete(d -> d + .id("FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=") + ); diff --git a/specification/async_search/get/examples/request/AsyncSearchGetRequestExample1.yaml b/specification/async_search/get/examples/request/AsyncSearchGetRequestExample1.yaml index 25c7785451..d4a63fb3cf 100644 --- a/specification/async_search/get/examples/request/AsyncSearchGetRequestExample1.yaml +++ b/specification/async_search/get/examples/request/AsyncSearchGetRequestExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="' + - language: Java + code: | + client.asyncSearch().get(g -> g + .id("FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=") + ); diff --git a/specification/async_search/status/examples/request/AsyncSearchStatusRequestExample1.yaml b/specification/async_search/status/examples/request/AsyncSearchStatusRequestExample1.yaml index 978acd804a..7e57391a4e 100644 --- a/specification/async_search/status/examples/request/AsyncSearchStatusRequestExample1.yaml +++ b/specification/async_search/status/examples/request/AsyncSearchStatusRequestExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="' + - language: Java + code: | + client.asyncSearch().status(s -> s + .id("FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=") + ); diff --git a/specification/autoscaling/delete_autoscaling_policy/examples/request/DeleteAutoscalingPolicyRequestExample1.yaml b/specification/autoscaling/delete_autoscaling_policy/examples/request/DeleteAutoscalingPolicyRequestExample1.yaml index 9908ccd1a3..6f094d8737 100644 --- a/specification/autoscaling/delete_autoscaling_policy/examples/request/DeleteAutoscalingPolicyRequestExample1.yaml +++ b/specification/autoscaling/delete_autoscaling_policy/examples/request/DeleteAutoscalingPolicyRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_autoscaling/policy/*"' + - language: Java + code: | + client.autoscaling().deleteAutoscalingPolicy(d -> d + .name("*") + ); diff --git a/specification/autoscaling/get_autoscaling_capacity/examples/request/GetAutoscalingCapacityRequestExample1.yaml b/specification/autoscaling/get_autoscaling_capacity/examples/request/GetAutoscalingCapacityRequestExample1.yaml index 19ff87dd19..f15ffe3e92 100644 --- a/specification/autoscaling/get_autoscaling_capacity/examples/request/GetAutoscalingCapacityRequestExample1.yaml +++ b/specification/autoscaling/get_autoscaling_capacity/examples/request/GetAutoscalingCapacityRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->autoscaling()->getAutoscalingCapacity(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_autoscaling/capacity"' + - language: Java + code: | + client.autoscaling().getAutoscalingCapacity(g -> g); diff --git a/specification/autoscaling/get_autoscaling_policy/examples/request/GetAutoscalingPolicyRequestExample1.yaml b/specification/autoscaling/get_autoscaling_policy/examples/request/GetAutoscalingPolicyRequestExample1.yaml index e5c60ca81d..87d4d76fbb 100644 --- a/specification/autoscaling/get_autoscaling_policy/examples/request/GetAutoscalingPolicyRequestExample1.yaml +++ b/specification/autoscaling/get_autoscaling_policy/examples/request/GetAutoscalingPolicyRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_autoscaling/policy/my_autoscaling_policy"' + - language: Java + code: | + client.autoscaling().getAutoscalingPolicy(g -> g + .name("my_autoscaling_policy") + ); diff --git a/specification/ccr/delete_auto_follow_pattern/examples/request/DeleteAutoFollowPatternRequestExample1.yaml b/specification/ccr/delete_auto_follow_pattern/examples/request/DeleteAutoFollowPatternRequestExample1.yaml index fd86a4d683..a2fe3a0052 100644 --- a/specification/ccr/delete_auto_follow_pattern/examples/request/DeleteAutoFollowPatternRequestExample1.yaml +++ b/specification/ccr/delete_auto_follow_pattern/examples/request/DeleteAutoFollowPatternRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern"' + - language: Java + code: | + client.ccr().deleteAutoFollowPattern(d -> d + .name("my_auto_follow_pattern") + ); diff --git a/specification/ccr/follow_info/examples/request/FollowInfoRequestExample1.yaml b/specification/ccr/follow_info/examples/request/FollowInfoRequestExample1.yaml index 520f4d9861..80b7896018 100644 --- a/specification/ccr/follow_info/examples/request/FollowInfoRequestExample1.yaml +++ b/specification/ccr/follow_info/examples/request/FollowInfoRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/info"' + - language: Java + code: | + client.ccr().followInfo(f -> f + .index("follower_index") + ); diff --git a/specification/ccr/follow_stats/examples/request/FollowIndexStatsRequestExample1.yaml b/specification/ccr/follow_stats/examples/request/FollowIndexStatsRequestExample1.yaml index b1db055a71..8db1dc74a7 100644 --- a/specification/ccr/follow_stats/examples/request/FollowIndexStatsRequestExample1.yaml +++ b/specification/ccr/follow_stats/examples/request/FollowIndexStatsRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/stats"' + - language: Java + code: | + client.ccr().followStats(f -> f + .index("follower_index") + ); diff --git a/specification/ccr/get_auto_follow_pattern/examples/request/GetAutoFollowPatternRequestExample1.yaml b/specification/ccr/get_auto_follow_pattern/examples/request/GetAutoFollowPatternRequestExample1.yaml index b75891fb3f..d126f18128 100644 --- a/specification/ccr/get_auto_follow_pattern/examples/request/GetAutoFollowPatternRequestExample1.yaml +++ b/specification/ccr/get_auto_follow_pattern/examples/request/GetAutoFollowPatternRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern"' + - language: Java + code: | + client.ccr().getAutoFollowPattern(g -> g + .name("my_auto_follow_pattern") + ); diff --git a/specification/ccr/pause_auto_follow_pattern/examples/request/PauseAutoFollowPatternRequestExample1.yaml b/specification/ccr/pause_auto_follow_pattern/examples/request/PauseAutoFollowPatternRequestExample1.yaml index dad3cd8753..82db91f81c 100644 --- a/specification/ccr/pause_auto_follow_pattern/examples/request/PauseAutoFollowPatternRequestExample1.yaml +++ b/specification/ccr/pause_auto_follow_pattern/examples/request/PauseAutoFollowPatternRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern/pause"' + - language: Java + code: | + client.ccr().pauseAutoFollowPattern(p -> p + .name("my_auto_follow_pattern") + ); diff --git a/specification/ccr/pause_follow/examples/request/PauseFollowIndexRequestExample1.yaml b/specification/ccr/pause_follow/examples/request/PauseFollowIndexRequestExample1.yaml index c93d2106cd..5decf80b2e 100644 --- a/specification/ccr/pause_follow/examples/request/PauseFollowIndexRequestExample1.yaml +++ b/specification/ccr/pause_follow/examples/request/PauseFollowIndexRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/pause_follow"' + - language: Java + code: | + client.ccr().pauseFollow(p -> p + .index("follower_index") + ); diff --git a/specification/ccr/resume_auto_follow_pattern/examples/request/ResumeAutoFollowPatternRequestExample1.yaml b/specification/ccr/resume_auto_follow_pattern/examples/request/ResumeAutoFollowPatternRequestExample1.yaml index b21568c755..0997854418 100644 --- a/specification/ccr/resume_auto_follow_pattern/examples/request/ResumeAutoFollowPatternRequestExample1.yaml +++ b/specification/ccr/resume_auto_follow_pattern/examples/request/ResumeAutoFollowPatternRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/auto_follow/my_auto_follow_pattern/resume"' + - language: Java + code: | + client.ccr().resumeAutoFollowPattern(r -> r + .name("my_auto_follow_pattern") + ); diff --git a/specification/ccr/stats/examples/request/CcrStatsRequestExample1.yaml b/specification/ccr/stats/examples/request/CcrStatsRequestExample1.yaml index 5742b395b3..86e1e570fe 100644 --- a/specification/ccr/stats/examples/request/CcrStatsRequestExample1.yaml +++ b/specification/ccr/stats/examples/request/CcrStatsRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->ccr()->stats(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ccr/stats"' + - language: Java + code: | + client.ccr().stats(s -> s); diff --git a/specification/ccr/unfollow/examples/request/UnfollowIndexRequestExample1.yaml b/specification/ccr/unfollow/examples/request/UnfollowIndexRequestExample1.yaml index 69e8e90a27..f18fb1b572 100644 --- a/specification/ccr/unfollow/examples/request/UnfollowIndexRequestExample1.yaml +++ b/specification/ccr/unfollow/examples/request/UnfollowIndexRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/follower_index/_ccr/unfollow"' + - language: Java + code: | + client.ccr().unfollow(u -> u + .index("follower_index") + ); diff --git a/specification/cluster/delete_component_template/examples/request/ClusterDeleteComponentTemplateExample1.yaml b/specification/cluster/delete_component_template/examples/request/ClusterDeleteComponentTemplateExample1.yaml index a28d273f76..f91d8553cd 100644 --- a/specification/cluster/delete_component_template/examples/request/ClusterDeleteComponentTemplateExample1.yaml +++ b/specification/cluster/delete_component_template/examples/request/ClusterDeleteComponentTemplateExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_component_template/template_1"' + - language: Java + code: | + client.cluster().deleteComponentTemplate(d -> d + .name("template_1") + ); diff --git a/specification/cluster/get_component_template/examples/request/ClusterGetComponentTemplateExample1.yaml b/specification/cluster/get_component_template/examples/request/ClusterGetComponentTemplateExample1.yaml index cf0077db27..1a1d3b2a26 100644 --- a/specification/cluster/get_component_template/examples/request/ClusterGetComponentTemplateExample1.yaml +++ b/specification/cluster/get_component_template/examples/request/ClusterGetComponentTemplateExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_component_template/template_1"' + - language: Java + code: | + client.cluster().getComponentTemplate(g -> g + .name("template_1") + ); diff --git a/specification/cluster/health/examples/request/ClusterHealthRequestExample1.yaml b/specification/cluster/health/examples/request/ClusterHealthRequestExample1.yaml index 22839770e7..41f150af6f 100644 --- a/specification/cluster/health/examples/request/ClusterHealthRequestExample1.yaml +++ b/specification/cluster/health/examples/request/ClusterHealthRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->cluster()->health(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/health"' + - language: Java + code: | + client.cluster().health(h -> h); diff --git a/specification/cluster/info/examples/request/ClusterInfoExample1.yaml b/specification/cluster/info/examples/request/ClusterInfoExample1.yaml index 40d1c505f5..3a1743a778 100644 --- a/specification/cluster/info/examples/request/ClusterInfoExample1.yaml +++ b/specification/cluster/info/examples/request/ClusterInfoExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_info/_all"' + - language: Java + code: | + client.cluster().info(i -> i + .target("_all") + ); diff --git a/specification/cluster/pending_tasks/examples/request/ClusterPendingTasksExample1.yaml b/specification/cluster/pending_tasks/examples/request/ClusterPendingTasksExample1.yaml index c02d6fe93d..2f04fc1aa5 100644 --- a/specification/cluster/pending_tasks/examples/request/ClusterPendingTasksExample1.yaml +++ b/specification/cluster/pending_tasks/examples/request/ClusterPendingTasksExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->cluster()->pendingTasks(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/pending_tasks"' + - language: Java + code: | + client.cluster().pendingTasks(p -> p); diff --git a/specification/connector/check_in/examples/request/ConnectorCheckInExample1.yaml b/specification/connector/check_in/examples/request/ConnectorCheckInExample1.yaml index bb73b7db78..d59b290297 100644 --- a/specification/connector/check_in/examples/request/ConnectorCheckInExample1.yaml +++ b/specification/connector/check_in/examples/request/ConnectorCheckInExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/my-connector/_check_in"' + - language: Java + code: | + client.connector().checkIn(c -> c + .connectorId("my-connector") + ); diff --git a/specification/connector/delete/examples/request/ConnectorDeleteExample1.yaml b/specification/connector/delete/examples/request/ConnectorDeleteExample1.yaml index ce02411841..dd538cd532 100644 --- a/specification/connector/delete/examples/request/ConnectorDeleteExample1.yaml +++ b/specification/connector/delete/examples/request/ConnectorDeleteExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/my-connector-id&delete_sync_jobs=true"' + - language: Java + code: | + client.connector().delete(d -> d + .connectorId("my-connector-id&delete_sync_jobs=true") + ); diff --git a/specification/connector/get/examples/request/ConnectorGetExample1.yaml b/specification/connector/get/examples/request/ConnectorGetExample1.yaml index 55771cbbec..0544a4d028 100644 --- a/specification/connector/get/examples/request/ConnectorGetExample1.yaml +++ b/specification/connector/get/examples/request/ConnectorGetExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/my-connector-id"' + - language: Java + code: | + client.connector().get(g -> g + .connectorId("my-connector-id") + ); diff --git a/specification/connector/list/examples/request/ConnectorListExample1.yaml b/specification/connector/list/examples/request/ConnectorListExample1.yaml index 2c4e374b6d..3225fec5b4 100644 --- a/specification/connector/list/examples/request/ConnectorListExample1.yaml +++ b/specification/connector/list/examples/request/ConnectorListExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->connector()->list(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector"' + - language: Java + code: | + client.connector().list(l -> l); diff --git a/specification/connector/sync_job_cancel/examples/request/ConnectorSyncJobCancelExample1.yaml b/specification/connector/sync_job_cancel/examples/request/ConnectorSyncJobCancelExample1.yaml index 639ce1ff0a..269b148b8d 100644 --- a/specification/connector/sync_job_cancel/examples/request/ConnectorSyncJobCancelExample1.yaml +++ b/specification/connector/sync_job_cancel/examples/request/ConnectorSyncJobCancelExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id/_cancel"' + - language: Java + code: | + client.connector().syncJobCancel(s -> s + .connectorSyncJobId("my-connector-sync-job-id") + ); diff --git a/specification/connector/sync_job_check_in/examples/request/ConnectorSyncJobCheckInExample1.yaml b/specification/connector/sync_job_check_in/examples/request/ConnectorSyncJobCheckInExample1.yaml index 2ab10a1706..a456522b3d 100644 --- a/specification/connector/sync_job_check_in/examples/request/ConnectorSyncJobCheckInExample1.yaml +++ b/specification/connector/sync_job_check_in/examples/request/ConnectorSyncJobCheckInExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_check_in"' + - language: Java + code: | + client.connector().syncJobCheckIn(s -> s + .connectorSyncJobId("my-connector-sync-job") + ); diff --git a/specification/connector/sync_job_delete/examples/request/ConnectorSyncJobDeleteExample1.yaml b/specification/connector/sync_job_delete/examples/request/ConnectorSyncJobDeleteExample1.yaml index ed442364fc..952eb3e2c7 100644 --- a/specification/connector/sync_job_delete/examples/request/ConnectorSyncJobDeleteExample1.yaml +++ b/specification/connector/sync_job_delete/examples/request/ConnectorSyncJobDeleteExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job-id"' + - language: Java + code: | + client.connector().syncJobDelete(s -> s + .connectorSyncJobId("my-connector-sync-job-id") + ); diff --git a/specification/connector/sync_job_get/examples/request/ConnectorSyncJobGetExample1.yaml b/specification/connector/sync_job_get/examples/request/ConnectorSyncJobGetExample1.yaml index c58ffc613c..7084d0c930 100644 --- a/specification/connector/sync_job_get/examples/request/ConnectorSyncJobGetExample1.yaml +++ b/specification/connector/sync_job_get/examples/request/ConnectorSyncJobGetExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job"' + - language: Java + code: | + client.connector().syncJobGet(s -> s + .connectorSyncJobId("my-connector-sync-job") + ); diff --git a/specification/connector/sync_job_list/examples/request/ConnectorSyncJobListExample1.yaml b/specification/connector/sync_job_list/examples/request/ConnectorSyncJobListExample1.yaml index 9ba177e1aa..6fcca5322d 100644 --- a/specification/connector/sync_job_list/examples/request/ConnectorSyncJobListExample1.yaml +++ b/specification/connector/sync_job_list/examples/request/ConnectorSyncJobListExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_connector/_sync_job?connector_id=my-connector-id&size=1"' + - language: Java + code: | + client.connector().syncJobList(s -> s + .connectorId("my-connector-id") + .size(1) + ); diff --git a/specification/dangling_indices/delete_dangling_index/examples/request/DanglingIndicesDeleteDanglingIndexExample1.yaml b/specification/dangling_indices/delete_dangling_index/examples/request/DanglingIndicesDeleteDanglingIndexExample1.yaml index 0115c77a22..7eed98bdd5 100644 --- a/specification/dangling_indices/delete_dangling_index/examples/request/DanglingIndicesDeleteDanglingIndexExample1.yaml +++ b/specification/dangling_indices/delete_dangling_index/examples/request/DanglingIndicesDeleteDanglingIndexExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_dangling/?accept_data_loss=true"' + - language: Java + code: | + client.danglingIndices().deleteDanglingIndex(d -> d + .acceptDataLoss(true) + .indexUuid("") + ); diff --git a/specification/dangling_indices/import_dangling_index/examples/request/ImportDanglingIndexRequestExample1.yaml b/specification/dangling_indices/import_dangling_index/examples/request/ImportDanglingIndexRequestExample1.yaml index e0ed43ba60..73a0e80570 100644 --- a/specification/dangling_indices/import_dangling_index/examples/request/ImportDanglingIndexRequestExample1.yaml +++ b/specification/dangling_indices/import_dangling_index/examples/request/ImportDanglingIndexRequestExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true"' + - language: Java + code: | + client.danglingIndices().importDanglingIndex(i -> i + .acceptDataLoss(true) + .indexUuid("zmM4e0JtBkeUjiHD-MihPQ") + ); diff --git a/specification/enrich/delete_policy/examples/request/EnrichDeletePolicyExample1.yaml b/specification/enrich/delete_policy/examples/request/EnrichDeletePolicyExample1.yaml index 70a5f98a04..9e4c2bd34d 100644 --- a/specification/enrich/delete_policy/examples/request/EnrichDeletePolicyExample1.yaml +++ b/specification/enrich/delete_policy/examples/request/EnrichDeletePolicyExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/policy/my-policy"' + - language: Java + code: | + client.enrich().deletePolicy(d -> d + .name("my-policy") + ); diff --git a/specification/enrich/execute_policy/examples/request/EnrichExecutePolicyExample1.yaml b/specification/enrich/execute_policy/examples/request/EnrichExecutePolicyExample1.yaml index 0bc44deee6..f40627c600 100644 --- a/specification/enrich/execute_policy/examples/request/EnrichExecutePolicyExample1.yaml +++ b/specification/enrich/execute_policy/examples/request/EnrichExecutePolicyExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/policy/my-policy/_execute?wait_for_completion=false"' + - language: Java + code: | + client.enrich().executePolicy(e -> e + .name("my-policy") + .waitForCompletion(false) + ); diff --git a/specification/enrich/get_policy/examples/request/EnrichGetPolicyExample1.yaml b/specification/enrich/get_policy/examples/request/EnrichGetPolicyExample1.yaml index 6f646dbb1e..6b65081130 100644 --- a/specification/enrich/get_policy/examples/request/EnrichGetPolicyExample1.yaml +++ b/specification/enrich/get_policy/examples/request/EnrichGetPolicyExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/policy/my-policy"' + - language: Java + code: | + client.enrich().getPolicy(g -> g + .name("my-policy") + ); diff --git a/specification/enrich/stats/examples/request/EnrichStatsExample1.yaml b/specification/enrich/stats/examples/request/EnrichStatsExample1.yaml index 14e6dc80c4..2140bee357 100644 --- a/specification/enrich/stats/examples/request/EnrichStatsExample1.yaml +++ b/specification/enrich/stats/examples/request/EnrichStatsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->enrich()->stats(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_enrich/_stats"' + - language: Java + code: | + client.enrich().stats(s -> s); diff --git a/specification/eql/delete/examples/request/EqlDeleteExample1.yaml b/specification/eql/delete/examples/request/EqlDeleteExample1.yaml index ff790cd876..f5ca2d035c 100644 --- a/specification/eql/delete/examples/request/EqlDeleteExample1.yaml +++ b/specification/eql/delete/examples/request/EqlDeleteExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE="' + - language: Java + code: | + client.eql().delete(d -> d + .id("FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=") + ); diff --git a/specification/eql/get/examples/request/EqlGetExample1.yaml b/specification/eql/get/examples/request/EqlGetExample1.yaml index 0b57defa83..05c5ee4fa7 100644 --- a/specification/eql/get/examples/request/EqlGetExample1.yaml +++ b/specification/eql/get/examples/request/EqlGetExample1.yaml @@ -27,3 +27,11 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_eql/search/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?wait_for_completion_timeout=2s"' + - language: Java + code: | + client.eql().get(g -> g + .id("FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=") + .waitForCompletionTimeout(w -> w + .offset(2) + ) + ); diff --git a/specification/eql/get_status/examples/request/EqlGetStatusExample1.yaml b/specification/eql/get_status/examples/request/EqlGetStatusExample1.yaml index 3f3f49ccfb..fdb02017f1 100644 --- a/specification/eql/get_status/examples/request/EqlGetStatusExample1.yaml +++ b/specification/eql/get_status/examples/request/EqlGetStatusExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE="' + - language: Java + code: | + client.eql().getStatus(g -> g + .id("FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=") + ); diff --git a/specification/features/get_features/examples/request/FeaturesGetFeaturesExample1.yaml b/specification/features/get_features/examples/request/FeaturesGetFeaturesExample1.yaml index 8ecfcd3ac2..889bca2126 100644 --- a/specification/features/get_features/examples/request/FeaturesGetFeaturesExample1.yaml +++ b/specification/features/get_features/examples/request/FeaturesGetFeaturesExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->features()->getFeatures(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_features"' + - language: Java + code: | + client.features().getFeatures(g -> g); diff --git a/specification/features/reset_features/examples/request/FeaturesResetFeaturesExample1.yaml b/specification/features/reset_features/examples/request/FeaturesResetFeaturesExample1.yaml index f34d9b2fd4..a3d904d097 100644 --- a/specification/features/reset_features/examples/request/FeaturesResetFeaturesExample1.yaml +++ b/specification/features/reset_features/examples/request/FeaturesResetFeaturesExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->features()->resetFeatures(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_features/_reset"' + - language: Java + code: | + client.features().resetFeatures(r -> r); diff --git a/specification/ilm/delete_lifecycle/examples/request/IlmDeleteLifecycleExample1.yaml b/specification/ilm/delete_lifecycle/examples/request/IlmDeleteLifecycleExample1.yaml index e2ae7caa99..4b9972d511 100644 --- a/specification/ilm/delete_lifecycle/examples/request/IlmDeleteLifecycleExample1.yaml +++ b/specification/ilm/delete_lifecycle/examples/request/IlmDeleteLifecycleExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/policy/my_policy"' + - language: Java + code: | + client.ilm().deleteLifecycle(d -> d + .name("my_policy") + ); diff --git a/specification/ilm/explain_lifecycle/examples/request/IlmExplainLifecycleExample1.yaml b/specification/ilm/explain_lifecycle/examples/request/IlmExplainLifecycleExample1.yaml index e3aca7ca86..557b998508 100644 --- a/specification/ilm/explain_lifecycle/examples/request/IlmExplainLifecycleExample1.yaml +++ b/specification/ilm/explain_lifecycle/examples/request/IlmExplainLifecycleExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-timeseries-*/_ilm/explain"' + - language: Java + code: | + client.ilm().explainLifecycle(e -> e + .index(".ds-timeseries-*") + ); diff --git a/specification/ilm/get_lifecycle/examples/request/IlmGetLifecycleExample1.yaml b/specification/ilm/get_lifecycle/examples/request/IlmGetLifecycleExample1.yaml index 8692b0b198..3edcdf6b96 100644 --- a/specification/ilm/get_lifecycle/examples/request/IlmGetLifecycleExample1.yaml +++ b/specification/ilm/get_lifecycle/examples/request/IlmGetLifecycleExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/policy/my_policy"' + - language: Java + code: | + client.ilm().getLifecycle(g -> g + .name("my_policy") + ); diff --git a/specification/ilm/remove_policy/examples/request/IlmRemovePolicyExample1.yaml b/specification/ilm/remove_policy/examples/request/IlmRemovePolicyExample1.yaml index 3631b25f43..0b11ffa213 100644 --- a/specification/ilm/remove_policy/examples/request/IlmRemovePolicyExample1.yaml +++ b/specification/ilm/remove_policy/examples/request/IlmRemovePolicyExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/logs-my_app-default/_ilm/remove"' + - language: Java + code: | + client.ilm().removePolicy(r -> r + .index("logs-my_app-default") + ); diff --git a/specification/ilm/retry/examples/request/IlmRetryExample1.yaml b/specification/ilm/retry/examples/request/IlmRetryExample1.yaml index d79c781951..29d2f46f7f 100644 --- a/specification/ilm/retry/examples/request/IlmRetryExample1.yaml +++ b/specification/ilm/retry/examples/request/IlmRetryExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_ilm/retry"' + - language: Java + code: | + client.ilm().retry(r -> r + .index("my-index-000001") + ); diff --git a/specification/ilm/start/examples/request/IlmStartExample1.yaml b/specification/ilm/start/examples/request/IlmStartExample1.yaml index ace35b513b..6d60168689 100644 --- a/specification/ilm/start/examples/request/IlmStartExample1.yaml +++ b/specification/ilm/start/examples/request/IlmStartExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->ilm()->start(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/start"' + - language: Java + code: | + client.ilm().start(s -> s); diff --git a/specification/ilm/stop/examples/request/IlmStopExample1.yaml b/specification/ilm/stop/examples/request/IlmStopExample1.yaml index f86f73a637..a6e9d761ea 100644 --- a/specification/ilm/stop/examples/request/IlmStopExample1.yaml +++ b/specification/ilm/stop/examples/request/IlmStopExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->ilm()->stop(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/stop"' + - language: Java + code: | + client.ilm().stop(s -> s); diff --git a/specification/indices/add_block/examples/request/IndicesAddBlockRequestExample1.yaml b/specification/indices/add_block/examples/request/IndicesAddBlockRequestExample1.yaml index b937155de0..36d131f1c3 100644 --- a/specification/indices/add_block/examples/request/IndicesAddBlockRequestExample1.yaml +++ b/specification/indices/add_block/examples/request/IndicesAddBlockRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_block/write"' + - language: Java + code: | + client.indices().addBlock(a -> a + .block(IndicesBlockOptions.Write) + .index("my-index-000001") + ); diff --git a/specification/indices/cancel_migrate_reindex/examples/request/IndicesCancelMigrateReindexExample1.yaml b/specification/indices/cancel_migrate_reindex/examples/request/IndicesCancelMigrateReindexExample1.yaml index adf1934ca2..82ff4ca99a 100644 --- a/specification/indices/cancel_migrate_reindex/examples/request/IndicesCancelMigrateReindexExample1.yaml +++ b/specification/indices/cancel_migrate_reindex/examples/request/IndicesCancelMigrateReindexExample1.yaml @@ -29,3 +29,8 @@ alternatives: $resp = $client->sendRequest($request); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/reindex/my-data-stream/_cancel"' + - language: Java + code: | + client.indices().cancelMigrateReindex(c -> c + .index("my-data-stream") + ); diff --git a/specification/indices/clear_cache/examples/request/IndicesClearCacheExample1.yaml b/specification/indices/clear_cache/examples/request/IndicesClearCacheExample1.yaml index 12de120f11..d89adee41d 100644 --- a/specification/indices/clear_cache/examples/request/IndicesClearCacheExample1.yaml +++ b/specification/indices/clear_cache/examples/request/IndicesClearCacheExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_cache/clear?request=true"' + - language: Java + code: | + client.indices().clearCache(c -> c + .index(List.of("my-index-000001","my-index-000002")) + .request(true) + ); diff --git a/specification/indices/close/examples/request/CloseIndexRequestExample1.yaml b/specification/indices/close/examples/request/CloseIndexRequestExample1.yaml index 7f59d1dcb4..b5a6c3af96 100644 --- a/specification/indices/close/examples/request/CloseIndexRequestExample1.yaml +++ b/specification/indices/close/examples/request/CloseIndexRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-00001/_close"' + - language: Java + code: | + client.indices().close(c -> c + .index("my-index-00001") + ); diff --git a/specification/indices/create_data_stream/examples/request/IndicesCreateDataStreamExample1.yaml b/specification/indices/create_data_stream/examples/request/IndicesCreateDataStreamExample1.yaml index 381f6c9204..362a407597 100644 --- a/specification/indices/create_data_stream/examples/request/IndicesCreateDataStreamExample1.yaml +++ b/specification/indices/create_data_stream/examples/request/IndicesCreateDataStreamExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/logs-foo-bar"' + - language: Java + code: | + client.indices().createDataStream(c -> c + .name("logs-foo-bar") + ); diff --git a/specification/indices/data_streams_stats/examples/request/indicesDataStreamStatsExampleRequest1.yaml b/specification/indices/data_streams_stats/examples/request/indicesDataStreamStatsExampleRequest1.yaml index afe624c950..cfb4c81934 100644 --- a/specification/indices/data_streams_stats/examples/request/indicesDataStreamStatsExampleRequest1.yaml +++ b/specification/indices/data_streams_stats/examples/request/indicesDataStreamStatsExampleRequest1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-index-000001/_stats"' + - language: Java + code: | + client.indices().dataStreamsStats(d -> d + .name("my-index-000001") + ); diff --git a/specification/indices/delete/examples/request/IndicesDeleteExample1.yaml b/specification/indices/delete/examples/request/IndicesDeleteExample1.yaml index dbd2f4209f..2efde91aea 100644 --- a/specification/indices/delete/examples/request/IndicesDeleteExample1.yaml +++ b/specification/indices/delete/examples/request/IndicesDeleteExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/books"' + - language: Java + code: | + client.indices().delete(d -> d + .index("books") + ); diff --git a/specification/indices/delete_alias/examples/request/IndicesDeleteAliasExample1.yaml b/specification/indices/delete_alias/examples/request/IndicesDeleteAliasExample1.yaml index 715ab402c6..324267982c 100644 --- a/specification/indices/delete_alias/examples/request/IndicesDeleteAliasExample1.yaml +++ b/specification/indices/delete_alias/examples/request/IndicesDeleteAliasExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-data-stream/_alias/my-alias"' + - language: Java + code: | + client.indices().deleteAlias(d -> d + .index("my-data-stream") + .name("my-alias") + ); diff --git a/specification/indices/delete_data_lifecycle/examples/request/IndicesDeleteDataLifecycleExample1.yaml b/specification/indices/delete_data_lifecycle/examples/request/IndicesDeleteDataLifecycleExample1.yaml index 541c77fd45..214e4d8f28 100644 --- a/specification/indices/delete_data_lifecycle/examples/request/IndicesDeleteDataLifecycleExample1.yaml +++ b/specification/indices/delete_data_lifecycle/examples/request/IndicesDeleteDataLifecycleExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_lifecycle"' + - language: Java + code: | + client.indices().deleteDataLifecycle(d -> d + .name("my-data-stream") + ); diff --git a/specification/indices/delete_data_stream/examples/request/IndicesDeleteDataStreamExample1.yaml b/specification/indices/delete_data_stream/examples/request/IndicesDeleteDataStreamExample1.yaml index 5244a60926..4f0ec82e65 100644 --- a/specification/indices/delete_data_stream/examples/request/IndicesDeleteDataStreamExample1.yaml +++ b/specification/indices/delete_data_stream/examples/request/IndicesDeleteDataStreamExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream"' + - language: Java + code: | + client.indices().deleteDataStream(d -> d + .name("my-data-stream") + ); diff --git a/specification/indices/delete_index_template/examples/request/IndicesDeleteIndexTemplateExample1.yaml b/specification/indices/delete_index_template/examples/request/IndicesDeleteIndexTemplateExample1.yaml index 8d1801cfc3..06e38bf583 100644 --- a/specification/indices/delete_index_template/examples/request/IndicesDeleteIndexTemplateExample1.yaml +++ b/specification/indices/delete_index_template/examples/request/IndicesDeleteIndexTemplateExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_index_template/my-index-template"' + - language: Java + code: | + client.indices().deleteIndexTemplate(d -> d + .name("my-index-template") + ); diff --git a/specification/indices/delete_template/examples/request/IndicesDeleteTemplateExample1.yaml b/specification/indices/delete_template/examples/request/IndicesDeleteTemplateExample1.yaml index 774ae1a650..5c8c54e4c2 100644 --- a/specification/indices/delete_template/examples/request/IndicesDeleteTemplateExample1.yaml +++ b/specification/indices/delete_template/examples/request/IndicesDeleteTemplateExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_template/.cloud-hot-warm-allocation-0"' + - language: Java + code: | + client.indices().deleteTemplate(d -> d + .name(".cloud-hot-warm-allocation-0") + ); diff --git a/specification/indices/disk_usage/examples/request/IndicesDiskUsageExample1.yaml b/specification/indices/disk_usage/examples/request/IndicesDiskUsageExample1.yaml index 4eb8dcd3ae..ced06c4ac5 100644 --- a/specification/indices/disk_usage/examples/request/IndicesDiskUsageExample1.yaml +++ b/specification/indices/disk_usage/examples/request/IndicesDiskUsageExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_disk_usage?run_expensive_tasks=true"' + - language: Java + code: | + client.indices().diskUsage(d -> d + .index("my-index-000001") + .runExpensiveTasks(true) + ); diff --git a/specification/indices/exists/examples/request/IndicesExistsExample1.yaml b/specification/indices/exists/examples/request/IndicesExistsExample1.yaml index 9c3c4c6d6b..3057e6e4ef 100644 --- a/specification/indices/exists/examples/request/IndicesExistsExample1.yaml +++ b/specification/indices/exists/examples/request/IndicesExistsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-data-stream"' + - language: Java + code: | + client.indices().exists(e -> e + .index("my-data-stream") + ); diff --git a/specification/indices/exists_alias/examples/request/IndicesExistsAliasExample1.yaml b/specification/indices/exists_alias/examples/request/IndicesExistsAliasExample1.yaml index 55c2255191..588a651b36 100644 --- a/specification/indices/exists_alias/examples/request/IndicesExistsAliasExample1.yaml +++ b/specification/indices/exists_alias/examples/request/IndicesExistsAliasExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_alias/my-alias"' + - language: Java + code: | + client.indices().existsAlias(e -> e + .name("my-alias") + ); diff --git a/specification/indices/exists_template/examples/request/IndicesExistsTemplateExample1.yaml b/specification/indices/exists_template/examples/request/IndicesExistsTemplateExample1.yaml index c732d65f0c..d6e6c4ec97 100644 --- a/specification/indices/exists_template/examples/request/IndicesExistsTemplateExample1.yaml +++ b/specification/indices/exists_template/examples/request/IndicesExistsTemplateExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl --head -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_template/template_1"' + - language: Java + code: | + client.indices().existsTemplate(e -> e + .name("template_1") + ); diff --git a/specification/indices/explain_data_lifecycle/examples/request/IndicesExplainDataLifecycleRequestExample1.yaml b/specification/indices/explain_data_lifecycle/examples/request/IndicesExplainDataLifecycleRequestExample1.yaml index 62595ee606..70edef69ba 100644 --- a/specification/indices/explain_data_lifecycle/examples/request/IndicesExplainDataLifecycleRequestExample1.yaml +++ b/specification/indices/explain_data_lifecycle/examples/request/IndicesExplainDataLifecycleRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-metrics-2023.03.22-000001/_lifecycle/explain"' + - language: Java + code: | + client.indices().explainDataLifecycle(e -> e + .index(".ds-metrics-2023.03.22-000001") + ); diff --git a/specification/indices/field_usage_stats/examples/request/indicesFieldUsageStatsRequestExample1.yaml b/specification/indices/field_usage_stats/examples/request/indicesFieldUsageStatsRequestExample1.yaml index cb139183ec..c78280cf5d 100644 --- a/specification/indices/field_usage_stats/examples/request/indicesFieldUsageStatsRequestExample1.yaml +++ b/specification/indices/field_usage_stats/examples/request/indicesFieldUsageStatsRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_field_usage_stats"' + - language: Java + code: | + client.indices().fieldUsageStats(f -> f + .index("my-index-000001") + ); diff --git a/specification/indices/flush/examples/request/IndicesFlushExample1.yaml b/specification/indices/flush/examples/request/IndicesFlushExample1.yaml index 3cbf78227f..940efa87b2 100644 --- a/specification/indices/flush/examples/request/IndicesFlushExample1.yaml +++ b/specification/indices/flush/examples/request/IndicesFlushExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->indices()->flush(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_flush"' + - language: Java + code: | + client.indices().flush(f -> f); diff --git a/specification/indices/forcemerge/examples/request/IndicesForcemergeExample1.yaml b/specification/indices/forcemerge/examples/request/IndicesForcemergeExample1.yaml index f02c9c6773..71d8738284 100644 --- a/specification/indices/forcemerge/examples/request/IndicesForcemergeExample1.yaml +++ b/specification/indices/forcemerge/examples/request/IndicesForcemergeExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_forcemerge"' + - language: Java + code: | + client.indices().forcemerge(f -> f + .index("my-index-000001") + ); diff --git a/specification/indices/get/examples/request/IndicesGetExample1.yaml b/specification/indices/get/examples/request/IndicesGetExample1.yaml index 820e8fe128..b8ba008109 100644 --- a/specification/indices/get/examples/request/IndicesGetExample1.yaml +++ b/specification/indices/get/examples/request/IndicesGetExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001"' + - language: Java + code: | + client.indices().get(g -> g + .index("my-index-000001") + ); diff --git a/specification/indices/get_alias/examples/request/IndicesGetAliasExample1.yaml b/specification/indices/get_alias/examples/request/IndicesGetAliasExample1.yaml index aefb2d2847..9cca21eb0a 100644 --- a/specification/indices/get_alias/examples/request/IndicesGetAliasExample1.yaml +++ b/specification/indices/get_alias/examples/request/IndicesGetAliasExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->indices()->getAlias(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_alias"' + - language: Java + code: | + client.indices().getAlias(g -> g); diff --git a/specification/indices/get_data_stream/examples/request/IndicesGetDataStreamExample1.yaml b/specification/indices/get_data_stream/examples/request/IndicesGetDataStreamExample1.yaml index 9696c5af3d..b916d55d00 100644 --- a/specification/indices/get_data_stream/examples/request/IndicesGetDataStreamExample1.yaml +++ b/specification/indices/get_data_stream/examples/request/IndicesGetDataStreamExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/my-data-stream"' + - language: Java + code: | + client.indices().getDataStream(g -> g + .name("my-data-stream") + ); diff --git a/specification/indices/get_field_mapping/examples/request/indicesGetFieldMappingRequestExample1.yaml b/specification/indices/get_field_mapping/examples/request/indicesGetFieldMappingRequestExample1.yaml index 179c887e6c..a32f9f8faa 100644 --- a/specification/indices/get_field_mapping/examples/request/indicesGetFieldMappingRequestExample1.yaml +++ b/specification/indices/get_field_mapping/examples/request/indicesGetFieldMappingRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/publications/_mapping/field/title"' + - language: Java + code: | + client.indices().getFieldMapping(g -> g + .fields("title") + .index("publications") + ); diff --git a/specification/indices/get_mapping/examples/request/IndicesGetMappingExample1.yaml b/specification/indices/get_mapping/examples/request/IndicesGetMappingExample1.yaml index cc9fa61863..358862d9dd 100644 --- a/specification/indices/get_mapping/examples/request/IndicesGetMappingExample1.yaml +++ b/specification/indices/get_mapping/examples/request/IndicesGetMappingExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/books/_mapping"' + - language: Java + code: | + client.indices().getMapping(g -> g + .index("books") + ); diff --git a/specification/indices/get_migrate_reindex_status/examples/request/IndicesGetMigrateReindexStatusExample1.yaml b/specification/indices/get_migrate_reindex_status/examples/request/IndicesGetMigrateReindexStatusExample1.yaml index cadf516fe8..6448a60755 100644 --- a/specification/indices/get_migrate_reindex_status/examples/request/IndicesGetMigrateReindexStatusExample1.yaml +++ b/specification/indices/get_migrate_reindex_status/examples/request/IndicesGetMigrateReindexStatusExample1.yaml @@ -29,3 +29,8 @@ alternatives: $resp = $client->sendRequest($request); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/reindex/my-data-stream/_status"' + - language: Java + code: | + client.indices().getMigrateReindexStatus(g -> g + .index("my-data-stream") + ); diff --git a/specification/indices/get_template/examples/request/IndicesGetTemplateExample1.yaml b/specification/indices/get_template/examples/request/IndicesGetTemplateExample1.yaml index b9c1920c34..2c322ad186 100644 --- a/specification/indices/get_template/examples/request/IndicesGetTemplateExample1.yaml +++ b/specification/indices/get_template/examples/request/IndicesGetTemplateExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_template/.monitoring-*"' + - language: Java + code: | + client.indices().getTemplate(g -> g + .name(".monitoring-*") + ); diff --git a/specification/indices/migrate_to_data_stream/examples/request/IndicesMigrateToDataStreamExample1.yaml b/specification/indices/migrate_to_data_stream/examples/request/IndicesMigrateToDataStreamExample1.yaml index 4d4d4ac6b5..1a3c470182 100644 --- a/specification/indices/migrate_to_data_stream/examples/request/IndicesMigrateToDataStreamExample1.yaml +++ b/specification/indices/migrate_to_data_stream/examples/request/IndicesMigrateToDataStreamExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/_migrate/my-time-series-data"' + - language: Java + code: | + client.indices().migrateToDataStream(m -> m + .name("my-time-series-data") + ); diff --git a/specification/indices/open/examples/request/IndicesOpenExample1.yaml b/specification/indices/open/examples/request/IndicesOpenExample1.yaml index 2f29a478b3..059e3e98d9 100644 --- a/specification/indices/open/examples/request/IndicesOpenExample1.yaml +++ b/specification/indices/open/examples/request/IndicesOpenExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-my-data-stream-2099.03.07-000001/_open/"' + - language: Java + code: | + client.indices().open(o -> o + .index(".ds-my-data-stream-2099.03.07-000001") + ); diff --git a/specification/indices/promote_data_stream/examples/request/IndicesPromoteDataStreamExample1.yaml b/specification/indices/promote_data_stream/examples/request/IndicesPromoteDataStreamExample1.yaml index 7bf69c90f5..bc45cf8e8c 100644 --- a/specification/indices/promote_data_stream/examples/request/IndicesPromoteDataStreamExample1.yaml +++ b/specification/indices/promote_data_stream/examples/request/IndicesPromoteDataStreamExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_data_stream/_promote/my-data-stream"' + - language: Java + code: | + client.indices().promoteDataStream(p -> p + .name("my-data-stream") + ); diff --git a/specification/indices/refresh/examples/request/IndicesRefreshExample1.yaml b/specification/indices/refresh/examples/request/IndicesRefreshExample1.yaml index b0284a5b50..6bf8e51e55 100644 --- a/specification/indices/refresh/examples/request/IndicesRefreshExample1.yaml +++ b/specification/indices/refresh/examples/request/IndicesRefreshExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->indices()->refresh(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_refresh"' + - language: Java + code: | + client.indices().refresh(r -> r); diff --git a/specification/indices/resolve_cluster/examples/request/ResolveClusterRequestExample2.yaml b/specification/indices/resolve_cluster/examples/request/ResolveClusterRequestExample2.yaml index 48839e88f2..cc59dab2b7 100644 --- a/specification/indices/resolve_cluster/examples/request/ResolveClusterRequestExample2.yaml +++ b/specification/indices/resolve_cluster/examples/request/ResolveClusterRequestExample2.yaml @@ -31,3 +31,12 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_resolve/cluster/not-present,clust*:my-index*,oldcluster:*?ignore_unavailable=false&timeout=5s"' + - language: Java + code: | + client.indices().resolveCluster(r -> r + .ignoreUnavailable(false) + .name(List.of("not-present","clust*:my-index*","oldcluster:*")) + .timeout(t -> t + .offset(5) + ) + ); diff --git a/specification/indices/segments/examples/request/IndicesSegmentsExample1.yaml b/specification/indices/segments/examples/request/IndicesSegmentsExample1.yaml index 61c8486e65..e5db498865 100644 --- a/specification/indices/segments/examples/request/IndicesSegmentsExample1.yaml +++ b/specification/indices/segments/examples/request/IndicesSegmentsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_segments"' + - language: Java + code: | + client.indices().segments(s -> s + .index("my-index-000001") + ); diff --git a/specification/indices/simulate_index_template/examples/request/indicesSimulateIndexTemplateRequestExample1.yaml b/specification/indices/simulate_index_template/examples/request/indicesSimulateIndexTemplateRequestExample1.yaml index b915b63de5..3fa8a53a8f 100644 --- a/specification/indices/simulate_index_template/examples/request/indicesSimulateIndexTemplateRequestExample1.yaml +++ b/specification/indices/simulate_index_template/examples/request/indicesSimulateIndexTemplateRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_index_template/_simulate_index/my-index-000001"' + - language: Java + code: | + client.indices().simulateIndexTemplate(s -> s + .name("my-index-000001") + ); diff --git a/specification/inference/delete/examples/request/InferenceDeleteExample1.yaml b/specification/inference/delete/examples/request/InferenceDeleteExample1.yaml index c018b74833..d564f5d781 100644 --- a/specification/inference/delete/examples/request/InferenceDeleteExample1.yaml +++ b/specification/inference/delete/examples/request/InferenceDeleteExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' + - language: Java + code: | + client.inference().delete(d -> d + .inferenceId("my-elser-model") + .taskType(TaskType.SparseEmbedding) + ); diff --git a/specification/inference/get/examples/request/InferenceGetExample1.yaml b/specification/inference/get/examples/request/InferenceGetExample1.yaml index 422256a532..119fddbce6 100644 --- a/specification/inference/get/examples/request/InferenceGetExample1.yaml +++ b/specification/inference/get/examples/request/InferenceGetExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model"' + - language: Java + code: | + client.inference().get(g -> g + .inferenceId("my-elser-model") + .taskType(TaskType.SparseEmbedding) + ); diff --git a/specification/ingest/delete_ip_location_database/examples/request/IngestDeleteIpLocationDatabaseExample1.yaml b/specification/ingest/delete_ip_location_database/examples/request/IngestDeleteIpLocationDatabaseExample1.yaml index b6b9b5ac16..7833a861f8 100644 --- a/specification/ingest/delete_ip_location_database/examples/request/IngestDeleteIpLocationDatabaseExample1.yaml +++ b/specification/ingest/delete_ip_location_database/examples/request/IngestDeleteIpLocationDatabaseExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id"' + - language: Java + code: | + client.ingest().deleteIpLocationDatabase(d -> d + .id("my-database-id") + ); diff --git a/specification/ingest/delete_pipeline/examples/request/IngestDeletePipelineExample1.yaml b/specification/ingest/delete_pipeline/examples/request/IngestDeletePipelineExample1.yaml index f2486475f3..44a8d29b1d 100644 --- a/specification/ingest/delete_pipeline/examples/request/IngestDeletePipelineExample1.yaml +++ b/specification/ingest/delete_pipeline/examples/request/IngestDeletePipelineExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' + - language: Java + code: | + client.ingest().deletePipeline(d -> d + .id("my-pipeline-id") + ); diff --git a/specification/ingest/get_ip_location_database/examples/request/IngestGetIpLocationDatabaseExample1.yaml b/specification/ingest/get_ip_location_database/examples/request/IngestGetIpLocationDatabaseExample1.yaml index 8fad8e7b13..f98b84a82b 100644 --- a/specification/ingest/get_ip_location_database/examples/request/IngestGetIpLocationDatabaseExample1.yaml +++ b/specification/ingest/get_ip_location_database/examples/request/IngestGetIpLocationDatabaseExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/ip_location/database/my-database-id"' + - language: Java + code: | + client.ingest().getIpLocationDatabase(g -> g + .id("my-database-id") + ); diff --git a/specification/ingest/get_pipeline/examples/request/IngestGetPipelineExample1.yaml b/specification/ingest/get_pipeline/examples/request/IngestGetPipelineExample1.yaml index 55cf1bbe3e..c6f7c83427 100644 --- a/specification/ingest/get_pipeline/examples/request/IngestGetPipelineExample1.yaml +++ b/specification/ingest/get_pipeline/examples/request/IngestGetPipelineExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/pipeline/my-pipeline-id"' + - language: Java + code: | + client.ingest().getPipeline(g -> g + .id("my-pipeline-id") + ); diff --git a/specification/license/delete/examples/request/LicenseDeleteExample1.yaml b/specification/license/delete/examples/request/LicenseDeleteExample1.yaml index c1611f8255..ce4cb5d47e 100644 --- a/specification/license/delete/examples/request/LicenseDeleteExample1.yaml +++ b/specification/license/delete/examples/request/LicenseDeleteExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->license()->delete(); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license"' + - language: Java + code: | + client.license().delete(d -> d); diff --git a/specification/license/get/examples/request/GetLicenseRequestExample1.yaml b/specification/license/get/examples/request/GetLicenseRequestExample1.yaml index 53c3e2040e..51d9b71891 100644 --- a/specification/license/get/examples/request/GetLicenseRequestExample1.yaml +++ b/specification/license/get/examples/request/GetLicenseRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->license()->get(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license"' + - language: Java + code: | + client.license().get(g -> g); diff --git a/specification/license/post_start_basic/examples/request/StartBasicLicenseRequestExample1.yaml b/specification/license/post_start_basic/examples/request/StartBasicLicenseRequestExample1.yaml index eb27707a91..a0149dd9c2 100644 --- a/specification/license/post_start_basic/examples/request/StartBasicLicenseRequestExample1.yaml +++ b/specification/license/post_start_basic/examples/request/StartBasicLicenseRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license/start_basic?acknowledge=true"' + - language: Java + code: | + client.license().postStartBasic(p -> p + .acknowledge(true) + ); diff --git a/specification/license/post_start_trial/examples/request/StartTrialLicenseRequestExample1.yaml b/specification/license/post_start_trial/examples/request/StartTrialLicenseRequestExample1.yaml index 2411502283..f1b78f3017 100644 --- a/specification/license/post_start_trial/examples/request/StartTrialLicenseRequestExample1.yaml +++ b/specification/license/post_start_trial/examples/request/StartTrialLicenseRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_license/start_trial?acknowledge=true"' + - language: Java + code: | + client.license().postStartTrial(p -> p + .acknowledge(true) + ); diff --git a/specification/logstash/delete_pipeline/examples/request/LogstashDeletePipelineExample1.yaml b/specification/logstash/delete_pipeline/examples/request/LogstashDeletePipelineExample1.yaml index c793028c93..db91116ca7 100644 --- a/specification/logstash/delete_pipeline/examples/request/LogstashDeletePipelineExample1.yaml +++ b/specification/logstash/delete_pipeline/examples/request/LogstashDeletePipelineExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline"' + - language: Java + code: | + client.logstash().deletePipeline(d -> d + .id("my_pipeline") + ); diff --git a/specification/logstash/get_pipeline/examples/request/LogstashGetPipelineRequestExample1.yaml b/specification/logstash/get_pipeline/examples/request/LogstashGetPipelineRequestExample1.yaml index 23ff9fd973..2bb607e259 100644 --- a/specification/logstash/get_pipeline/examples/request/LogstashGetPipelineRequestExample1.yaml +++ b/specification/logstash/get_pipeline/examples/request/LogstashGetPipelineRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_logstash/pipeline/my_pipeline"' + - language: Java + code: | + client.logstash().getPipeline(g -> g + .id("my_pipeline") + ); diff --git a/specification/migration/deprecations/examples/request/DeprecationInfoRequestExample1.yaml b/specification/migration/deprecations/examples/request/DeprecationInfoRequestExample1.yaml index 08f30c58e7..27c0809baf 100644 --- a/specification/migration/deprecations/examples/request/DeprecationInfoRequestExample1.yaml +++ b/specification/migration/deprecations/examples/request/DeprecationInfoRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->migration()->deprecations(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_migration/deprecations"' + - language: Java + code: | + client.migration().deprecations(d -> d); diff --git a/specification/ml/clear_trained_model_deployment_cache/examples/request/MlClearTrainedModelDeploymentCacheExample1.yaml b/specification/ml/clear_trained_model_deployment_cache/examples/request/MlClearTrainedModelDeploymentCacheExample1.yaml index 63aeff030e..0ace54f7d1 100644 --- a/specification/ml/clear_trained_model_deployment_cache/examples/request/MlClearTrainedModelDeploymentCacheExample1.yaml +++ b/specification/ml/clear_trained_model_deployment_cache/examples/request/MlClearTrainedModelDeploymentCacheExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear"' + - language: Java + code: | + client.ml().clearTrainedModelDeploymentCache(c -> c + .modelId("elastic__distilbert-base-uncased-finetuned-conll03-english") + ); diff --git a/specification/ml/delete_calendar/examples/request/MlDeleteCalendarExample1.yaml b/specification/ml/delete_calendar/examples/request/MlDeleteCalendarExample1.yaml index 8a9ab8b4aa..37638332d8 100644 --- a/specification/ml/delete_calendar/examples/request/MlDeleteCalendarExample1.yaml +++ b/specification/ml/delete_calendar/examples/request/MlDeleteCalendarExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages"' + - language: Java + code: | + client.ml().deleteCalendar(d -> d + .calendarId("planned-outages") + ); diff --git a/specification/ml/delete_calendar_event/examples/request/MlDeleteCalendarEventExample1.yaml b/specification/ml/delete_calendar_event/examples/request/MlDeleteCalendarEventExample1.yaml index e50a61b676..d7a10a804e 100644 --- a/specification/ml/delete_calendar_event/examples/request/MlDeleteCalendarEventExample1.yaml +++ b/specification/ml/delete_calendar_event/examples/request/MlDeleteCalendarEventExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events/LS8LJGEBMTCMA-qz49st"' + - language: Java + code: | + client.ml().deleteCalendarEvent(d -> d + .calendarId("planned-outages") + .eventId("LS8LJGEBMTCMA-qz49st") + ); diff --git a/specification/ml/delete_calendar_job/examples/request/MlDeleteCalendarJobExample1.yaml b/specification/ml/delete_calendar_job/examples/request/MlDeleteCalendarJobExample1.yaml index 8fe533bded..266af51ca1 100644 --- a/specification/ml/delete_calendar_job/examples/request/MlDeleteCalendarJobExample1.yaml +++ b/specification/ml/delete_calendar_job/examples/request/MlDeleteCalendarJobExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests"' + - language: Java + code: | + client.ml().deleteCalendarJob(d -> d + .calendarId("planned-outages") + .jobId("total-requests") + ); diff --git a/specification/ml/delete_data_frame_analytics/examples/request/MlDeleteDataFrameAnalyticsExample1.yaml b/specification/ml/delete_data_frame_analytics/examples/request/MlDeleteDataFrameAnalyticsExample1.yaml index a30a894358..459170e7df 100644 --- a/specification/ml/delete_data_frame_analytics/examples/request/MlDeleteDataFrameAnalyticsExample1.yaml +++ b/specification/ml/delete_data_frame_analytics/examples/request/MlDeleteDataFrameAnalyticsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics"' + - language: Java + code: | + client.ml().deleteDataFrameAnalytics(d -> d + .id("loganalytics") + ); diff --git a/specification/ml/delete_datafeed/examples/request/MlDeleteDatafeedExample1.yaml b/specification/ml/delete_datafeed/examples/request/MlDeleteDatafeedExample1.yaml index a3cc1d7bb4..78477fc74b 100644 --- a/specification/ml/delete_datafeed/examples/request/MlDeleteDatafeedExample1.yaml +++ b/specification/ml/delete_datafeed/examples/request/MlDeleteDatafeedExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-total-requests"' + - language: Java + code: | + client.ml().deleteDatafeed(d -> d + .datafeedId("datafeed-total-requests") + ); diff --git a/specification/ml/delete_filter/examples/request/MlDeleteFilterExample1.yaml b/specification/ml/delete_filter/examples/request/MlDeleteFilterExample1.yaml index 1e9c7590f7..924e3c2703 100644 --- a/specification/ml/delete_filter/examples/request/MlDeleteFilterExample1.yaml +++ b/specification/ml/delete_filter/examples/request/MlDeleteFilterExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/filters/safe_domains"' + - language: Java + code: | + client.ml().deleteFilter(d -> d + .filterId("safe_domains") + ); diff --git a/specification/ml/delete_forecast/examples/request/MlDeleteForecastExample1.yaml b/specification/ml/delete_forecast/examples/request/MlDeleteForecastExample1.yaml index 710fdc91bf..255ae060a5 100644 --- a/specification/ml/delete_forecast/examples/request/MlDeleteForecastExample1.yaml +++ b/specification/ml/delete_forecast/examples/request/MlDeleteForecastExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_forecast/_all"' + - language: Java + code: | + client.ml().deleteForecast(d -> d + .forecastId("_all") + .jobId("total-requests") + ); diff --git a/specification/ml/delete_job/examples/request/MlDeleteJobExample1.yaml b/specification/ml/delete_job/examples/request/MlDeleteJobExample1.yaml index 55792ccb41..24a5c26e29 100644 --- a/specification/ml/delete_job/examples/request/MlDeleteJobExample1.yaml +++ b/specification/ml/delete_job/examples/request/MlDeleteJobExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests"' + - language: Java + code: | + client.ml().deleteJob(d -> d + .jobId("total-requests") + ); diff --git a/specification/ml/delete_model_snapshot/examples/request/MlDeleteModelSnapshotExample1.yaml b/specification/ml/delete_model_snapshot/examples/request/MlDeleteModelSnapshotExample1.yaml index b23fb94562..889597603d 100644 --- a/specification/ml/delete_model_snapshot/examples/request/MlDeleteModelSnapshotExample1.yaml +++ b/specification/ml/delete_model_snapshot/examples/request/MlDeleteModelSnapshotExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/farequote/model_snapshots/1491948163"' + - language: Java + code: | + client.ml().deleteModelSnapshot(d -> d + .jobId("farequote") + .snapshotId("1491948163") + ); diff --git a/specification/ml/delete_trained_model/examples/request/MlDeleteTrainedModelExample1.yaml b/specification/ml/delete_trained_model/examples/request/MlDeleteTrainedModelExample1.yaml index b7479603c1..5045f8e890 100644 --- a/specification/ml/delete_trained_model/examples/request/MlDeleteTrainedModelExample1.yaml +++ b/specification/ml/delete_trained_model/examples/request/MlDeleteTrainedModelExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/regression-job-one-1574775307356"' + - language: Java + code: | + client.ml().deleteTrainedModel(d -> d + .modelId("regression-job-one-1574775307356") + ); diff --git a/specification/ml/delete_trained_model_alias/examples/request/MlDeleteTrainedModelAliasExample1.yaml b/specification/ml/delete_trained_model_alias/examples/request/MlDeleteTrainedModelAliasExample1.yaml index f23c8c5feb..0b0664e5ec 100644 --- a/specification/ml/delete_trained_model_alias/examples/request/MlDeleteTrainedModelAliasExample1.yaml +++ b/specification/ml/delete_trained_model_alias/examples/request/MlDeleteTrainedModelAliasExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model"' + - language: Java + code: | + client.ml().deleteTrainedModelAlias(d -> d + .modelAlias("flight_delay_model") + .modelId("flight-delay-prediction-1574775339910") + ); diff --git a/specification/ml/get_calendar_events/examples/request/MlGetCalendarEventsExample1.yaml b/specification/ml/get_calendar_events/examples/request/MlGetCalendarEventsExample1.yaml index 5e367f2467..903d37f89f 100644 --- a/specification/ml/get_calendar_events/examples/request/MlGetCalendarEventsExample1.yaml +++ b/specification/ml/get_calendar_events/examples/request/MlGetCalendarEventsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/events"' + - language: Java + code: | + client.ml().getCalendarEvents(g -> g + .calendarId("planned-outages") + ); diff --git a/specification/ml/get_data_frame_analytics/examples/request/MlGetDataFrameAnalyticsExample1.yaml b/specification/ml/get_data_frame_analytics/examples/request/MlGetDataFrameAnalyticsExample1.yaml index dcf4eaac3e..6ae5827ffe 100644 --- a/specification/ml/get_data_frame_analytics/examples/request/MlGetDataFrameAnalyticsExample1.yaml +++ b/specification/ml/get_data_frame_analytics/examples/request/MlGetDataFrameAnalyticsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics"' + - language: Java + code: | + client.ml().getDataFrameAnalytics(g -> g + .id("loganalytics") + ); diff --git a/specification/ml/get_data_frame_analytics_stats/examples/request/MlGetDataFrameAnalyticsStatsExample1.yaml b/specification/ml/get_data_frame_analytics_stats/examples/request/MlGetDataFrameAnalyticsStatsExample1.yaml index 1e4a943d04..2b46e403eb 100644 --- a/specification/ml/get_data_frame_analytics_stats/examples/request/MlGetDataFrameAnalyticsStatsExample1.yaml +++ b/specification/ml/get_data_frame_analytics_stats/examples/request/MlGetDataFrameAnalyticsStatsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/weblog-outliers/_stats"' + - language: Java + code: | + client.ml().getDataFrameAnalyticsStats(g -> g + .id("weblog-outliers") + ); diff --git a/specification/ml/get_datafeed_stats/examples/request/MlGetDatafeedStatsExample1.yaml b/specification/ml/get_datafeed_stats/examples/request/MlGetDatafeedStatsExample1.yaml index c221d0cf63..b7cf20132a 100644 --- a/specification/ml/get_datafeed_stats/examples/request/MlGetDatafeedStatsExample1.yaml +++ b/specification/ml/get_datafeed_stats/examples/request/MlGetDatafeedStatsExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales/_stats"' + - language: Java + code: | + client.ml().getDatafeedStats(g -> g + .datafeedId("datafeed-high_sum_total_sales") + ); diff --git a/specification/ml/get_datafeeds/examples/request/MlGetDatafeedsExample1.yaml b/specification/ml/get_datafeeds/examples/request/MlGetDatafeedsExample1.yaml index 7a0134608c..4a1037d315 100644 --- a/specification/ml/get_datafeeds/examples/request/MlGetDatafeedsExample1.yaml +++ b/specification/ml/get_datafeeds/examples/request/MlGetDatafeedsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-high_sum_total_sales"' + - language: Java + code: | + client.ml().getDatafeeds(g -> g + .datafeedId("datafeed-high_sum_total_sales") + ); diff --git a/specification/ml/get_filters/examples/request/MlGetFiltersExample1.yaml b/specification/ml/get_filters/examples/request/MlGetFiltersExample1.yaml index 5fad1b11c3..624a3d092f 100644 --- a/specification/ml/get_filters/examples/request/MlGetFiltersExample1.yaml +++ b/specification/ml/get_filters/examples/request/MlGetFiltersExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/filters/safe_domains"' + - language: Java + code: | + client.ml().getFilters(g -> g + .filterId("safe_domains") + ); diff --git a/specification/ml/get_job_stats/examples/request/MlGetJobStatsExample1.yaml b/specification/ml/get_job_stats/examples/request/MlGetJobStatsExample1.yaml index 1bef481d3d..07381729d9 100644 --- a/specification/ml/get_job_stats/examples/request/MlGetJobStatsExample1.yaml +++ b/specification/ml/get_job_stats/examples/request/MlGetJobStatsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_stats"' + - language: Java + code: | + client.ml().getJobStats(g -> g + .jobId("low_request_rate") + ); diff --git a/specification/ml/get_jobs/examples/request/MlGetJobsExample1.yaml b/specification/ml/get_jobs/examples/request/MlGetJobsExample1.yaml index d1d45b4896..b6d456970d 100644 --- a/specification/ml/get_jobs/examples/request/MlGetJobsExample1.yaml +++ b/specification/ml/get_jobs/examples/request/MlGetJobsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/high_sum_total_sales"' + - language: Java + code: | + client.ml().getJobs(g -> g + .jobId("high_sum_total_sales") + ); diff --git a/specification/ml/get_model_snapshot_upgrade_stats/examples/request/MlGetModelSnapshotUpgradeStatsExample1.yaml b/specification/ml/get_model_snapshot_upgrade_stats/examples/request/MlGetModelSnapshotUpgradeStatsExample1.yaml index 46b8019d7c..c43070df50 100644 --- a/specification/ml/get_model_snapshot_upgrade_stats/examples/request/MlGetModelSnapshotUpgradeStatsExample1.yaml +++ b/specification/ml/get_model_snapshot_upgrade_stats/examples/request/MlGetModelSnapshotUpgradeStatsExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/_all/_upgrade/_stats"' + - language: Java + code: | + client.ml().getModelSnapshotUpgradeStats(g -> g + .jobId("low_request_rate") + .snapshotId("_all") + ); diff --git a/specification/ml/get_trained_models/examples/request/MlGetTrainedModelsExample1.yaml b/specification/ml/get_trained_models/examples/request/MlGetTrainedModelsExample1.yaml index 0623a64daf..f28c5c3cae 100644 --- a/specification/ml/get_trained_models/examples/request/MlGetTrainedModelsExample1.yaml +++ b/specification/ml/get_trained_models/examples/request/MlGetTrainedModelsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->ml()->getTrainedModels(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/"' + - language: Java + code: | + client.ml().getTrainedModels(g -> g); diff --git a/specification/ml/get_trained_models_stats/examples/request/MlGetTrainedModelsStatsExample1.yaml b/specification/ml/get_trained_models_stats/examples/request/MlGetTrainedModelsStatsExample1.yaml index 705a4b19c6..e2fe9f1bff 100644 --- a/specification/ml/get_trained_models_stats/examples/request/MlGetTrainedModelsStatsExample1.yaml +++ b/specification/ml/get_trained_models_stats/examples/request/MlGetTrainedModelsStatsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->ml()->getTrainedModelsStats(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/_stats"' + - language: Java + code: | + client.ml().getTrainedModelsStats(g -> g); diff --git a/specification/ml/put_calendar_job/examples/request/MlPutCalendarJobExample1.yaml b/specification/ml/put_calendar_job/examples/request/MlPutCalendarJobExample1.yaml index df6837e87b..76c7799291 100644 --- a/specification/ml/put_calendar_job/examples/request/MlPutCalendarJobExample1.yaml +++ b/specification/ml/put_calendar_job/examples/request/MlPutCalendarJobExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/calendars/planned-outages/jobs/total-requests"' + - language: Java + code: | + client.ml().putCalendarJob(p -> p + .calendarId("planned-outages") + .jobId("total-requests") + ); diff --git a/specification/ml/put_trained_model_alias/examples/request/MlPutTrainedModelAliasExample1.yaml b/specification/ml/put_trained_model_alias/examples/request/MlPutTrainedModelAliasExample1.yaml index 99d7087472..2f4ef07310 100644 --- a/specification/ml/put_trained_model_alias/examples/request/MlPutTrainedModelAliasExample1.yaml +++ b/specification/ml/put_trained_model_alias/examples/request/MlPutTrainedModelAliasExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/flight_delay_model"' + - language: Java + code: | + client.ml().putTrainedModelAlias(p -> p + .modelAlias("flight_delay_model") + .modelId("flight-delay-prediction-1574775339910") + ); diff --git a/specification/ml/reset_job/examples/request/MlResetJobExample1.yaml b/specification/ml/reset_job/examples/request/MlResetJobExample1.yaml index 7e10fc9ddd..3cf918505d 100644 --- a/specification/ml/reset_job/examples/request/MlResetJobExample1.yaml +++ b/specification/ml/reset_job/examples/request/MlResetJobExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/total-requests/_reset"' + - language: Java + code: | + client.ml().resetJob(r -> r + .jobId("total-requests") + ); diff --git a/specification/ml/set_upgrade_mode/examples/request/MlSetUpgradeModeExample1.yaml b/specification/ml/set_upgrade_mode/examples/request/MlSetUpgradeModeExample1.yaml index 74f17e27f8..1c1ccf52e9 100644 --- a/specification/ml/set_upgrade_mode/examples/request/MlSetUpgradeModeExample1.yaml +++ b/specification/ml/set_upgrade_mode/examples/request/MlSetUpgradeModeExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/set_upgrade_mode?enabled=true"' + - language: Java + code: | + client.ml().setUpgradeMode(s -> s + .enabled(true) + ); diff --git a/specification/ml/start_data_frame_analytics/examples/request/MlStartDataFrameAnalyticsExample1.yaml b/specification/ml/start_data_frame_analytics/examples/request/MlStartDataFrameAnalyticsExample1.yaml index afbd025c19..afddbc3879 100644 --- a/specification/ml/start_data_frame_analytics/examples/request/MlStartDataFrameAnalyticsExample1.yaml +++ b/specification/ml/start_data_frame_analytics/examples/request/MlStartDataFrameAnalyticsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_start"' + - language: Java + code: | + client.ml().startDataFrameAnalytics(s -> s + .id("loganalytics") + ); diff --git a/specification/ml/stop_data_frame_analytics/examples/request/MlStopDataFrameAnalyticsExample1.yaml b/specification/ml/stop_data_frame_analytics/examples/request/MlStopDataFrameAnalyticsExample1.yaml index 748bd41841..b590e4da49 100644 --- a/specification/ml/stop_data_frame_analytics/examples/request/MlStopDataFrameAnalyticsExample1.yaml +++ b/specification/ml/stop_data_frame_analytics/examples/request/MlStopDataFrameAnalyticsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_stop"' + - language: Java + code: | + client.ml().stopDataFrameAnalytics(s -> s + .id("loganalytics") + ); diff --git a/specification/ml/stop_trained_model_deployment/examples/request/MlStopTrainedModelDeploymentExample1.yaml b/specification/ml/stop_trained_model_deployment/examples/request/MlStopTrainedModelDeploymentExample1.yaml index 408a1989d6..1aa14e12e8 100644 --- a/specification/ml/stop_trained_model_deployment/examples/request/MlStopTrainedModelDeploymentExample1.yaml +++ b/specification/ml/stop_trained_model_deployment/examples/request/MlStopTrainedModelDeploymentExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/my_model_for_search/deployment/_stop"' + - language: Java + code: | + client.ml().stopTrainedModelDeployment(s -> s + .modelId("my_model_for_search") + ); diff --git a/specification/ml/upgrade_job_snapshot/examples/request/MlUpgradeJobSnapshotExample1.yaml b/specification/ml/upgrade_job_snapshot/examples/request/MlUpgradeJobSnapshotExample1.yaml index 333d57d3de..0943d9e2b9 100644 --- a/specification/ml/upgrade_job_snapshot/examples/request/MlUpgradeJobSnapshotExample1.yaml +++ b/specification/ml/upgrade_job_snapshot/examples/request/MlUpgradeJobSnapshotExample1.yaml @@ -35,3 +35,13 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true"' + - language: Java + code: | + client.ml().upgradeJobSnapshot(u -> u + .jobId("low_request_rate") + .snapshotId("1828371") + .timeout(t -> t + .offset(45) + ) + .waitForCompletion(true) + ); diff --git a/specification/nodes/hot_threads/examples/request/NodesHotThreadsExample1.yaml b/specification/nodes/hot_threads/examples/request/NodesHotThreadsExample1.yaml index 2a6a73962f..ea6d3cf6fe 100644 --- a/specification/nodes/hot_threads/examples/request/NodesHotThreadsExample1.yaml +++ b/specification/nodes/hot_threads/examples/request/NodesHotThreadsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->nodes()->hotThreads(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/hot_threads"' + - language: Java + code: | + client.nodes().hotThreads(h -> h); diff --git a/specification/nodes/info/examples/request/NodesInfoExample1.yaml b/specification/nodes/info/examples/request/NodesInfoExample1.yaml index c930ab7133..618a6bfe97 100644 --- a/specification/nodes/info/examples/request/NodesInfoExample1.yaml +++ b/specification/nodes/info/examples/request/NodesInfoExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/_all/jvm"' + - language: Java + code: | + client.nodes().info(i -> i + .metric("jvm") + .nodeId("_all") + ); diff --git a/specification/nodes/usage/examples/request/NodesUsageExample1.yaml b/specification/nodes/usage/examples/request/NodesUsageExample1.yaml index fd43d2deb0..a1be84482f 100644 --- a/specification/nodes/usage/examples/request/NodesUsageExample1.yaml +++ b/specification/nodes/usage/examples/request/NodesUsageExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->nodes()->usage(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/usage"' + - language: Java + code: | + client.nodes().usage(u -> u); diff --git a/specification/query_rules/delete_rule/examples/request/QueryRulesDeleteRuleExample1.yaml b/specification/query_rules/delete_rule/examples/request/QueryRulesDeleteRuleExample1.yaml index 450e1f64de..85a1fe1235 100644 --- a/specification/query_rules/delete_rule/examples/request/QueryRulesDeleteRuleExample1.yaml +++ b/specification/query_rules/delete_rule/examples/request/QueryRulesDeleteRuleExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1"' + - language: Java + code: | + client.queryRules().deleteRule(d -> d + .ruleId("my-rule1") + .rulesetId("my-ruleset") + ); diff --git a/specification/query_rules/delete_ruleset/examples/request/QueryRulesDeleteRulesetExample1.yaml b/specification/query_rules/delete_ruleset/examples/request/QueryRulesDeleteRulesetExample1.yaml index bbdd1b4cf1..02998b8918 100644 --- a/specification/query_rules/delete_ruleset/examples/request/QueryRulesDeleteRulesetExample1.yaml +++ b/specification/query_rules/delete_ruleset/examples/request/QueryRulesDeleteRulesetExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/"' + - language: Java + code: | + client.queryRules().deleteRuleset(d -> d + .rulesetId("my-ruleset") + ); diff --git a/specification/query_rules/get_rule/examples/request/QueryRuleGetRequestExample1.yaml b/specification/query_rules/get_rule/examples/request/QueryRuleGetRequestExample1.yaml index 8f96d662f5..e7fa0f3fa2 100644 --- a/specification/query_rules/get_rule/examples/request/QueryRuleGetRequestExample1.yaml +++ b/specification/query_rules/get_rule/examples/request/QueryRuleGetRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_rule/my-rule1"' + - language: Java + code: | + client.queryRules().getRule(g -> g + .ruleId("my-rule1") + .rulesetId("my-ruleset") + ); diff --git a/specification/query_rules/get_ruleset/examples/request/QueryRulesetGetRequestExample1.yaml b/specification/query_rules/get_ruleset/examples/request/QueryRulesetGetRequestExample1.yaml index 3f28e55e90..ca8b7a8e48 100644 --- a/specification/query_rules/get_ruleset/examples/request/QueryRulesetGetRequestExample1.yaml +++ b/specification/query_rules/get_ruleset/examples/request/QueryRulesetGetRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/my-ruleset/"' + - language: Java + code: | + client.queryRules().getRuleset(g -> g + .rulesetId("my-ruleset") + ); diff --git a/specification/query_rules/list_rulesets/examples/request/QueryRulesetListRequestExample1.yaml b/specification/query_rules/list_rulesets/examples/request/QueryRulesetListRequestExample1.yaml index 4461fd294a..733fdaa65d 100644 --- a/specification/query_rules/list_rulesets/examples/request/QueryRulesetListRequestExample1.yaml +++ b/specification/query_rules/list_rulesets/examples/request/QueryRulesetListRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_query_rules/?from=0&size=3"' + - language: Java + code: | + client.queryRules().listRulesets(l -> l + .from(0) + .size(3) + ); diff --git a/specification/rollup/delete_job/examples/request/DeleteRollupJobRequestExample1.yaml b/specification/rollup/delete_job/examples/request/DeleteRollupJobRequestExample1.yaml index c3c51fd691..86869b1231 100644 --- a/specification/rollup/delete_job/examples/request/DeleteRollupJobRequestExample1.yaml +++ b/specification/rollup/delete_job/examples/request/DeleteRollupJobRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor"' + - language: Java + code: | + client.rollup().deleteJob(d -> d + .id("sensor") + ); diff --git a/specification/rollup/get_jobs/examples/request/GetRollupJobRequestExample1.yaml b/specification/rollup/get_jobs/examples/request/GetRollupJobRequestExample1.yaml index 8f49e303d4..ec266d8ddc 100644 --- a/specification/rollup/get_jobs/examples/request/GetRollupJobRequestExample1.yaml +++ b/specification/rollup/get_jobs/examples/request/GetRollupJobRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor"' + - language: Java + code: | + client.rollup().getJobs(g -> g + .id("sensor") + ); diff --git a/specification/rollup/get_rollup_caps/examples/request/GetRollupCapabilitiesRequestExample1.yaml b/specification/rollup/get_rollup_caps/examples/request/GetRollupCapabilitiesRequestExample1.yaml index 0e9466b59c..9fc0e320a2 100644 --- a/specification/rollup/get_rollup_caps/examples/request/GetRollupCapabilitiesRequestExample1.yaml +++ b/specification/rollup/get_rollup_caps/examples/request/GetRollupCapabilitiesRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/data/sensor-*"' + - language: Java + code: | + client.rollup().getRollupCaps(g -> g + .id("sensor-*") + ); diff --git a/specification/rollup/get_rollup_index_caps/examples/request/GetRollupIndexCapabilitiesRequestExample1.yaml b/specification/rollup/get_rollup_index_caps/examples/request/GetRollupIndexCapabilitiesRequestExample1.yaml index 3e9b210456..7d4ab2ef6d 100644 --- a/specification/rollup/get_rollup_index_caps/examples/request/GetRollupIndexCapabilitiesRequestExample1.yaml +++ b/specification/rollup/get_rollup_index_caps/examples/request/GetRollupIndexCapabilitiesRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/sensor_rollup/_rollup/data"' + - language: Java + code: | + client.rollup().getRollupIndexCaps(g -> g + .index("sensor_rollup") + ); diff --git a/specification/rollup/start_job/examples/request/StartRollupJobRequestExample1.yaml b/specification/rollup/start_job/examples/request/StartRollupJobRequestExample1.yaml index 4b53d648c2..dbbd33b121 100644 --- a/specification/rollup/start_job/examples/request/StartRollupJobRequestExample1.yaml +++ b/specification/rollup/start_job/examples/request/StartRollupJobRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor/_start"' + - language: Java + code: | + client.rollup().startJob(s -> s + .id("sensor") + ); diff --git a/specification/rollup/stop_job/examples/request/RollupStopJobExample1.yaml b/specification/rollup/stop_job/examples/request/RollupStopJobExample1.yaml index aeb2a18c81..bfb46170ef 100644 --- a/specification/rollup/stop_job/examples/request/RollupStopJobExample1.yaml +++ b/specification/rollup/stop_job/examples/request/RollupStopJobExample1.yaml @@ -31,3 +31,12 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s"' + - language: Java + code: | + client.rollup().stopJob(s -> s + .id("sensor") + .timeout(t -> t + .offset(10) + ) + .waitForCompletion(true) + ); diff --git a/specification/search_application/delete/examples/request/SearchApplicationDeleteExample1.yaml b/specification/search_application/delete/examples/request/SearchApplicationDeleteExample1.yaml index 33cf3978f2..f76ad9d5e4 100644 --- a/specification/search_application/delete/examples/request/SearchApplicationDeleteExample1.yaml +++ b/specification/search_application/delete/examples/request/SearchApplicationDeleteExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/search_application/my-app/"' + - language: Java + code: | + client.searchApplication().delete(d -> d + .name("my-app") + ); diff --git a/specification/search_application/delete_behavioral_analytics/examples/request/SearchApplicationDeleteBehavioralAnalyticsExample1.yaml b/specification/search_application/delete_behavioral_analytics/examples/request/SearchApplicationDeleteBehavioralAnalyticsExample1.yaml index 49063bc56f..3fb9ebf9d9 100644 --- a/specification/search_application/delete_behavioral_analytics/examples/request/SearchApplicationDeleteBehavioralAnalyticsExample1.yaml +++ b/specification/search_application/delete_behavioral_analytics/examples/request/SearchApplicationDeleteBehavioralAnalyticsExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection/"' + - language: Java + code: | + client.searchApplication().deleteBehavioralAnalytics(d -> d + .name("my_analytics_collection") + ); diff --git a/specification/search_application/get/examples/request/SearchApplicationGetRequestExample1.yaml b/specification/search_application/get/examples/request/SearchApplicationGetRequestExample1.yaml index 2b370628c4..45c3f339c6 100644 --- a/specification/search_application/get/examples/request/SearchApplicationGetRequestExample1.yaml +++ b/specification/search_application/get/examples/request/SearchApplicationGetRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/search_application/my-app/"' + - language: Java + code: | + client.searchApplication().get(g -> g + .name("my-app") + ); diff --git a/specification/search_application/get_behavioral_analytics/examples/request/BehavioralAnalyticsGetRequestExample1.yaml b/specification/search_application/get_behavioral_analytics/examples/request/BehavioralAnalyticsGetRequestExample1.yaml index 20609d111a..9c10b4b77c 100644 --- a/specification/search_application/get_behavioral_analytics/examples/request/BehavioralAnalyticsGetRequestExample1.yaml +++ b/specification/search_application/get_behavioral_analytics/examples/request/BehavioralAnalyticsGetRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/analytics/my*"' + - language: Java + code: | + client.searchApplication().getBehavioralAnalytics(g -> g + .name("my*") + ); diff --git a/specification/search_application/list/examples/request/SearchApplicationsListRequestExample1.yaml b/specification/search_application/list/examples/request/SearchApplicationsListRequestExample1.yaml index 1bb413e718..c8594bc3d1 100644 --- a/specification/search_application/list/examples/request/SearchApplicationsListRequestExample1.yaml +++ b/specification/search_application/list/examples/request/SearchApplicationsListRequestExample1.yaml @@ -31,3 +31,10 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/search_application?from=0&size=3&q=app*"' + - language: Java + code: | + client.searchApplication().list(l -> l + .from(0) + .q("app*") + .size(3) + ); diff --git a/specification/search_application/put_behavioral_analytics/examples/request/SearchApplicationPutBehavioralAnalyticsExample1.yaml b/specification/search_application/put_behavioral_analytics/examples/request/SearchApplicationPutBehavioralAnalyticsExample1.yaml index af4efed6df..60d6da4f34 100644 --- a/specification/search_application/put_behavioral_analytics/examples/request/SearchApplicationPutBehavioralAnalyticsExample1.yaml +++ b/specification/search_application/put_behavioral_analytics/examples/request/SearchApplicationPutBehavioralAnalyticsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_application/analytics/my_analytics_collection"' + - language: Java + code: | + client.searchApplication().putBehavioralAnalytics(p -> p + .name("my_analytics_collection") + ); diff --git a/specification/searchable_snapshots/cache_stats/examples/request/CacheStatsRequestExample1.yaml b/specification/searchable_snapshots/cache_stats/examples/request/CacheStatsRequestExample1.yaml index e2243dea5a..e7decf4f76 100644 --- a/specification/searchable_snapshots/cache_stats/examples/request/CacheStatsRequestExample1.yaml +++ b/specification/searchable_snapshots/cache_stats/examples/request/CacheStatsRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->searchableSnapshots()->cacheStats(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_searchable_snapshots/cache/stats"' + - language: Java + code: | + client.searchableSnapshots().cacheStats(c -> c); diff --git a/specification/searchable_snapshots/clear_cache/examples/request/SearchableSnapshotsClearCacheExample1.yaml b/specification/searchable_snapshots/clear_cache/examples/request/SearchableSnapshotsClearCacheExample1.yaml index faee23272f..e66a380c03 100644 --- a/specification/searchable_snapshots/clear_cache/examples/request/SearchableSnapshotsClearCacheExample1.yaml +++ b/specification/searchable_snapshots/clear_cache/examples/request/SearchableSnapshotsClearCacheExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index/_searchable_snapshots/cache/clear"' + - language: Java + code: | + client.searchableSnapshots().clearCache(c -> c + .index("my-index") + ); diff --git a/specification/searchable_snapshots/stats/examples/request/SearchableSnapshotsStatsExample1.yaml b/specification/searchable_snapshots/stats/examples/request/SearchableSnapshotsStatsExample1.yaml index 5393721cf6..15b9363e97 100644 --- a/specification/searchable_snapshots/stats/examples/request/SearchableSnapshotsStatsExample1.yaml +++ b/specification/searchable_snapshots/stats/examples/request/SearchableSnapshotsStatsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index/_searchable_snapshots/stats"' + - language: Java + code: | + client.searchableSnapshots().stats(s -> s + .index("my-index") + ); diff --git a/specification/security/clear_api_key_cache/examples/request/SecurityClearApiKeyCacheExample1.yaml b/specification/security/clear_api_key_cache/examples/request/SecurityClearApiKeyCacheExample1.yaml index 4438632938..615cea1f15 100644 --- a/specification/security/clear_api_key_cache/examples/request/SecurityClearApiKeyCacheExample1.yaml +++ b/specification/security/clear_api_key_cache/examples/request/SecurityClearApiKeyCacheExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache"' + - language: Java + code: | + client.security().clearApiKeyCache(c -> c + .ids("yVGMr3QByxdh1MSaicYx") + ); diff --git a/specification/security/clear_cached_privileges/examples/request/SecurityClearCachedPrivilegesExample1.yaml b/specification/security/clear_cached_privileges/examples/request/SecurityClearCachedPrivilegesExample1.yaml index b7fe2e3e79..90b5cfdddc 100644 --- a/specification/security/clear_cached_privileges/examples/request/SecurityClearCachedPrivilegesExample1.yaml +++ b/specification/security/clear_cached_privileges/examples/request/SecurityClearCachedPrivilegesExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/myapp/_clear_cache"' + - language: Java + code: | + client.security().clearCachedPrivileges(c -> c + .application("myapp") + ); diff --git a/specification/security/clear_cached_realms/examples/request/SecurityClearCachedRealmsExample1.yaml b/specification/security/clear_cached_realms/examples/request/SecurityClearCachedRealmsExample1.yaml index 54667d9fdc..16855651ef 100644 --- a/specification/security/clear_cached_realms/examples/request/SecurityClearCachedRealmsExample1.yaml +++ b/specification/security/clear_cached_realms/examples/request/SecurityClearCachedRealmsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/realm/default_file/_clear_cache"' + - language: Java + code: | + client.security().clearCachedRealms(c -> c + .realms("default_file") + ); diff --git a/specification/security/clear_cached_roles/examples/request/SecurityClearCachedRolesExample1.yaml b/specification/security/clear_cached_roles/examples/request/SecurityClearCachedRolesExample1.yaml index 4a4ee13875..f0d251c0c0 100644 --- a/specification/security/clear_cached_roles/examples/request/SecurityClearCachedRolesExample1.yaml +++ b/specification/security/clear_cached_roles/examples/request/SecurityClearCachedRolesExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role/my_admin_role/_clear_cache"' + - language: Java + code: | + client.security().clearCachedRoles(c -> c + .name("my_admin_role") + ); diff --git a/specification/security/clear_cached_service_tokens/examples/request/SecurityClearCachedServiceTokensExample1.yaml b/specification/security/clear_cached_service_tokens/examples/request/SecurityClearCachedServiceTokensExample1.yaml index 3dcebe8163..d4f8b2cc28 100644 --- a/specification/security/clear_cached_service_tokens/examples/request/SecurityClearCachedServiceTokensExample1.yaml +++ b/specification/security/clear_cached_service_tokens/examples/request/SecurityClearCachedServiceTokensExample1.yaml @@ -31,3 +31,10 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1/_clear_cache"' + - language: Java + code: | + client.security().clearCachedServiceTokens(c -> c + .name("token1") + .namespace("elastic") + .service("fleet-server") + ); diff --git a/specification/security/create_service_token/examples/request/CreateServiceTokenRequestExample1.yaml b/specification/security/create_service_token/examples/request/CreateServiceTokenRequestExample1.yaml index 1e139229ab..b32b52428b 100644 --- a/specification/security/create_service_token/examples/request/CreateServiceTokenRequestExample1.yaml +++ b/specification/security/create_service_token/examples/request/CreateServiceTokenRequestExample1.yaml @@ -31,3 +31,10 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token1"' + - language: Java + code: | + client.security().createServiceToken(c -> c + .name("token1") + .namespace("elastic") + .service("fleet-server") + ); diff --git a/specification/security/delete_privileges/examples/request/SecurityDeletePrivilegesRequestExample1.yaml b/specification/security/delete_privileges/examples/request/SecurityDeletePrivilegesRequestExample1.yaml index 6b13b27f25..164766b7ae 100644 --- a/specification/security/delete_privileges/examples/request/SecurityDeletePrivilegesRequestExample1.yaml +++ b/specification/security/delete_privileges/examples/request/SecurityDeletePrivilegesRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/myapp/read"' + - language: Java + code: | + client.security().deletePrivileges(d -> d + .application("myapp") + .name("read") + ); diff --git a/specification/security/delete_role/examples/request/SecurityDeleteRoleRequestExample1.yaml b/specification/security/delete_role/examples/request/SecurityDeleteRoleRequestExample1.yaml index f094778572..4c660873e3 100644 --- a/specification/security/delete_role/examples/request/SecurityDeleteRoleRequestExample1.yaml +++ b/specification/security/delete_role/examples/request/SecurityDeleteRoleRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role/my_admin_role"' + - language: Java + code: | + client.security().deleteRole(d -> d + .name("my_admin_role") + ); diff --git a/specification/security/delete_role_mapping/examples/request/SecurityDeleteRoleMappingRequestExample1.yaml b/specification/security/delete_role_mapping/examples/request/SecurityDeleteRoleMappingRequestExample1.yaml index 4db1ae8190..d868afbb0f 100644 --- a/specification/security/delete_role_mapping/examples/request/SecurityDeleteRoleMappingRequestExample1.yaml +++ b/specification/security/delete_role_mapping/examples/request/SecurityDeleteRoleMappingRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role_mapping/mapping1"' + - language: Java + code: | + client.security().deleteRoleMapping(d -> d + .name("mapping1") + ); diff --git a/specification/security/delete_service_token/examples/request/DeleteServiceTokenRequestExample1.yaml b/specification/security/delete_service_token/examples/request/DeleteServiceTokenRequestExample1.yaml index 12dbd6dd7d..efcae991c9 100644 --- a/specification/security/delete_service_token/examples/request/DeleteServiceTokenRequestExample1.yaml +++ b/specification/security/delete_service_token/examples/request/DeleteServiceTokenRequestExample1.yaml @@ -31,3 +31,10 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential/token/token42"' + - language: Java + code: | + client.security().deleteServiceToken(d -> d + .name("token42") + .namespace("elastic") + .service("fleet-server") + ); diff --git a/specification/security/delete_user/examples/request/SecurityDeleteUserRequestExample1.yaml b/specification/security/delete_user/examples/request/SecurityDeleteUserRequestExample1.yaml index 6afdcb8b92..83368844df 100644 --- a/specification/security/delete_user/examples/request/SecurityDeleteUserRequestExample1.yaml +++ b/specification/security/delete_user/examples/request/SecurityDeleteUserRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/jacknich"' + - language: Java + code: | + client.security().deleteUser(d -> d + .username("jacknich") + ); diff --git a/specification/security/disable_user/examples/request/SecurityDisableUserExample1.yaml b/specification/security/disable_user/examples/request/SecurityDisableUserExample1.yaml index 71989d7463..1677c68d01 100644 --- a/specification/security/disable_user/examples/request/SecurityDisableUserExample1.yaml +++ b/specification/security/disable_user/examples/request/SecurityDisableUserExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/jacknich/_disable"' + - language: Java + code: | + client.security().disableUser(d -> d + .username("jacknich") + ); diff --git a/specification/security/disable_user_profile/examples/request/SecurityDisableUserProfileExample1.yaml b/specification/security/disable_user_profile/examples/request/SecurityDisableUserProfileExample1.yaml index 1c36d41e9b..c98f6e4e96 100644 --- a/specification/security/disable_user_profile/examples/request/SecurityDisableUserProfileExample1.yaml +++ b/specification/security/disable_user_profile/examples/request/SecurityDisableUserProfileExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_disable"' + - language: Java + code: | + client.security().disableUserProfile(d -> d + .uid("u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0") + ); diff --git a/specification/security/enable_user/examples/request/SecurityEnableUserExample1.yaml b/specification/security/enable_user/examples/request/SecurityEnableUserExample1.yaml index 478cb29b41..bf94a1ed6c 100644 --- a/specification/security/enable_user/examples/request/SecurityEnableUserExample1.yaml +++ b/specification/security/enable_user/examples/request/SecurityEnableUserExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/logstash_system/_enable"' + - language: Java + code: | + client.security().enableUser(e -> e + .username("logstash_system") + ); diff --git a/specification/security/enable_user_profile/examples/request/SecurityEnableUserProfileExample1.yaml b/specification/security/enable_user_profile/examples/request/SecurityEnableUserProfileExample1.yaml index eef90207ac..d85ffdb2cd 100644 --- a/specification/security/enable_user_profile/examples/request/SecurityEnableUserProfileExample1.yaml +++ b/specification/security/enable_user_profile/examples/request/SecurityEnableUserProfileExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0/_enable"' + - language: Java + code: | + client.security().enableUserProfile(e -> e + .uid("u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0") + ); diff --git a/specification/security/get_api_key/examples/request/SecurityGetApiKeyRequestExample2.yaml b/specification/security/get_api_key/examples/request/SecurityGetApiKeyRequestExample2.yaml index 62f87d3a76..dec2ee0a15 100644 --- a/specification/security/get_api_key/examples/request/SecurityGetApiKeyRequestExample2.yaml +++ b/specification/security/get_api_key/examples/request/SecurityGetApiKeyRequestExample2.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/api_key?username=myuser&realm_name=native1"' + - language: Java + code: | + client.security().getApiKey(g -> g + .realmName("native1") + .username("myuser") + ); diff --git a/specification/security/get_privileges/examples/request/SecurityGetPrivilegesRequestExample1.yaml b/specification/security/get_privileges/examples/request/SecurityGetPrivilegesRequestExample1.yaml index 770de5e5c9..a5b4e53c35 100644 --- a/specification/security/get_privileges/examples/request/SecurityGetPrivilegesRequestExample1.yaml +++ b/specification/security/get_privileges/examples/request/SecurityGetPrivilegesRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/privilege/myapp/read"' + - language: Java + code: | + client.security().getPrivileges(g -> g + .application("myapp") + .name("read") + ); diff --git a/specification/security/get_role/examples/request/SecurityGetRoleRequestExample1.yaml b/specification/security/get_role/examples/request/SecurityGetRoleRequestExample1.yaml index 324a490e48..7e80d08d53 100644 --- a/specification/security/get_role/examples/request/SecurityGetRoleRequestExample1.yaml +++ b/specification/security/get_role/examples/request/SecurityGetRoleRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role/my_admin_role"' + - language: Java + code: | + client.security().getRole(g -> g + .name("my_admin_role") + ); diff --git a/specification/security/get_role_mapping/examples/request/SecurityGetRoleMappingRequestExample1.yaml b/specification/security/get_role_mapping/examples/request/SecurityGetRoleMappingRequestExample1.yaml index ef57900871..34ef6c9a40 100644 --- a/specification/security/get_role_mapping/examples/request/SecurityGetRoleMappingRequestExample1.yaml +++ b/specification/security/get_role_mapping/examples/request/SecurityGetRoleMappingRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role_mapping/mapping1"' + - language: Java + code: | + client.security().getRoleMapping(g -> g + .name("mapping1") + ); diff --git a/specification/security/get_service_accounts/examples/request/GetServiceAccountsRequestExample1.yaml b/specification/security/get_service_accounts/examples/request/GetServiceAccountsRequestExample1.yaml index 8587fbb920..3622609813 100644 --- a/specification/security/get_service_accounts/examples/request/GetServiceAccountsRequestExample1.yaml +++ b/specification/security/get_service_accounts/examples/request/GetServiceAccountsRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server"' + - language: Java + code: | + client.security().getServiceAccounts(g -> g + .namespace("elastic") + .service("fleet-server") + ); diff --git a/specification/security/get_service_credentials/examples/request/GetServiceCredentialsRequestExample1.yaml b/specification/security/get_service_credentials/examples/request/GetServiceCredentialsRequestExample1.yaml index ec3cb42938..9edb57a158 100644 --- a/specification/security/get_service_credentials/examples/request/GetServiceCredentialsRequestExample1.yaml +++ b/specification/security/get_service_credentials/examples/request/GetServiceCredentialsRequestExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server/credential"' + - language: Java + code: | + client.security().getServiceCredentials(g -> g + .namespace("elastic") + .service("fleet-server") + ); diff --git a/specification/security/get_settings/examples/request/SecurityGetSettingsExample1.yaml b/specification/security/get_settings/examples/request/SecurityGetSettingsExample1.yaml index 37e1346388..83c295d324 100644 --- a/specification/security/get_settings/examples/request/SecurityGetSettingsExample1.yaml +++ b/specification/security/get_settings/examples/request/SecurityGetSettingsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->security()->getSettings(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/settings"' + - language: Java + code: | + client.security().getSettings(g -> g); diff --git a/specification/security/get_user/examples/request/SecurityGetUserRequestExample1.yaml b/specification/security/get_user/examples/request/SecurityGetUserRequestExample1.yaml index b1e26db578..d109f5799b 100644 --- a/specification/security/get_user/examples/request/SecurityGetUserRequestExample1.yaml +++ b/specification/security/get_user/examples/request/SecurityGetUserRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/jacknich?with_profile_uid=true"' + - language: Java + code: | + client.security().getUser(g -> g + .username("jacknich") + .withProfileUid(true) + ); diff --git a/specification/security/get_user_privileges/examples/request/SecurityGetUserPrivilegesRequestExample1.yaml b/specification/security/get_user_privileges/examples/request/SecurityGetUserPrivilegesRequestExample1.yaml index 5b14cd486f..df1209dd40 100644 --- a/specification/security/get_user_privileges/examples/request/SecurityGetUserPrivilegesRequestExample1.yaml +++ b/specification/security/get_user_privileges/examples/request/SecurityGetUserPrivilegesRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->security()->getUserPrivileges(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/_privileges"' + - language: Java + code: | + client.security().getUserPrivileges(g -> g); diff --git a/specification/security/get_user_profile/examples/request/GetUserProfileRequestExample1.yaml b/specification/security/get_user_profile/examples/request/GetUserProfileRequestExample1.yaml index a3442c9495..9f13784e8e 100644 --- a/specification/security/get_user_profile/examples/request/GetUserProfileRequestExample1.yaml +++ b/specification/security/get_user_profile/examples/request/GetUserProfileRequestExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/profile/u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"' + - language: Java + code: | + client.security().getUserProfile(g -> g + .uid("u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0") + ); diff --git a/specification/shutdown/delete_node/examples/request/ShutdownDeleteNodeRequestExample1.yaml b/specification/shutdown/delete_node/examples/request/ShutdownDeleteNodeRequestExample1.yaml index cb63718c1c..c4524d927c 100644 --- a/specification/shutdown/delete_node/examples/request/ShutdownDeleteNodeRequestExample1.yaml +++ b/specification/shutdown/delete_node/examples/request/ShutdownDeleteNodeRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown"' + - language: Java + code: | + client.shutdown().deleteNode(d -> d + .nodeId("USpTGYaBSIKbgSUJR2Z9lg") + ); diff --git a/specification/shutdown/get_node/examples/request/ShutdownGetNodeRequestExample1.yaml b/specification/shutdown/get_node/examples/request/ShutdownGetNodeRequestExample1.yaml index 5108c71d73..a75490777c 100644 --- a/specification/shutdown/get_node/examples/request/ShutdownGetNodeRequestExample1.yaml +++ b/specification/shutdown/get_node/examples/request/ShutdownGetNodeRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown"' + - language: Java + code: | + client.shutdown().getNode(g -> g + .nodeId("USpTGYaBSIKbgSUJR2Z9lg") + ); diff --git a/specification/slm/delete_lifecycle/examples/request/SlmDeleteLifecycleExample1.yaml b/specification/slm/delete_lifecycle/examples/request/SlmDeleteLifecycleExample1.yaml index f6bcca8ceb..7fde776d3b 100644 --- a/specification/slm/delete_lifecycle/examples/request/SlmDeleteLifecycleExample1.yaml +++ b/specification/slm/delete_lifecycle/examples/request/SlmDeleteLifecycleExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots"' + - language: Java + code: | + client.slm().deleteLifecycle(d -> d + .policyId("daily-snapshots") + ); diff --git a/specification/slm/execute_lifecycle/examples/request/ExecuteSnapshotLifecycleRequestExample1.yaml b/specification/slm/execute_lifecycle/examples/request/ExecuteSnapshotLifecycleRequestExample1.yaml index fbcb6f1183..6c60f61e90 100644 --- a/specification/slm/execute_lifecycle/examples/request/ExecuteSnapshotLifecycleRequestExample1.yaml +++ b/specification/slm/execute_lifecycle/examples/request/ExecuteSnapshotLifecycleRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots/_execute"' + - language: Java + code: | + client.slm().executeLifecycle(e -> e + .policyId("daily-snapshots") + ); diff --git a/specification/slm/execute_retention/examples/request/SlmExecuteRetentionExample1.yaml b/specification/slm/execute_retention/examples/request/SlmExecuteRetentionExample1.yaml index 6852a5ba05..2e98d83de3 100644 --- a/specification/slm/execute_retention/examples/request/SlmExecuteRetentionExample1.yaml +++ b/specification/slm/execute_retention/examples/request/SlmExecuteRetentionExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->slm()->executeRetention(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/_execute_retention"' + - language: Java + code: | + client.slm().executeRetention(e -> e); diff --git a/specification/slm/get_stats/examples/request/GetSnapshotLifecycleManagementStatsRequestExample1.yaml b/specification/slm/get_stats/examples/request/GetSnapshotLifecycleManagementStatsRequestExample1.yaml index 0a78d36f83..4ee2c5db2b 100644 --- a/specification/slm/get_stats/examples/request/GetSnapshotLifecycleManagementStatsRequestExample1.yaml +++ b/specification/slm/get_stats/examples/request/GetSnapshotLifecycleManagementStatsRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->slm()->getStats(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/stats"' + - language: Java + code: | + client.slm().getStats(g -> g); diff --git a/specification/slm/get_status/examples/request/GetSnapshotLifecycleManagementStatusRequestExample1.yaml b/specification/slm/get_status/examples/request/GetSnapshotLifecycleManagementStatusRequestExample1.yaml index 56eefa7d7e..a6793b6e63 100644 --- a/specification/slm/get_status/examples/request/GetSnapshotLifecycleManagementStatusRequestExample1.yaml +++ b/specification/slm/get_status/examples/request/GetSnapshotLifecycleManagementStatusRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->slm()->getStatus(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/status"' + - language: Java + code: | + client.slm().getStatus(g -> g); diff --git a/specification/slm/start/examples/request/StartSnapshotLifecycleManagementRequestExample1.yaml b/specification/slm/start/examples/request/StartSnapshotLifecycleManagementRequestExample1.yaml index f73619ee35..ac32aaca84 100644 --- a/specification/slm/start/examples/request/StartSnapshotLifecycleManagementRequestExample1.yaml +++ b/specification/slm/start/examples/request/StartSnapshotLifecycleManagementRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->slm()->start(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/start"' + - language: Java + code: | + client.slm().start(s -> s); diff --git a/specification/snapshot/cleanup_repository/examples/request/SnapshotCleanupRepositoryRequestExample1.yaml b/specification/snapshot/cleanup_repository/examples/request/SnapshotCleanupRepositoryRequestExample1.yaml index 4fbfdad9b8..afe718db0d 100644 --- a/specification/snapshot/cleanup_repository/examples/request/SnapshotCleanupRepositoryRequestExample1.yaml +++ b/specification/snapshot/cleanup_repository/examples/request/SnapshotCleanupRepositoryRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_cleanup"' + - language: Java + code: | + client.snapshot().cleanupRepository(c -> c + .name("my_repository") + ); diff --git a/specification/snapshot/delete/examples/request/SnapshotDeleteRequestExample1.yaml b/specification/snapshot/delete/examples/request/SnapshotDeleteRequestExample1.yaml index e879869c67..f54f737c56 100644 --- a/specification/snapshot/delete/examples/request/SnapshotDeleteRequestExample1.yaml +++ b/specification/snapshot/delete/examples/request/SnapshotDeleteRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2,snapshot_3"' + - language: Java + code: | + client.snapshot().delete(d -> d + .repository("my_repository") + .snapshot("snapshot_2,snapshot_3") + ); diff --git a/specification/snapshot/delete_repository/examples/request/SnapshotDeleteRepositoryExample1.yaml b/specification/snapshot/delete_repository/examples/request/SnapshotDeleteRepositoryExample1.yaml index b256110836..e1b9e9e10b 100644 --- a/specification/snapshot/delete_repository/examples/request/SnapshotDeleteRepositoryExample1.yaml +++ b/specification/snapshot/delete_repository/examples/request/SnapshotDeleteRepositoryExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository"' + - language: Java + code: | + client.snapshot().deleteRepository(d -> d + .name("my_repository") + ); diff --git a/specification/snapshot/get/examples/request/SnapshotGetRequestExample1.yaml b/specification/snapshot/get/examples/request/SnapshotGetRequestExample1.yaml index 7197e3236c..c31dd442c2 100644 --- a/specification/snapshot/get/examples/request/SnapshotGetRequestExample1.yaml +++ b/specification/snapshot/get/examples/request/SnapshotGetRequestExample1.yaml @@ -35,3 +35,11 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000"' + - language: Java + code: | + client.snapshot().get(g -> g + .fromSortValue("1577833200000") + .repository("my_repository") + .snapshot("snapshot_*") + .sort(SnapshotSort.StartTime) + ); diff --git a/specification/snapshot/get_repository/examples/request/SnapshotGetRepositoryRequestExample1.yaml b/specification/snapshot/get_repository/examples/request/SnapshotGetRepositoryRequestExample1.yaml index 4d2c73e944..2f35df5b8c 100644 --- a/specification/snapshot/get_repository/examples/request/SnapshotGetRepositoryRequestExample1.yaml +++ b/specification/snapshot/get_repository/examples/request/SnapshotGetRepositoryRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository"' + - language: Java + code: | + client.snapshot().getRepository(g -> g + .name("my_repository") + ); diff --git a/specification/snapshot/repository_analyze/examples/request/SnapshotRepositoryAnalyzeRequestExample1.yaml b/specification/snapshot/repository_analyze/examples/request/SnapshotRepositoryAnalyzeRequestExample1.yaml index 87dbdc32c4..bdf5060d92 100644 --- a/specification/snapshot/repository_analyze/examples/request/SnapshotRepositoryAnalyzeRequestExample1.yaml +++ b/specification/snapshot/repository_analyze/examples/request/SnapshotRepositoryAnalyzeRequestExample1.yaml @@ -38,3 +38,13 @@ alternatives: - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_analyze?blob_count=10&max_blob_size=1mb&timeout=120s"' + - language: Java + code: | + client.snapshot().repositoryAnalyze(r -> r + .blobCount(10) + .maxBlobSize("1mb") + .name("my_repository") + .timeout(t -> t + .offset(120) + ) + ); diff --git a/specification/snapshot/repository_verify_integrity/examples/request/SnapshotRepositoryVerifyIntegrityExample1.yaml b/specification/snapshot/repository_verify_integrity/examples/request/SnapshotRepositoryVerifyIntegrityExample1.yaml index 45c1f0602e..4faaaab920 100644 --- a/specification/snapshot/repository_verify_integrity/examples/request/SnapshotRepositoryVerifyIntegrityExample1.yaml +++ b/specification/snapshot/repository_verify_integrity/examples/request/SnapshotRepositoryVerifyIntegrityExample1.yaml @@ -29,3 +29,8 @@ alternatives: $resp = $client->sendRequest($request); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_verify_integrity"' + - language: Java + code: | + client.snapshot().repositoryVerifyIntegrity(r -> r + .name("my_repository") + ); diff --git a/specification/snapshot/status/examples/request/SnapshotStatusRequestExample1.yaml b/specification/snapshot/status/examples/request/SnapshotStatusRequestExample1.yaml index 5a4a6f381e..fedd0efb48 100644 --- a/specification/snapshot/status/examples/request/SnapshotStatusRequestExample1.yaml +++ b/specification/snapshot/status/examples/request/SnapshotStatusRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_2/_status"' + - language: Java + code: | + client.snapshot().status(s -> s + .repository("my_repository") + .snapshot("snapshot_2") + ); diff --git a/specification/snapshot/verify_repository/examples/request/SnapshotVerifyRepositoryExample1.yaml b/specification/snapshot/verify_repository/examples/request/SnapshotVerifyRepositoryExample1.yaml index d9931ab53d..c99f542fac 100644 --- a/specification/snapshot/verify_repository/examples/request/SnapshotVerifyRepositoryExample1.yaml +++ b/specification/snapshot/verify_repository/examples/request/SnapshotVerifyRepositoryExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_unverified_backup/_verify"' + - language: Java + code: | + client.snapshot().verifyRepository(v -> v + .name("my_unverified_backup") + ); diff --git a/specification/sql/delete_async/examples/request/SqlDeleteAsyncExample1.yaml b/specification/sql/delete_async/examples/request/SqlDeleteAsyncExample1.yaml index fc9fbc4c83..e5e430e9a4 100644 --- a/specification/sql/delete_async/examples/request/SqlDeleteAsyncExample1.yaml +++ b/specification/sql/delete_async/examples/request/SqlDeleteAsyncExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_sql/async/delete/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI="' + - language: Java + code: | + client.sql().deleteAsync(d -> d + .id("FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=") + ); diff --git a/specification/sql/get_async/examples/request/SqlGetAsyncExample1.yaml b/specification/sql/get_async/examples/request/SqlGetAsyncExample1.yaml index 45e0daa0a9..49326703a0 100644 --- a/specification/sql/get_async/examples/request/SqlGetAsyncExample1.yaml +++ b/specification/sql/get_async/examples/request/SqlGetAsyncExample1.yaml @@ -31,3 +31,12 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_sql/async/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=?wait_for_completion_timeout=2s&format=json"' + - language: Java + code: | + client.sql().getAsync(g -> g + .format("json") + .id("FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=") + .waitForCompletionTimeout(w -> w + .offset(2) + ) + ); diff --git a/specification/sql/get_async_status/examples/request/SqlGetAsyncStatusExample1.yaml b/specification/sql/get_async_status/examples/request/SqlGetAsyncStatusExample1.yaml index a19a8ba9e0..b9f9f3efc4 100644 --- a/specification/sql/get_async_status/examples/request/SqlGetAsyncStatusExample1.yaml +++ b/specification/sql/get_async_status/examples/request/SqlGetAsyncStatusExample1.yaml @@ -23,3 +23,8 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU="' + - language: Java + code: | + client.sql().getAsyncStatus(g -> g + .id("FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=") + ); diff --git a/specification/synonyms/delete_synonym/examples/request/SynonymsDeleteSynonymExample1.yaml b/specification/synonyms/delete_synonym/examples/request/SynonymsDeleteSynonymExample1.yaml index 7fa7ad11b6..67fc631405 100644 --- a/specification/synonyms/delete_synonym/examples/request/SynonymsDeleteSynonymExample1.yaml +++ b/specification/synonyms/delete_synonym/examples/request/SynonymsDeleteSynonymExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"' + - language: Java + code: | + client.synonyms().deleteSynonym(d -> d + .id("my-synonyms-set") + ); diff --git a/specification/synonyms/delete_synonym_rule/examples/request/SynonymRuleDeleteRequestExample1.yaml b/specification/synonyms/delete_synonym_rule/examples/request/SynonymRuleDeleteRequestExample1.yaml index 19c37cc2c0..d30502fee9 100644 --- a/specification/synonyms/delete_synonym_rule/examples/request/SynonymRuleDeleteRequestExample1.yaml +++ b/specification/synonyms/delete_synonym_rule/examples/request/SynonymRuleDeleteRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"' + - language: Java + code: | + client.synonyms().deleteSynonymRule(d -> d + .ruleId("test-1") + .setId("my-synonyms-set") + ); diff --git a/specification/synonyms/get_synonym/examples/request/SynonymsGetRequestExample1.yaml b/specification/synonyms/get_synonym/examples/request/SynonymsGetRequestExample1.yaml index ee18c5a366..58514bb163 100644 --- a/specification/synonyms/get_synonym/examples/request/SynonymsGetRequestExample1.yaml +++ b/specification/synonyms/get_synonym/examples/request/SynonymsGetRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"' + - language: Java + code: | + client.synonyms().getSynonym(g -> g + .id("my-synonyms-set") + ); diff --git a/specification/synonyms/get_synonym_rule/examples/request/SynonymRuleGetRequestExample1.yaml b/specification/synonyms/get_synonym_rule/examples/request/SynonymRuleGetRequestExample1.yaml index 6b25239a2d..803a858395 100644 --- a/specification/synonyms/get_synonym_rule/examples/request/SynonymRuleGetRequestExample1.yaml +++ b/specification/synonyms/get_synonym_rule/examples/request/SynonymRuleGetRequestExample1.yaml @@ -26,3 +26,9 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"' + - language: Java + code: | + client.synonyms().getSynonymRule(g -> g + .ruleId("test-1") + .setId("my-synonyms-set") + ); diff --git a/specification/synonyms/get_synonyms_sets/examples/request/SynonymsSetsGetRequestExample1.yaml b/specification/synonyms/get_synonyms_sets/examples/request/SynonymsSetsGetRequestExample1.yaml index 97939c8856..35ea609fad 100644 --- a/specification/synonyms/get_synonyms_sets/examples/request/SynonymsSetsGetRequestExample1.yaml +++ b/specification/synonyms/get_synonyms_sets/examples/request/SynonymsSetsGetRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->synonyms()->getSynonymsSets(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms"' + - language: Java + code: | + client.synonyms().getSynonymsSets(g -> g); diff --git a/specification/tasks/cancel/examples/request/TasksCancelExample1.yaml b/specification/tasks/cancel/examples/request/TasksCancelExample1.yaml index de8cd3fce1..862aee62b6 100644 --- a/specification/tasks/cancel/examples/request/TasksCancelExample1.yaml +++ b/specification/tasks/cancel/examples/request/TasksCancelExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_tasks//_cancel"' + - language: Java + code: | + client.tasks().cancel(c -> c + .taskId("") + ); diff --git a/specification/text_structure/find_field_structure/examples/request/FindFieldStructureRequestExample1.yaml b/specification/text_structure/find_field_structure/examples/request/FindFieldStructureRequestExample1.yaml index 4ae09bd804..89268c1306 100644 --- a/specification/text_structure/find_field_structure/examples/request/FindFieldStructureRequestExample1.yaml +++ b/specification/text_structure/find_field_structure/examples/request/FindFieldStructureRequestExample1.yaml @@ -27,3 +27,9 @@ alternatives: - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_text_structure/find_field_structure?index=test-logs&field=message"' + - language: Java + code: | + client.textStructure().findFieldStructure(f -> f + .field("message") + .index("test-logs") + ); diff --git a/specification/transform/delete_transform/examples/request/TransformDeleteTransformExample1.yaml b/specification/transform/delete_transform/examples/request/TransformDeleteTransformExample1.yaml index 515c10d80a..7bfbaa1817 100644 --- a/specification/transform/delete_transform/examples/request/TransformDeleteTransformExample1.yaml +++ b/specification/transform/delete_transform/examples/request/TransformDeleteTransformExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform"' + - language: Java + code: | + client.transform().deleteTransform(d -> d + .transformId("ecommerce_transform") + ); diff --git a/specification/transform/get_transform/examples/request/TransformGetTransformExample1.yaml b/specification/transform/get_transform/examples/request/TransformGetTransformExample1.yaml index eed60a9747..47c7812f38 100644 --- a/specification/transform/get_transform/examples/request/TransformGetTransformExample1.yaml +++ b/specification/transform/get_transform/examples/request/TransformGetTransformExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform?size=10"' + - language: Java + code: | + client.transform().getTransform(g -> g + .size(10) + ); diff --git a/specification/transform/get_transform_stats/examples/request/TransformGetTransformStatsExample1.yaml b/specification/transform/get_transform_stats/examples/request/TransformGetTransformStatsExample1.yaml index 04ecda19fb..88b220a2d4 100644 --- a/specification/transform/get_transform_stats/examples/request/TransformGetTransformStatsExample1.yaml +++ b/specification/transform/get_transform_stats/examples/request/TransformGetTransformStatsExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_stats"' + - language: Java + code: | + client.transform().getTransformStats(g -> g + .transformId("ecommerce-customer-transform") + ); diff --git a/specification/transform/reset_transform/examples/request/TransformResetTransformExample1.yaml b/specification/transform/reset_transform/examples/request/TransformResetTransformExample1.yaml index cb8f772072..919b242b5e 100644 --- a/specification/transform/reset_transform/examples/request/TransformResetTransformExample1.yaml +++ b/specification/transform/reset_transform/examples/request/TransformResetTransformExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform/_reset"' + - language: Java + code: | + client.transform().resetTransform(r -> r + .transformId("ecommerce_transform") + ); diff --git a/specification/transform/schedule_now_transform/examples/request/TransformScheduleNowTransformExample1.yaml b/specification/transform/schedule_now_transform/examples/request/TransformScheduleNowTransformExample1.yaml index b110efd8e6..03a278ff66 100644 --- a/specification/transform/schedule_now_transform/examples/request/TransformScheduleNowTransformExample1.yaml +++ b/specification/transform/schedule_now_transform/examples/request/TransformScheduleNowTransformExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform/_schedule_now"' + - language: Java + code: | + client.transform().scheduleNowTransform(s -> s + .transformId("ecommerce_transform") + ); diff --git a/specification/transform/start_transform/examples/request/TransformStartTransformExample1.yaml b/specification/transform/start_transform/examples/request/TransformStartTransformExample1.yaml index 9a9454ed65..cf5b554606 100644 --- a/specification/transform/start_transform/examples/request/TransformStartTransformExample1.yaml +++ b/specification/transform/start_transform/examples/request/TransformStartTransformExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce-customer-transform/_start"' + - language: Java + code: | + client.transform().startTransform(s -> s + .transformId("ecommerce-customer-transform") + ); diff --git a/specification/transform/stop_transform/examples/request/TransformStopTransformExample1.yaml b/specification/transform/stop_transform/examples/request/TransformStopTransformExample1.yaml index 56cc5e3883..385efa4689 100644 --- a/specification/transform/stop_transform/examples/request/TransformStopTransformExample1.yaml +++ b/specification/transform/stop_transform/examples/request/TransformStopTransformExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/ecommerce_transform/_stop"' + - language: Java + code: | + client.transform().stopTransform(s -> s + .transformId("ecommerce_transform") + ); diff --git a/specification/transform/upgrade_transforms/examples/request/TransformUpgradeTransformsExample1.yaml b/specification/transform/upgrade_transforms/examples/request/TransformUpgradeTransformsExample1.yaml index 6569b3a8ff..892539710d 100644 --- a/specification/transform/upgrade_transforms/examples/request/TransformUpgradeTransformsExample1.yaml +++ b/specification/transform/upgrade_transforms/examples/request/TransformUpgradeTransformsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->transform()->upgradeTransforms(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_transform/_upgrade"' + - language: Java + code: | + client.transform().upgradeTransforms(u -> u); diff --git a/specification/watcher/ack_watch/examples/request/WatcherAckWatchRequestExample1.yaml b/specification/watcher/ack_watch/examples/request/WatcherAckWatchRequestExample1.yaml index 9fcf945f96..95f7eb9b5e 100644 --- a/specification/watcher/ack_watch/examples/request/WatcherAckWatchRequestExample1.yaml +++ b/specification/watcher/ack_watch/examples/request/WatcherAckWatchRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack"' + - language: Java + code: | + client.watcher().ackWatch(a -> a + .watchId("my_watch") + ); diff --git a/specification/watcher/activate_watch/examples/request/WatcherActivateWatchExample1.yaml b/specification/watcher/activate_watch/examples/request/WatcherActivateWatchExample1.yaml index 196d71c437..cdf1d281a5 100644 --- a/specification/watcher/activate_watch/examples/request/WatcherActivateWatchExample1.yaml +++ b/specification/watcher/activate_watch/examples/request/WatcherActivateWatchExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_activate"' + - language: Java + code: | + client.watcher().activateWatch(a -> a + .watchId("my_watch") + ); diff --git a/specification/watcher/deactivate_watch/examples/request/WatcherDeactivateWatchExample1.yaml b/specification/watcher/deactivate_watch/examples/request/WatcherDeactivateWatchExample1.yaml index cace64e313..1310e48f45 100644 --- a/specification/watcher/deactivate_watch/examples/request/WatcherDeactivateWatchExample1.yaml +++ b/specification/watcher/deactivate_watch/examples/request/WatcherDeactivateWatchExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_deactivate"' + - language: Java + code: | + client.watcher().deactivateWatch(d -> d + .watchId("my_watch") + ); diff --git a/specification/watcher/delete_watch/examples/request/DeleteWatchRequestExample1.yaml b/specification/watcher/delete_watch/examples/request/DeleteWatchRequestExample1.yaml index 442bdc43a6..f82fa983ee 100644 --- a/specification/watcher/delete_watch/examples/request/DeleteWatchRequestExample1.yaml +++ b/specification/watcher/delete_watch/examples/request/DeleteWatchRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch"' + - language: Java + code: | + client.watcher().deleteWatch(d -> d + .id("my_watch") + ); diff --git a/specification/watcher/get_settings/examples/request/WatcherGetSettingsExample1.yaml b/specification/watcher/get_settings/examples/request/WatcherGetSettingsExample1.yaml index 4968813cea..253c170bb6 100644 --- a/specification/watcher/get_settings/examples/request/WatcherGetSettingsExample1.yaml +++ b/specification/watcher/get_settings/examples/request/WatcherGetSettingsExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->watcher()->getSettings(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/settings"' + - language: Java + code: | + client.watcher().getSettings(g -> g); diff --git a/specification/watcher/get_watch/examples/request/GetWatchRequestExample1.yaml b/specification/watcher/get_watch/examples/request/GetWatchRequestExample1.yaml index b4dd14035a..b0b3d735e6 100644 --- a/specification/watcher/get_watch/examples/request/GetWatchRequestExample1.yaml +++ b/specification/watcher/get_watch/examples/request/GetWatchRequestExample1.yaml @@ -22,3 +22,8 @@ alternatives: ]); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch"' + - language: Java + code: | + client.watcher().getWatch(g -> g + .id("my_watch") + ); diff --git a/specification/watcher/start/examples/request/WatcherStartRequestExample1.yaml b/specification/watcher/start/examples/request/WatcherStartRequestExample1.yaml index 876c8c5317..73f9b5906b 100644 --- a/specification/watcher/start/examples/request/WatcherStartRequestExample1.yaml +++ b/specification/watcher/start/examples/request/WatcherStartRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->watcher()->start(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/_start"' + - language: Java + code: | + client.watcher().start(s -> s); diff --git a/specification/watcher/stats/examples/request/WatcherStatsRequestExample1.yaml b/specification/watcher/stats/examples/request/WatcherStatsRequestExample1.yaml index 9414981d4b..91054d83e2 100644 --- a/specification/watcher/stats/examples/request/WatcherStatsRequestExample1.yaml +++ b/specification/watcher/stats/examples/request/WatcherStatsRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->watcher()->stats(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/stats"' + - language: Java + code: | + client.watcher().stats(s -> s); diff --git a/specification/watcher/stop/examples/request/WatcherStopRequestExample1.yaml b/specification/watcher/stop/examples/request/WatcherStopRequestExample1.yaml index 96aed5bfa1..6b3e09209c 100644 --- a/specification/watcher/stop/examples/request/WatcherStopRequestExample1.yaml +++ b/specification/watcher/stop/examples/request/WatcherStopRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->watcher()->stop(); - language: curl code: 'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/_stop"' + - language: Java + code: | + client.watcher().stop(s -> s); diff --git a/specification/xpack/info/examples/request/XPackInfoRequestExample1.yaml b/specification/xpack/info/examples/request/XPackInfoRequestExample1.yaml index be3c761c84..c4f5c76cff 100644 --- a/specification/xpack/info/examples/request/XPackInfoRequestExample1.yaml +++ b/specification/xpack/info/examples/request/XPackInfoRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->xpack()->info(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_xpack"' + - language: Java + code: | + client.xpack().info(i -> i); diff --git a/specification/xpack/usage/examples/request/XPackUsageRequestExample1.yaml b/specification/xpack/usage/examples/request/XPackUsageRequestExample1.yaml index 8c666c933f..2d2f845070 100644 --- a/specification/xpack/usage/examples/request/XPackUsageRequestExample1.yaml +++ b/specification/xpack/usage/examples/request/XPackUsageRequestExample1.yaml @@ -10,3 +10,6 @@ alternatives: code: $resp = $client->xpack()->usage(); - language: curl code: 'curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_xpack/usage"' + - language: Java + code: | + client.xpack().usage(u -> u);