[destination-elasticsearch] Adding path prefix to connector's host (#58586)
Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com> Co-authored-by: Edward Gao <edward.gao@airbyte.io>
This commit is contained in:
@@ -4,7 +4,7 @@ data:
|
||||
connectorSubtype: api
|
||||
connectorType: destination
|
||||
definitionId: 68f351a7-2745-4bef-ad7f-996b8e51bb8c
|
||||
dockerImageTag: 0.1.6
|
||||
dockerImageTag: 0.2.0
|
||||
dockerRepository: airbyte/destination-elasticsearch
|
||||
githubIssueLabel: destination-elasticsearch
|
||||
icon: elasticsearch.svg
|
||||
|
||||
@@ -19,6 +19,7 @@ public class ConnectorConfiguration {
|
||||
private boolean upsert;
|
||||
@JsonProperty("ca_certificate")
|
||||
private String caCertificate;
|
||||
private String pathPrefix;
|
||||
private AuthenticationMethod authenticationMethod = new AuthenticationMethod();
|
||||
|
||||
public static ConnectorConfiguration fromJsonNode(JsonNode config) {
|
||||
|
||||
@@ -58,7 +58,12 @@ public class ElasticsearchConnection {
|
||||
|
||||
// Create the low-level client
|
||||
httpHost = HttpHost.create(config.getEndpoint());
|
||||
final RestClientBuilder builder = RestClient.builder(httpHost);
|
||||
final RestClientBuilder builder;
|
||||
if (config.getPathPrefix() != null) {
|
||||
builder = RestClient.builder(httpHost).setPathPrefix(config.getPathPrefix());
|
||||
} else {
|
||||
builder = RestClient.builder(httpHost);
|
||||
}
|
||||
|
||||
// Set custom user's certificate if provided
|
||||
if (config.getCaCertificate() != null && !config.getCaCertificate().isEmpty()) {
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
"type": "string",
|
||||
"description": "The full url of the Elasticsearch server"
|
||||
},
|
||||
"pathPrefix": {
|
||||
"title": "Server path prefix",
|
||||
"type": "string",
|
||||
"description": "The Path Prefix of the Elasticsearch server"
|
||||
},
|
||||
"upsert": {
|
||||
"type": "boolean",
|
||||
"title": "Upsert Records",
|
||||
|
||||
Reference in New Issue
Block a user