Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
kolorful authored Aug 2, 2023
2 parents 16628ac + 9886059 commit c73135e
Show file tree
Hide file tree
Showing 173 changed files with 7,911 additions and 834 deletions.
33 changes: 33 additions & 0 deletions airbyte-api-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Airbyte API Server

**Purpose:**

- Enables users to control Airbyte programmatically and use with Orchestration tools (ex: Airflow, Dagster, Prefect)
- Exists for Airbyte users to write applications against and enable [Powered by Airbyte](https://airbyte.com/embed-airbyte-connectors-with-api) (
Headless version and UI version)

**Documentation**

Documentation for the API can be found at https://reference.airbyte.com/ and is powered by readme.io. The documentation currently only fully supports
Airbyte Cloud. We will have pages specific to OSS Airbtye Instances soon!

The main differences will be configuration inputs for the source and destination create endpoints.
OAuth endpoints and workspace updates are not supported in OSS currently.

**Local Airbyte Instance Usage**

*Docker Compose*

If your instance of Airbyte is running locally using docker-compose, you can access the Airbyte API of the local instance by spinning up with the
latest docker compose files. You can then make a call to `http://localhost:8006/v1/<endpoint>` or the health endpoint
at `http://localhost:8006/health`. Calls to the Airbyte API through docker compose will go through the airbyte-proxy, which requires basic auth with a
user and password supplied in the .env files.

*Kubernetes*

If you are running an instance of Airbyte locally using kubernetes, you can access the Airbyte API of the local instance by:

1. Enabling the airbyte-api-server pod though helm with `helm install %release_name% charts/airbyte --set airbyte-api-server.enabled=true`
or `helm upgrade %release_name% charts/airbyte --set airbyte-api-server.enabled=true` if you already have an instance running.
2. Setting up a port forward to the airbyte-api-server kube svc by running `kubectl port-forward svc/airbyte-airbyte-api-server-svc 8006:80 &`
3. Making a call to `http://localhost:8006/v1/<endpoint>` or the health endpoint at `http://localhost:8006/health`.
15 changes: 15 additions & 0 deletions airbyte-api-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ plugins {
}

dependencies {
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl'

kapt(platform(libs.micronaut.bom))
kapt(libs.bundles.micronaut.annotation.processor)

Expand All @@ -18,12 +20,18 @@ dependencies {
annotationProcessor libs.bundles.micronaut.annotation.processor
annotationProcessor libs.micronaut.jaxrs.processor

implementation project(':airbyte-analytics')
implementation project(':airbyte-api')
implementation project(':airbyte-commons')
implementation project(':airbyte-config:config-models')
implementation 'com.cronutils:cron-utils:9.2.1'
implementation libs.bundles.jackson

implementation platform(libs.micronaut.bom)
implementation libs.bundles.micronaut
implementation libs.bundles.micronaut.data.jdbc
implementation libs.micronaut.jaxrs.server
implementation libs.micronaut.problem.json
implementation libs.micronaut.security

implementation libs.sentry.java
Expand All @@ -42,6 +50,13 @@ dependencies {
testImplementation libs.platform.testcontainers.postgresql
testImplementation libs.mockwebserver
testImplementation libs.mockito.inline

implementation libs.airbyte.protocol

}

kapt {
correctErrorTypes true
}

Properties env = new Properties()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2023 Airbyte, Inc., all rights reserved.
*/

package io.airbyte.api.server

import io.micronaut.runtime.Micronaut.run
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2023 Airbyte, Inc., all rights reserved.
*/

package io.airbyte.api.server.constants

const val INTERNAL_API_HOST = "http://\${airbyte.internal.api.host}"
const val AUTH_HEADER = "Authorization"
const val ENDPOINT_API_USER_INFO_HEADER = "X-Endpoint-API-UserInfo"
const val ANALYTICS_HEADER = "X-Airbyte-Analytic-Source"
const val ANALYTICS_HEADER_VALUE = "airbyte-api"

const val AIRBYTE_API_AUTH_HEADER_VALUE = "AIRBYTE_API_AUTH_HEADER_VALUE"
const val API_DOC_URL = "https://reference.airbyte.com"
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2023 Airbyte, Inc., all rights reserved.
*/

package io.airbyte.api.server.constants

const val SOURCE_TYPE = "sourceType"
const val DESTINATION_TYPE = "destinationType"

const val CONNECTIONS_PATH = "/v1/connections"
const val CONNECTIONS_WITH_ID_PATH = "$CONNECTIONS_PATH/{connectionId}"
const val STREAMS_PATH = "/v1/streams"
const val JOBS_PATH = "/v1/jobs"
const val JOBS_WITH_ID_PATH = "$JOBS_PATH/{jobId}"
const val SOURCES_PATH = "/v1/sources"
const val INITIATE_OAUTH_PATH = "$SOURCES_PATH/initiateOAuth"
const val SOURCES_WITH_ID_PATH = "$SOURCES_PATH/{sourceId}"
const val DESTINATIONS_PATH = "/v1/destinations"
const val DESTINATIONS_WITH_ID_PATH = "$DESTINATIONS_PATH/{destinationId}"
const val WORKSPACES_PATH = "/v1/workspaces"
const val WORKSPACES_WITH_ID_PATH = "$WORKSPACES_PATH/{workspaceId}"
const val WORKSPACES_WITH_ID_AND_OAUTH_PATH = "$WORKSPACES_WITH_ID_PATH/oauth_credentials"

val POST = io.micronaut.http.HttpMethod.POST.name
val GET = io.micronaut.http.HttpMethod.GET.name
val PATCH = io.micronaut.http.HttpMethod.PATCH.name
val DELETE = io.micronaut.http.HttpMethod.DELETE.name
val PUT = io.micronaut.http.HttpMethod.PUT.name

const val WORKSPACE_IDS = "workspaceIds"
const val INCLUDE_DELETED = "includeDeleted"

const val OAUTH_CALLBACK_PATH = "/v1/oauth/callback"

const val MESSAGE = "message"

const val PARTIAL_UPDATE_OAUTH_KEY = "PARTIAL_UPDATE_OAUTH_KEY"

const val HTTP_RESPONSE_BODY_DEBUG_MESSAGE = "HttpResponse body: "
Loading

0 comments on commit c73135e

Please sign in to comment.