Skip to content

Latest commit

 

History

History
executable file
·
749 lines (672 loc) · 24 KB

README.md

File metadata and controls

executable file
·
749 lines (672 loc) · 24 KB

connection

Overview

Connection between sources and destinations.

Available Operations

create_connection

Create a connection between a source and a destination

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionCreate(
    destination_id='b5e6e13b-99d4-488e-9e91-e450ad2abd44',
    geography=shared.GeographyEnum.AUTO,
    name='Mr. Shelly Lueilwitz',
    namespace_definition=shared.NamespaceDefinitionTypeEnum.DESTINATION,
    namespace_format='${SOURCE_NAMESPACE}',
    non_breaking_changes_preference=shared.NonBreakingChangesPreferenceEnum.IGNORE,
    notify_schema_changes=False,
    operation_ids=[
        'a94bb4f6-3c96-49e9-a3ef-a77dfb14cd66',
    ],
    prefix='laborum',
    resource_requirements=shared.ResourceRequirements(
        cpu_limit='accusamus',
        cpu_request='non',
        memory_limit='occaecati',
        memory_request='enim',
    ),
    schedule=shared.ConnectionSchedule(
        time_unit=shared.ConnectionScheduleTimeUnitEnum.MONTHS,
        units=965417,
    ),
    schedule_data=shared.ConnectionScheduleData(
        basic_schedule=shared.ConnectionScheduleDataBasicSchedule(
            time_unit=shared.ConnectionScheduleDataBasicScheduleTimeUnitEnum.WEEKS,
            units=588465,
        ),
        cron=shared.ConnectionScheduleDataCron(
            cron_expression='nam',
            cron_time_zone='id',
        ),
    ),
    schedule_type=shared.ConnectionScheduleTypeEnum.BASIC,
    source_catalog_id='8f3a6699-7074-4ba4-869b-6e2141959890',
    source_id='afa563e2-516f-4e4c-8b71-1e5b7fd2ed02',
    status=shared.ConnectionStatusEnum.INACTIVE,
    sync_catalog=shared.AirbyteCatalog(
        streams=[
            shared.AirbyteStreamAndConfiguration(
                config=shared.AirbyteStreamConfiguration(
                    alias_name='magni',
                    cursor_field=[
                        'quo',
                    ],
                    destination_sync_mode=shared.DestinationSyncModeEnum.APPEND_DEDUP,
                    field_selection_enabled=False,
                    primary_key=[
                        [
                            'ea',
                            'excepturi',
                            'odit',
                            'ea',
                        ],
                        [
                            'ab',
                        ],
                        [
                            'quidem',
                            'ipsam',
                            'voluptate',
                            'autem',
                        ],
                        [
                            'eaque',
                            'pariatur',
                            'nemo',
                        ],
                    ],
                    selected=False,
                    selected_fields=[
                        shared.SelectedFieldInfo(
                            field_path=[
                                'fugiat',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'aut',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'corporis',
                                'hic',
                                'libero',
                                'nobis',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'quis',
                            ],
                        ),
                    ],
                    suggested=False,
                    sync_mode=shared.SyncModeEnum.INCREMENTAL,
                ),
                stream=shared.AirbyteStream(
                    default_cursor_field=[
                        'eaque',
                        'quis',
                    ],
                    json_schema={
                        "eos": 'perferendis',
                    },
                    name='Brooke Kohler',
                    namespace='nostrum',
                    source_defined_cursor=False,
                    source_defined_primary_key=[
                        [
                            'omnis',
                            'facilis',
                            'perspiciatis',
                            'voluptatem',
                        ],
                        [
                            'consequuntur',
                            'blanditiis',
                            'error',
                            'eaque',
                        ],
                        [
                            'rerum',
                            'adipisci',
                            'asperiores',
                        ],
                        [
                            'modi',
                            'iste',
                            'dolorum',
                            'deleniti',
                        ],
                    ],
                    supported_sync_modes=[
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                    ],
                ),
            ),
            shared.AirbyteStreamAndConfiguration(
                config=shared.AirbyteStreamConfiguration(
                    alias_name='quaerat',
                    cursor_field=[
                        'aliquid',
                        'dolorem',
                        'dolorem',
                    ],
                    destination_sync_mode=shared.DestinationSyncModeEnum.APPEND,
                    field_selection_enabled=False,
                    primary_key=[
                        [
                            'hic',
                        ],
                    ],
                    selected=False,
                    selected_fields=[
                        shared.SelectedFieldInfo(
                            field_path=[
                                'voluptate',
                                'dignissimos',
                                'reiciendis',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'dolorum',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'veritatis',
                                'ipsa',
                            ],
                        ),
                    ],
                    suggested=False,
                    sync_mode=shared.SyncModeEnum.FULL_REFRESH,
                ),
                stream=shared.AirbyteStream(
                    default_cursor_field=[
                        'odio',
                        'quaerat',
                    ],
                    json_schema={
                        "quidem": 'voluptatibus',
                        "voluptas": 'natus',
                        "eos": 'atque',
                        "sit": 'fugiat',
                    },
                    name='Latoya Parisian',
                    namespace='dolorum',
                    source_defined_cursor=False,
                    source_defined_primary_key=[
                        [
                            'necessitatibus',
                            'distinctio',
                            'asperiores',
                        ],
                        [
                            'ipsum',
                            'voluptate',
                        ],
                        [
                            'saepe',
                            'eius',
                            'aspernatur',
                        ],
                    ],
                    supported_sync_modes=[
                        shared.SyncModeEnum.FULL_REFRESH,
                    ],
                ),
            ),
            shared.AirbyteStreamAndConfiguration(
                config=shared.AirbyteStreamConfiguration(
                    alias_name='optio',
                    cursor_field=[
                        'ad',
                        'saepe',
                        'suscipit',
                        'deserunt',
                    ],
                    destination_sync_mode=shared.DestinationSyncModeEnum.OVERWRITE,
                    field_selection_enabled=False,
                    primary_key=[
                        [
                            'totam',
                            'similique',
                            'alias',
                            'at',
                        ],
                        [
                            'tempora',
                            'vel',
                        ],
                    ],
                    selected=False,
                    selected_fields=[
                        shared.SelectedFieldInfo(
                            field_path=[
                                'qui',
                                'dolorum',
                                'a',
                                'esse',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'iusto',
                                'ipsum',
                                'quisquam',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'amet',
                                'tempore',
                                'accusamus',
                                'numquam',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'dolorem',
                                'sapiente',
                            ],
                        ),
                    ],
                    suggested=False,
                    sync_mode=shared.SyncModeEnum.INCREMENTAL,
                ),
                stream=shared.AirbyteStream(
                    default_cursor_field=[
                        'sit',
                        'expedita',
                    ],
                    json_schema={
                        "sed": 'vel',
                    },
                    name='Glen Oberbrunner',
                    namespace='incidunt',
                    source_defined_cursor=False,
                    source_defined_primary_key=[
                        [
                            'maxime',
                            'pariatur',
                            'soluta',
                        ],
                    ],
                    supported_sync_modes=[
                        shared.SyncModeEnum.INCREMENTAL,
                    ],
                ),
            ),
        ],
    ),
)

res = s.connection.create_connection(req)

if res.connection_read is not None:
    # handle response

delete_connection

Delete a connection

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionIDRequestBody(
    connection_id='8422bb67-9d23-4227-95bf-0cbb1e31b8b9',
)

res = s.connection.delete_connection(req)

if res.status_code == 200:
    # handle response

get_connection

Get a connection

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionIDRequestBody(
    connection_id='0f3443a1-108e-40ad-8f4b-921879fce953',
)

res = s.connection.get_connection(req)

if res.connection_read is not None:
    # handle response

list_all_connections_for_workspace

List connections for workspace, including deleted connections.

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.WorkspaceIDRequestBody(
    workspace_id='f73ef7fb-c7ab-4d74-9d39-c0f5d2cff7c7',
)

res = s.connection.list_all_connections_for_workspace(req)

if res.connection_read_list is not None:
    # handle response

list_connections_for_workspace

List connections for workspace. Does not return deleted connections.

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.WorkspaceIDRequestBody(
    workspace_id='0a45626d-4368-413f-96d9-f5fce6c55614',
)

res = s.connection.list_connections_for_workspace(req)

if res.connection_read_list is not None:
    # handle response

reset_connection

Reset the data for the connection. Deletes data generated by the connection in the destination. Resets any cursors back to initial state.

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionIDRequestBody(
    connection_id='6c3e250f-b008-4c42-a141-aac366c8dd6b',
)

res = s.connection.reset_connection(req)

if res.job_info_read is not None:
    # handle response

search_connections

Search connections

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionSearch(
    connection_id='14429074-7477-48a7-bd46-6d28c10ab3cd',
    destination=shared.DestinationSearch(
        connection_configuration='quo',
        destination_definition_id='a4251904-e523-4c7e-8bc7-178e4796f2a7',
        destination_id='0c688282-aa48-4256-af22-2e9817ee17cb',
        destination_name='vero',
        name='Frances Turner',
        workspace_id='7b95bc0a-b3c2-40c4-b378-9fd871f99dd2',
    ),
    destination_id='efd121aa-6f1e-4674-bdb0-4f15756082d6',
    name='Miss Percy Parisian',
    namespace_definition=shared.NamespaceDefinitionTypeEnum.SOURCE,
    namespace_format='${SOURCE_NAMESPACE}',
    prefix='at',
    schedule=shared.ConnectionSchedule(
        time_unit=shared.ConnectionScheduleTimeUnitEnum.MINUTES,
        units=454162,
    ),
    schedule_data=shared.ConnectionScheduleData(
        basic_schedule=shared.ConnectionScheduleDataBasicSchedule(
            time_unit=shared.ConnectionScheduleDataBasicScheduleTimeUnitEnum.MINUTES,
            units=326701,
        ),
        cron=shared.ConnectionScheduleDataCron(
            cron_expression='veritatis',
            cron_time_zone='consectetur',
        ),
    ),
    schedule_type=shared.ConnectionScheduleTypeEnum.MANUAL,
    source=shared.SourceSearch(
        connection_configuration='iste',
        name='Ms. Kenneth Ledner',
        source_definition_id='a1840394-c260-471f-93f5-f0642dac7af5',
        source_id='15cc413a-a63a-4ae8-9678-64dbb675fd5e',
        source_name='aliquid',
        workspace_id='0b375ed4-f6fb-4ee4-9f33-317fe35b60eb',
    ),
    source_id='1ea42655-5ba3-4c28-b44e-d53b88f3a8d8',
    status=shared.ConnectionStatusEnum.DEPRECATED,
)

res = s.connection.search_connections(req)

if res.connection_read_list is not None:
    # handle response

sync_connection

Trigger a manual sync of the connection

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionIDRequestBody(
    connection_id='5c0b2f2f-b7b1-494a-a76b-26916fe1f08f',
)

res = s.connection.sync_connection(req)

if res.job_info_read is not None:
    # handle response

update_connection

Apply a patch-style update to a connection. Only fields present on the update request body will be updated. Note that if a catalog is present in the request body, the connection's entire catalog will be replaced with the catalog from the request. This means that to modify a single stream, the entire new catalog containing the updated stream needs to be sent.

Example Usage

import airbyte
from airbyte.models import shared

s = airbyte.Airbyte()

req = shared.ConnectionUpdate(
    breaking_change=False,
    connection_id='4294e369-8f44-47f6-83e8-b445e80ca55e',
    geography=shared.GeographyEnum.EU,
    name='Martin Beatty',
    namespace_definition=shared.NamespaceDefinitionTypeEnum.SOURCE,
    namespace_format='${SOURCE_NAMESPACE}',
    non_breaking_changes_preference=shared.NonBreakingChangesPreferenceEnum.IGNORE,
    notify_schema_changes=False,
    operation_ids=[
        '1858b6a8-9fbe-43a5-aa8e-4824d0ab4075',
        '088e5186-2065-4e90-8f3b-1194b8abf603',
        'a79f9dfe-0ab7-4da8-a50c-e187f86bc173',
        'd689eee9-526f-48d9-86e8-81ead4f0e101',
    ],
    prefix='dolores',
    resource_requirements=shared.ResourceRequirements(
        cpu_limit='enim',
        cpu_request='laboriosam',
        memory_limit='velit',
        memory_request='a',
    ),
    schedule=shared.ConnectionSchedule(
        time_unit=shared.ConnectionScheduleTimeUnitEnum.DAYS,
        units=300029,
    ),
    schedule_data=shared.ConnectionScheduleData(
        basic_schedule=shared.ConnectionScheduleDataBasicSchedule(
            time_unit=shared.ConnectionScheduleDataBasicScheduleTimeUnitEnum.MONTHS,
            units=160467,
        ),
        cron=shared.ConnectionScheduleDataCron(
            cron_expression='occaecati',
            cron_time_zone='officiis',
        ),
    ),
    schedule_type=shared.ConnectionScheduleTypeEnum.BASIC,
    source_catalog_id='73e922a5-7a15-4be3-a060-807e2b6e3ab8',
    status=shared.ConnectionStatusEnum.INACTIVE,
    sync_catalog=shared.AirbyteCatalog(
        streams=[
            shared.AirbyteStreamAndConfiguration(
                config=shared.AirbyteStreamConfiguration(
                    alias_name='ad',
                    cursor_field=[
                        'alias',
                        'corporis',
                        'perspiciatis',
                        'nihil',
                    ],
                    destination_sync_mode=shared.DestinationSyncModeEnum.OVERWRITE,
                    field_selection_enabled=False,
                    primary_key=[
                        [
                            'maiores',
                        ],
                        [
                            'dolores',
                            'id',
                            'minima',
                            'dolore',
                        ],
                    ],
                    selected=False,
                    selected_fields=[
                        shared.SelectedFieldInfo(
                            field_path=[
                                'quae',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'omnis',
                                'quaerat',
                                'molestiae',
                                'ex',
                            ],
                        ),
                        shared.SelectedFieldInfo(
                            field_path=[
                                'culpa',
                                'adipisci',
                            ],
                        ),
                    ],
                    suggested=False,
                    sync_mode=shared.SyncModeEnum.INCREMENTAL,
                ),
                stream=shared.AirbyteStream(
                    default_cursor_field=[
                        'eum',
                        'nemo',
                        'recusandae',
                    ],
                    json_schema={
                        "provident": 'quis',
                        "eum": 'reiciendis',
                    },
                    name='Miss Bruce Hermann',
                    namespace='mollitia',
                    source_defined_cursor=False,
                    source_defined_primary_key=[
                        [
                            'animi',
                            'ex',
                            'aliquid',
                            'accusantium',
                        ],
                        [
                            'doloribus',
                            'ullam',
                            'in',
                            'nam',
                        ],
                        [
                            'officia',
                            'laborum',
                            'placeat',
                            'modi',
                        ],
                    ],
                    supported_sync_modes=[
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                    ],
                ),
            ),
            shared.AirbyteStreamAndConfiguration(
                config=shared.AirbyteStreamConfiguration(
                    alias_name='vitae',
                    cursor_field=[
                        'tempora',
                        'quis',
                        'inventore',
                    ],
                    destination_sync_mode=shared.DestinationSyncModeEnum.APPEND,
                    field_selection_enabled=False,
                    primary_key=[
                        [
                            'perferendis',
                        ],
                        [
                            'aspernatur',
                        ],
                        [
                            'eius',
                            'rem',
                        ],
                        [
                            'impedit',
                            'eos',
                            'sapiente',
                            'eum',
                        ],
                    ],
                    selected=False,
                    selected_fields=[
                        shared.SelectedFieldInfo(
                            field_path=[
                                'beatae',
                                'cupiditate',
                            ],
                        ),
                    ],
                    suggested=False,
                    sync_mode=shared.SyncModeEnum.INCREMENTAL,
                ),
                stream=shared.AirbyteStream(
                    default_cursor_field=[
                        'soluta',
                        'hic',
                        'illum',
                        'eaque',
                    ],
                    json_schema={
                        "perspiciatis": 'maiores',
                        "debitis": 'aliquid',
                        "porro": 'suscipit',
                        "dolorem": 'fugit',
                    },
                    name='Grant Dickens',
                    namespace='nulla',
                    source_defined_cursor=False,
                    source_defined_primary_key=[
                        [
                            'et',
                        ],
                    ],
                    supported_sync_modes=[
                        shared.SyncModeEnum.INCREMENTAL,
                        shared.SyncModeEnum.INCREMENTAL,
                    ],
                ),
            ),
        ],
    ),
)

res = s.connection.update_connection(req)

if res.connection_read is not None:
    # handle response