(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
import dateutil.parser
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='string',
url='https://complicated-seat.org',
),
name='string',
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='string',
)
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='string',
)
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(
o_auth_input_configuration=shared.OAuthInputConfiguration(),
redirect_url='string',
source_type=shared.OAuthActorNames.GOOGLE_ADS,
workspace_id='fd28130d-9919-4ffa-a67d-4e12eb099447',
)
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(
workspace_ids=[
'74dbbb77-f80b-457c-8540-0c5d47a64428',
],
)
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
import dateutil.parser
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_patch_request=shared.SourcePatchRequest(
configuration=shared.SourceAha(
api_key='string',
url='http://apprehensive-visa.net',
),
name='My source',
),
source_id='string',
)
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
import dateutil.parser
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_put_request=shared.SourcePutRequest(
configuration=shared.SourceAha(
api_key='string',
url='http://alienated-traveler.name',
),
name='string',
),
source_id='string',
)
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 | / |