(connections)
- create_connection - Create a connection
- delete_connection - Delete a Connection
- get_connection - Get Connection details
- list_connections - List connections
- patch_connection - Update Connection details
Create a connection
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.ConnectionCreateRequest(
configurations=shared.StreamConfigurations(
streams=[
shared.StreamConfiguration(
cursor_field=[
'string',
],
name='string',
primary_key=[
[
'string',
],
],
),
],
),
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
namespace_format='${SOURCE_NAMESPACE}',
schedule=shared.ConnectionSchedule(
schedule_type=shared.ScheduleTypeEnum.MANUAL,
),
source_id='dd427d83-a555-4847-8358-42325b6c7b3f',
)
res = s.connections.create_connection(req)
if res.connection_response is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.ConnectionCreateRequest | ✔️ | The request object to use for the request. |
operations.CreateConnectionResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4x-5xx | / |
Delete a Connection
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.DeleteConnectionRequest(
connection_id='string',
)
res = s.connections.delete_connection(req)
if res.status_code == 200:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteConnectionRequest | ✔️ | The request object to use for the request. |
operations.DeleteConnectionResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4x-5xx | / |
Get Connection 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.GetConnectionRequest(
connection_id='string',
)
res = s.connections.get_connection(req)
if res.connection_response is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetConnectionRequest | ✔️ | The request object to use for the request. |
operations.GetConnectionResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4x-5xx | / |
List connections
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.ListConnectionsRequest(
workspace_ids=[
'bed8f6e5-32a5-45f7-9c2b-30682edc8796',
],
)
res = s.connections.list_connections(req)
if res.connections_response is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListConnectionsRequest | ✔️ | The request object to use for the request. |
operations.ListConnectionsResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4x-5xx | / |
Update Connection 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.PatchConnectionRequest(
connection_patch_request=shared.ConnectionPatchRequest(
configurations=shared.StreamConfigurations(
streams=[
shared.StreamConfiguration(
cursor_field=[
'string',
],
name='string',
primary_key=[
[
'string',
],
],
),
],
),
namespace_format='${SOURCE_NAMESPACE}',
schedule=shared.ConnectionSchedule(
schedule_type=shared.ScheduleTypeEnum.MANUAL,
),
),
connection_id='string',
)
res = s.connections.patch_connection(req)
if res.connection_response is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PatchConnectionRequest | ✔️ | The request object to use for the request. |
operations.PatchConnectionResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4x-5xx | / |