(sources)
- create_source - Create a source
- delete_source - Delete a Source
- get_source - Get Source details
- initiate_o_auth - Initiate OAuth for a source
- list_sources - List sources
- patch_source - Update a Source
- put_source - Update a Source and fully overwrite it
Creates a source given a name, workspace id, and a json blob containing the configuration for the source.
import airbyte
from airbyte.models import shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = shared.SourceCreateRequest(
configuration=shared.SourceAha(
api_key='<value>',
url='https://complicated-seat.org',
),
name='<value>',
workspace_id='0f31f3dd-c984-48c3-8bdf-b109056aa6d6',
)
res = s.sources.create_source(req)
if res.source_response is not None:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
shared.SourceCreateRequest | ✔️ | The request object to use for the request. |
operations.CreateSourceResponse
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |
Delete a Source
import airbyte
from airbyte.models import operations, shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = operations.DeleteSourceRequest(
source_id='<value>',
)
res = s.sources.delete_source(req)
if res.status_code == 200:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteSourceRequest | ✔️ | The request object to use for the request. |
operations.DeleteSourceResponse
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |
Get Source details
import airbyte
from airbyte.models import operations, shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = operations.GetSourceRequest(
source_id='<value>',
)
res = s.sources.get_source(req)
if res.source_response is not None:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetSourceRequest | ✔️ | The request object to use for the request. |
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |
Given a source ID, workspace ID, and redirect URL, initiates OAuth for the source.
This returns a fully formed URL for performing user authentication against the relevant source identity provider (IdP). Once authentication has been completed, the IdP will redirect to an Airbyte endpoint which will save the access and refresh tokens off as a secret and return the secret ID to the redirect URL specified in the secret_id query string parameter.
That secret ID can be used to create a source with credentials in place of actual tokens.
import airbyte
from airbyte.models import shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = shared.InitiateOauthRequest(
redirect_url='https://cloud.airbyte.io/v1/api/oauth/callback',
source_type=shared.OAuthActorNames.GOOGLE_ADS,
workspace_id='871d9b60-11d1-44cb-8c92-c246d53bf87e',
o_auth_input_configuration=shared.OAuthInputConfiguration(),
)
res = s.sources.initiate_o_auth(req)
if res.status_code == 200:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
shared.InitiateOauthRequest | ✔️ | The request object to use for the request. |
operations.InitiateOAuthResponse
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |
List sources
import airbyte
from airbyte.models import operations, shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = operations.ListSourcesRequest()
res = s.sources.list_sources(req)
if res.sources_response is not None:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ListSourcesRequest | ✔️ | The request object to use for the request. |
operations.ListSourcesResponse
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |
Update a Source
import airbyte
from airbyte.models import operations, shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = operations.PatchSourceRequest(
source_id='<value>',
)
res = s.sources.patch_source(req)
if res.source_response is not None:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PatchSourceRequest | ✔️ | The request object to use for the request. |
operations.PatchSourceResponse
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |
Update a Source and fully overwrite it
import airbyte
from airbyte.models import operations, shared
s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)
req = operations.PutSourceRequest(
source_id='<value>',
)
res = s.sources.put_source(req)
if res.source_response is not None:
# handle response
pass| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PutSourceRequest | ✔️ | The request object to use for the request. |
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4x-5xx | / |