From 5b77c14dc839ba2c161e6eda3416de887cdae1ce Mon Sep 17 00:00:00 2001 From: Suman Maharana Date: Tue, 7 Jan 2025 12:41:56 +0530 Subject: [PATCH] Fixes #18816 - Airbyte api endpoint (#19207) * Fix Airbyte api endpoint * Fix Airbyte api endpoint --- .../source/pipeline/airbyte/client.py | 5 ++-- .../connectors/pipeline/airbyte/index.md | 6 +++++ .../connectors/pipeline/airbyte/yaml.md | 26 +++++++++++++++++++ .../connectors/pipeline/airbyte/index.md | 6 +++++ .../connectors/pipeline/airbyte/yaml.md | 26 +++++++++++++++++++ .../pipeline/airbyteConnection.json | 6 +++++ .../public/locales/en-US/Pipeline/Airbyte.md | 6 +++++ .../connections/pipeline/airbyteConnection.ts | 4 +++ 8 files changed, 83 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/pipeline/airbyte/client.py b/ingestion/src/metadata/ingestion/source/pipeline/airbyte/client.py index 63a6817cf84..ab342831dea 100644 --- a/ingestion/src/metadata/ingestion/source/pipeline/airbyte/client.py +++ b/ingestion/src/metadata/ingestion/source/pipeline/airbyte/client.py @@ -20,6 +20,7 @@ from metadata.generated.schema.entity.services.connections.pipeline.airbyteConne from metadata.ingestion.ometa.client import REST, APIError, ClientConfig from metadata.utils.constants import AUTHORIZATION_HEADER, NO_ACCESS_TOKEN from metadata.utils.credentials import generate_http_basic_token +from metadata.utils.helpers import clean_uri class AirbyteClient: @@ -30,8 +31,8 @@ class AirbyteClient: def __init__(self, config: AirbyteConnection): self.config = config client_config: ClientConfig = ClientConfig( - base_url=str(self.config.hostPort), - api_version="api/v1", + base_url=clean_uri(self.config.hostPort), + api_version=self.config.apiVersion, auth_header=AUTHORIZATION_HEADER, auth_token=lambda: (NO_ACCESS_TOKEN, 0), ) diff --git a/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/index.md b/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/index.md index 9fb026318f5..4c0abb7b60a 100644 --- a/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/index.md +++ b/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/index.md @@ -38,6 +38,12 @@ Configure and schedule Airbyte metadata and profiler workflows from the OpenMeta - **Host and Port**: Pipeline Service Management UI URL +- **Username**: Username to connect to Airbyte. + +- **Password**: Password to connect to Airbyte. + +- **API Version**: Version of the Airbyte REST API by default `api/v1`. + {% /extraContent %} {% partial file="/v1.6/connectors/test-connection.md" /%} diff --git a/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/yaml.md b/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/yaml.md index 4337cf7db36..94c2e71439c 100644 --- a/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/yaml.md +++ b/openmetadata-docs/content/v1.6.x/connectors/pipeline/airbyte/yaml.md @@ -59,6 +59,23 @@ This is a sample config for Airbyte: **hostPort**: Pipeline Service Management UI URL +{% /codeInfo %} + +{% codeInfo srNumber=2 %} + +**username**: Username to connect to Airbyte. + +{% /codeInfo %} + +{% codeInfo srNumber=3 %} + +**password**: Password to connect to Airbyte. + +{% /codeInfo %} + +{% codeInfo srNumber=4 %} + +**apiVersion**: Version of the Airbyte REST API by default `api/v1`. {% /codeInfo %} @@ -86,6 +103,15 @@ source: ```yaml {% srNumber=1 %} hostPort: http://localhost:8000 ``` +```yaml {% srNumber=2 %} + username: +``` +```yaml {% srNumber=3 %} + password: +``` +```yaml {% srNumber=4 %} + apiVersion: api/v1 +``` {% partial file="/v1.6/connectors/yaml/pipeline/source-config.md" /%} diff --git a/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/index.md b/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/index.md index 3a4e957db53..516adcf275f 100644 --- a/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/index.md +++ b/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/index.md @@ -38,6 +38,12 @@ Configure and schedule Airbyte metadata and profiler workflows from the OpenMeta - **Host and Port**: Pipeline Service Management UI URL +- **Username**: Username to connect to Airbyte. + +- **Password**: Password to connect to Airbyte. + +- **API Version**: Version of the Airbyte REST API by default `api/v1`. + {% /extraContent %} {% partial file="/v1.7/connectors/test-connection.md" /%} diff --git a/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/yaml.md b/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/yaml.md index 86a41d18bd0..14007eb8180 100644 --- a/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/yaml.md +++ b/openmetadata-docs/content/v1.7.x-SNAPSHOT/connectors/pipeline/airbyte/yaml.md @@ -59,6 +59,23 @@ This is a sample config for Airbyte: **hostPort**: Pipeline Service Management UI URL +{% /codeInfo %} + +{% codeInfo srNumber=2 %} + +**username**: Username to connect to Airbyte. + +{% /codeInfo %} + +{% codeInfo srNumber=3 %} + +**password**: Password to connect to Airbyte. + +{% /codeInfo %} + +{% codeInfo srNumber=4 %} + +**apiVersion**: Version of the Airbyte REST API by default `api/v1`. {% /codeInfo %} @@ -86,6 +103,15 @@ source: ```yaml {% srNumber=1 %} hostPort: http://localhost:8000 ``` +```yaml {% srNumber=2 %} + username: +``` +```yaml {% srNumber=3 %} + password: +``` +```yaml {% srNumber=4 %} + apiVersion: api/v1 +``` {% partial file="/v1.7/connectors/yaml/pipeline/source-config.md" /%} diff --git a/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/pipeline/airbyteConnection.json b/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/pipeline/airbyteConnection.json index 867292cfe4e..7ce93dc3eae 100644 --- a/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/pipeline/airbyteConnection.json +++ b/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/pipeline/airbyteConnection.json @@ -37,6 +37,12 @@ "type": "string", "format": "password" }, + "apiVersion": { + "title": "API Version", + "description": "Airbyte API version.", + "type": "string", + "default": "api/v1" + }, "supportsMetadataExtraction": { "title": "Supports Metadata Extraction", "$ref": "../connectionBasicType.json#/definitions/supportsMetadataExtraction" diff --git a/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Pipeline/Airbyte.md b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Pipeline/Airbyte.md index 930ce605284..75b314b0d7c 100644 --- a/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Pipeline/Airbyte.md +++ b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Pipeline/Airbyte.md @@ -25,3 +25,9 @@ $$section ### Password $(id="password") Password to connect to Airbyte. $$ + +$$section +### Api Version $(id="apiVersion") + +Version of the Airbyte REST API by default `api/v1`. +$$ \ No newline at end of file diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/pipeline/airbyteConnection.ts b/openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/pipeline/airbyteConnection.ts index e257fdcd17d..b238962b5fe 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/pipeline/airbyteConnection.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/pipeline/airbyteConnection.ts @@ -16,6 +16,10 @@ * Airbyte Metadata Database Connection Config */ export interface AirbyteConnection { + /** + * Airbyte API version. + */ + apiVersion?: string; /** * Pipeline Service Management/UI URL. */