Skip to content

Latest commit

 

History

History
283 lines (211 loc) · 10.9 KB

File metadata and controls

283 lines (211 loc) · 10.9 KB

Connections

(connections)

Available Operations

create_connection

Create a connection

Example Usage

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

Parameters

Parameter Type Required Description
request shared.ConnectionCreateRequest ✔️ The request object to use for the request.

Response

operations.CreateConnectionResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4x-5xx /

delete_connection

Delete a Connection

Example Usage

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

Parameters

Parameter Type Required Description
request operations.DeleteConnectionRequest ✔️ The request object to use for the request.

Response

operations.DeleteConnectionResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4x-5xx /

get_connection

Get Connection details

Example Usage

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

Parameters

Parameter Type Required Description
request operations.GetConnectionRequest ✔️ The request object to use for the request.

Response

operations.GetConnectionResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4x-5xx /

list_connections

List connections

Example Usage

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

Parameters

Parameter Type Required Description
request operations.ListConnectionsRequest ✔️ The request object to use for the request.

Response

operations.ListConnectionsResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4x-5xx /

patch_connection

Update Connection details

Example Usage

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

Parameters

Parameter Type Required Description
request operations.PatchConnectionRequest ✔️ The request object to use for the request.

Response

operations.PatchConnectionResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4x-5xx /