Skip to content

prefect_stitch.tasks

Collection of tasks to interact with Stitch APIs. In order to use Stitch APIs, you'll need to have a Stitch Unlimited Plan or higher. For further information, checkout Stitch pricing.

start_replication_job

This task starts a new Stitch replication job using the provided source.

Parameters:

Name Type Description Default
access_token

API access token that will be used to authenticate API calls.

required
source_id int

integer identifier of the source that will be used in the replication job.

required

Returns:

Type Description
Dict

Replication job API JSON response.

Source code in prefect_stitch/tasks.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@task
def start_replication_job(credentials: StitchCredentials, source_id: int) -> Dict:
    """
    This task starts a new Stitch replication job using the provided source.

    Args:
        access_token: API access token that will be used to authenticate API calls.
        source_id: integer identifier of the source that will
            be used in the replication job.

    Returns:
        Replication job API JSON response.
    """
    stitch_client = StitchClient(credentials=credentials)
    return stitch_client.start_replication_job(source_id=source_id)