Skip to content

Commit 39a335b

Browse files
Xtansiaopensearch-trigger-bot[bot]github-actions[bot]
authored
Re-generate client code using latest OpenSearch API specification (2025-05-26) (#1575) (#1576) (#1594)
(cherry picked from commit 5fb0d57) (cherry picked from commit 152bda4) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent f0d2501 commit 39a335b

24 files changed

Lines changed: 6415 additions & 1855 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
### Added
66
- Added support for the `template` query type ([#1586](https://github.com/opensearch-project/opensearch-java/pull/1586))
77
- Added support for Search Shards request `slice` property ([#1586](https://github.com/opensearch-project/opensearch-java/pull/1586))
8+
- Added support for ML tool attributes ([#1594](https://github.com/opensearch-project/opensearch-java/pull/1594))
89

910
### Dependencies
1011
- Bump `org.junit:junit-bom` from 5.12.2 to 5.13.0 ([#1587](https://github.com/opensearch-project/opensearch-java/pull/1587))
@@ -16,6 +17,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1617
### Removed
1718

1819
### Fixed
20+
- Fixed ScoreCombination's `parameters` structure ([#1594](https://github.com/opensearch-project/opensearch-java/pull/1594))
1921

2022
### Security
2123

java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeAttributes.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static NodeAttributes of(Function<NodeAttributes.Builder, ObjectBuilder<N
100100
}
101101

102102
/**
103-
* Required - Lists node attributes.
103+
* Required - A list of node attributes.
104104
* <p>
105105
* API name: {@code attributes}
106106
* </p>
@@ -119,7 +119,10 @@ public final String ephemeralId() {
119119
}
120120

121121
/**
122+
* The roles of the node.
123+
* <p>
122124
* API name: {@code external_id}
125+
* </p>
123126
*/
124127
@Nullable
125128
public final String externalId() {
@@ -263,7 +266,7 @@ public Builder copy() {
263266
}
264267

265268
/**
266-
* Required - Lists node attributes.
269+
* Required - A list of node attributes.
267270
* <p>
268271
* API name: {@code attributes}
269272
* </p>
@@ -279,7 +282,7 @@ public final Builder attributes(Map<String, String> map) {
279282
}
280283

281284
/**
282-
* Required - Lists node attributes.
285+
* Required - A list of node attributes.
283286
* <p>
284287
* API name: {@code attributes}
285288
* </p>
@@ -304,7 +307,10 @@ public final Builder ephemeralId(String value) {
304307
}
305308

306309
/**
310+
* The roles of the node.
311+
* <p>
307312
* API name: {@code external_id}
313+
* </p>
308314
*/
309315
@Nonnull
310316
public final Builder externalId(@Nullable String value) {

java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeRole.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,77 @@
4545
@JsonpDeserializable
4646
@Generated("org.opensearch.client.codegen.CodeGenerator")
4747
public enum NodeRole implements JsonEnum {
48+
/**
49+
* The node can act as a client node.
50+
*/
4851
Client("client"),
4952

53+
/**
54+
* The node can act as a cluster manager.
55+
*/
5056
ClusterManager("cluster_manager"),
5157

58+
/**
59+
* The node only performs coordination tasks.
60+
*/
5261
CoordinatingOnly("coordinating_only"),
5362

63+
/**
64+
* The node can store data.
65+
*/
5466
Data("data"),
5567

68+
/**
69+
* The node can store cold data.
70+
*/
5671
DataCold("data_cold"),
5772

73+
/**
74+
* The node can store content data.
75+
*/
5876
DataContent("data_content"),
5977

78+
/**
79+
* The node can store frozen data.
80+
*/
6081
DataFrozen("data_frozen"),
6182

83+
/**
84+
* The node can store hot data.
85+
*/
6286
DataHot("data_hot"),
6387

88+
/**
89+
* The node can store warm data.
90+
*/
6491
DataWarm("data_warm"),
6592

93+
/**
94+
* The node can perform ingest operations.
95+
*/
6696
Ingest("ingest"),
6797

6898
@Deprecated
6999
Master("master"),
70100

101+
/**
102+
* The node can perform machine learning operations.
103+
*/
71104
Ml("ml"),
72105

106+
/**
107+
* The node can act as a remote cluster client.
108+
*/
73109
RemoteClusterClient("remote_cluster_client"),
74110

111+
/**
112+
* The node can perform transform operations.
113+
*/
75114
Transform("transform"),
76115

116+
/**
117+
* The node can only vote in cluster decisions.
118+
*/
77119
VotingOnly("voting_only");
78120

79121
private final String jsonValue;

java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeShard.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959

6060
// typedef: _types.NodeShard
6161

62+
/**
63+
* The information about a shard on a node.
64+
*/
6265
@JsonpDeserializable
6366
@Generated("org.opensearch.client.codegen.CodeGenerator")
6467
public class NodeShard implements PlainJsonSerializable, ToCopyableBuilder<NodeShard.Builder, NodeShard> {
@@ -80,6 +83,9 @@ public class NodeShard implements PlainJsonSerializable, ToCopyableBuilder<NodeS
8083
@Nullable
8184
private final String relocatingNode;
8285

86+
@Nullable
87+
private final Boolean searchOnly;
88+
8389
private final int shard;
8490

8591
@Nonnull
@@ -97,6 +103,7 @@ private NodeShard(Builder builder) {
97103
this.primary = ApiTypeHelper.requireNonNull(builder.primary, this, "primary");
98104
this.recoverySource = ApiTypeHelper.unmodifiable(builder.recoverySource);
99105
this.relocatingNode = builder.relocatingNode;
106+
this.searchOnly = builder.searchOnly;
100107
this.shard = ApiTypeHelper.requireNonNull(builder.shard, this, "shard");
101108
this.state = ApiTypeHelper.requireNonNull(builder.state, this, "state");
102109
this.unassignedInfo = builder.unassignedInfo;
@@ -138,7 +145,10 @@ public final boolean primary() {
138145
}
139146

140147
/**
148+
* The recovery source information for this shard.
149+
* <p>
141150
* API name: {@code recovery_source}
151+
* </p>
142152
*/
143153
@Nonnull
144154
public final Map<String, String> recoverySource() {
@@ -153,6 +163,17 @@ public final String relocatingNode() {
153163
return this.relocatingNode;
154164
}
155165

166+
/**
167+
* Indicates if this shard is configured for search operations only
168+
* <p>
169+
* API name: {@code searchOnly}
170+
* </p>
171+
*/
172+
@Nullable
173+
public final Boolean searchOnly() {
174+
return this.searchOnly;
175+
}
176+
156177
/**
157178
* Required - API name: {@code shard}
158179
*/
@@ -223,6 +244,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
223244
generator.write(this.relocatingNode);
224245
}
225246

247+
if (this.searchOnly != null) {
248+
generator.writeKey("searchOnly");
249+
generator.write(this.searchOnly);
250+
}
251+
226252
generator.writeKey("shard");
227253
generator.write(this.shard);
228254

@@ -262,6 +288,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
262288
private Map<String, String> recoverySource;
263289
@Nullable
264290
private String relocatingNode;
291+
@Nullable
292+
private Boolean searchOnly;
265293
private Integer shard;
266294
private ShardRoutingState state;
267295
@Nullable
@@ -276,6 +304,7 @@ private Builder(NodeShard o) {
276304
this.primary = o.primary;
277305
this.recoverySource = _mapCopy(o.recoverySource);
278306
this.relocatingNode = o.relocatingNode;
307+
this.searchOnly = o.searchOnly;
279308
this.shard = o.shard;
280309
this.state = o.state;
281310
this.unassignedInfo = o.unassignedInfo;
@@ -288,6 +317,7 @@ private Builder(Builder o) {
288317
this.primary = o.primary;
289318
this.recoverySource = _mapCopy(o.recoverySource);
290319
this.relocatingNode = o.relocatingNode;
320+
this.searchOnly = o.searchOnly;
291321
this.shard = o.shard;
292322
this.state = o.state;
293323
this.unassignedInfo = o.unassignedInfo;
@@ -353,7 +383,10 @@ public final Builder primary(boolean value) {
353383
}
354384

355385
/**
386+
* The recovery source information for this shard.
387+
* <p>
356388
* API name: {@code recovery_source}
389+
* </p>
357390
*
358391
* <p>
359392
* Adds all elements of <code>map</code> to <code>recoverySource</code>.
@@ -366,7 +399,10 @@ public final Builder recoverySource(Map<String, String> map) {
366399
}
367400

368401
/**
402+
* The recovery source information for this shard.
403+
* <p>
369404
* API name: {@code recovery_source}
405+
* </p>
370406
*
371407
* <p>
372408
* Adds an entry to <code>recoverySource</code>.
@@ -387,6 +423,18 @@ public final Builder relocatingNode(@Nullable String value) {
387423
return this;
388424
}
389425

426+
/**
427+
* Indicates if this shard is configured for search operations only
428+
* <p>
429+
* API name: {@code searchOnly}
430+
* </p>
431+
*/
432+
@Nonnull
433+
public final Builder searchOnly(@Nullable Boolean value) {
434+
this.searchOnly = value;
435+
return this;
436+
}
437+
390438
/**
391439
* Required - API name: {@code shard}
392440
*/
@@ -453,6 +501,7 @@ protected static void setupNodeShardDeserializer(ObjectDeserializer<NodeShard.Bu
453501
op.add(Builder::primary, JsonpDeserializer.booleanDeserializer(), "primary");
454502
op.add(Builder::recoverySource, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "recovery_source");
455503
op.add(Builder::relocatingNode, JsonpDeserializer.stringDeserializer(), "relocating_node");
504+
op.add(Builder::searchOnly, JsonpDeserializer.booleanDeserializer(), "searchOnly");
456505
op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard");
457506
op.add(Builder::state, ShardRoutingState._DESERIALIZER, "state");
458507
op.add(Builder::unassignedInfo, UnassignedInformation._DESERIALIZER, "unassigned_info");
@@ -467,6 +516,7 @@ public int hashCode() {
467516
result = 31 * result + Boolean.hashCode(this.primary);
468517
result = 31 * result + Objects.hashCode(this.recoverySource);
469518
result = 31 * result + Objects.hashCode(this.relocatingNode);
519+
result = 31 * result + Objects.hashCode(this.searchOnly);
470520
result = 31 * result + Integer.hashCode(this.shard);
471521
result = 31 * result + this.state.hashCode();
472522
result = 31 * result + Objects.hashCode(this.unassignedInfo);
@@ -484,6 +534,7 @@ public boolean equals(Object o) {
484534
&& this.primary == other.primary
485535
&& Objects.equals(this.recoverySource, other.recoverySource)
486536
&& Objects.equals(this.relocatingNode, other.relocatingNode)
537+
&& Objects.equals(this.searchOnly, other.searchOnly)
487538
&& this.shard == other.shard
488539
&& this.state.equals(other.state)
489540
&& Objects.equals(this.unassignedInfo, other.unassignedInfo);

0 commit comments

Comments
 (0)