Skip to content

Commit

Permalink
Fix configuration api name
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Dec 5, 2024
1 parent 31d4688 commit 2ffd65b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
AIRBYTE_REST_API_BASE = "https://api.airbyte.com"
AIRBYTE_REST_API_VERSION = "v1"

AIRBYTE_SERVER_API_BASE = "https://cloud.airbyte.com/api"
AIRBYTE_SERVER_API_VERSION = "v1"
AIRBYTE_CONFIGURATION_API_BASE = "https://cloud.airbyte.com/api"
AIRBYTE_CONFIGURATION_API_VERSION = "v1"

DEFAULT_POLL_INTERVAL_SECONDS = 10

Expand Down Expand Up @@ -843,8 +843,8 @@ def rest_api_base_url(self) -> str:
return f"{AIRBYTE_REST_API_BASE}/{AIRBYTE_REST_API_VERSION}"

@property
def server_api_base_url(self) -> str:
return f"{AIRBYTE_SERVER_API_BASE}/{AIRBYTE_SERVER_API_VERSION}"
def configuration_api_base_url(self) -> str:
return f"{AIRBYTE_CONFIGURATION_API_BASE}/{AIRBYTE_CONFIGURATION_API_VERSION}"

@property
def all_additional_request_params(self) -> Mapping[str, Any]:
Expand Down Expand Up @@ -960,13 +960,13 @@ def get_connections(self) -> Mapping[str, Any]:
)

def get_connection_details(self, connection_id) -> Mapping[str, Any]:
"""Fetches details about a given connection from the Airbyte Server API."""
# Using the Server API to get the connection details, including streams and their configs.
"""Fetches details about a given connection from the Airbyte Configuration API."""
# Using the Airbyte Configuration API to get the connection details, including streams and their configs.
# https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/connections/get
return self._make_request(
method="POST",
endpoint="connections/get",
base_url=self.server_api_base_url,
base_url=self.configuration_api_base_url,
data={"connectionId": connection_id},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import pytest
import responses
from dagster_airbyte.resources import (
AIRBYTE_CONFIGURATION_API_BASE,
AIRBYTE_CONFIGURATION_API_VERSION,
AIRBYTE_REST_API_BASE,
AIRBYTE_REST_API_VERSION,
AIRBYTE_SERVER_API_BASE,
AIRBYTE_SERVER_API_VERSION,
)

TEST_WORKSPACE_ID = "some_workspace_id"
Expand Down Expand Up @@ -45,7 +45,7 @@
}


# Taken from Airbyte Server API documentation
# Taken from Airbyte Configuration API documentation
# https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/connections/get
SAMPLE_CONNECTION_DETAILS = {
"connectionId": TEST_CONNECTION_ID,
Expand Down Expand Up @@ -165,7 +165,7 @@ def fetch_workspace_data_api_mocks_fixture(
)
base_api_mocks.add(
method=responses.POST,
url=f"{AIRBYTE_SERVER_API_BASE}/{AIRBYTE_SERVER_API_VERSION}/connections/get",
url=f"{AIRBYTE_CONFIGURATION_API_BASE}/{AIRBYTE_CONFIGURATION_API_VERSION}/connections/get",
json=SAMPLE_CONNECTION_DETAILS,
status=200,
)
Expand Down

0 comments on commit 2ffd65b

Please sign in to comment.