Skip to content

Commit 2e08db2

Browse files
opensearch-trigger-bot[bot]bowenlan-amzn
authored andcommitted
Add a super admin client builder w/ hosts params (opensearch-project#322) (opensearch-project#323)
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> (cherry picked from commit 050c95d) Co-authored-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
1 parent 6930dd7 commit 2e08db2

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
@@ -132,6 +132,15 @@ public SecureRestClientBuilder(Settings settings, Path configPath) {
132132
hosts.add(new HttpHost(host, port, httpSSLEnabled ? ConfigConstants.HTTPS : ConfigConstants.HTTP));
133133
}
134134

135+
public SecureRestClientBuilder(Settings settings, Path configPath, HttpHost[] httpHosts) {
136+
this.httpSSLEnabled = settings.getAsBoolean(ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_ENABLED, false);
137+
this.settings = settings;
138+
this.configPath = configPath;
139+
this.user = null;
140+
this.passwd = null;
141+
hosts.addAll(Arrays.asList(httpHosts));
142+
}
143+
135144
/**
136145
* Creates a low-level Rest client.
137146
* @return

0 commit comments

Comments
 (0)