Skip to content

Latest commit

 

History

History
365 lines (263 loc) · 13.8 KB

File metadata and controls

365 lines (263 loc) · 13.8 KB

Sources

(sources)

Available Operations

create_source

Creates a source given a name, workspace id, and a json blob containing the configuration for the source.

Example Usage

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

Parameters

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

Response

operations.CreateSourceResponse

Errors

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

delete_source

Delete a Source

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.DeleteSourceRequest(
    source_id='string',
)

res = s.sources.delete_source(req)

if res.status_code == 200:
    # handle response
    pass

Parameters

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

Response

operations.DeleteSourceResponse

Errors

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

get_source

Get Source 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.GetSourceRequest(
    source_id='string',
)

res = s.sources.get_source(req)

if res.source_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.GetSourceResponse

Errors

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

initiate_o_auth

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.

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.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

Parameters

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

Response

operations.InitiateOAuthResponse

Errors

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

list_sources

List sources

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.ListSourcesRequest(
    workspace_ids=[
        '74dbbb77-f80b-457c-8540-0c5d47a64428',
    ],
)

res = s.sources.list_sources(req)

if res.sources_response is not None:
    # handle response
    pass

Parameters

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

Response

operations.ListSourcesResponse

Errors

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

patch_source

Update a Source

Example Usage

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

Parameters

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

Response

operations.PatchSourceResponse

Errors

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

put_source

Update a Source and fully overwrite it

Example Usage

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

Parameters

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

Response

operations.PutSourceResponse

Errors

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