Skip to content

Commit 050c95d

Browse files
Add a super admin client builder w/ hosts params (opensearch-project#322)
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
1 parent 5fd25b0 commit 050c95d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/opensearch/commons/rest/SecureRestClientBuilder.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ public SecureRestClientBuilder(Settings settings, Path configPath) {
138138
hosts.add(new HttpHost(httpSSLEnabled ? ConfigConstants.HTTPS : ConfigConstants.HTTP, host, port));
139139
}
140140

141+
public SecureRestClientBuilder(Settings settings, Path configPath, HttpHost[] httpHosts) {
142+
this.httpSSLEnabled = settings.getAsBoolean(ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_ENABLED, false);
143+
this.settings = settings;
144+
this.configPath = configPath;
145+
this.user = null;
146+
this.passwd = null;
147+
hosts.addAll(Arrays.asList(httpHosts));
148+
}
149+
141150
/**
142151
* Creates a low-level Rest client.
143152
* @return

0 commit comments

Comments
 (0)