version: 1
name: templates_users_posts
vars:
api_base: https://api.example.com
api_token: ${env:API_TOKEN}
pipeline:
sources:
users_api:
type: rest
config:
base_url: ${vars.api_base}
method: GET
auth: { type: bearer, config: { token: "${vars.api_token}" } }
records_path: $.data[*]
pagination:
type: PageNumber
param_name: page
start_page: 1
page_size: 100
max_pages: 10
timeout: 30
max_retries: 3
retry_backoff: 1
tolerated_http_errors: []
replication_method: { type: FullTable }
primary_keys: [id]
partitions: []
schema_sample_size: 100
posts_api:
type: rest
config:
base_url: ${vars.api_base}
method: GET
auth: { type: bearer, config: { token: "${vars.api_token}" } }
records_path: $.data[*]
pagination:
type: PageNumber
param_name: page
start_page: 1
page_size: 100
max_pages: 20
timeout: 30
max_retries: 3
retry_backoff: 1
tolerated_http_errors: []
replication_method: { type: FullTable }
primary_keys: [id]
partitions: []
schema_sample_size: 100
sinks:
archive:
type: jsonl
config: { append: false, pretty: false }
matrix:
- id: users
source:
ref: users_api
config: { path: /v1/users, name: users }
sink:
ref: archive
config: { path: users.jsonl }
- id: posts
parent: users
parent_key: id
source:
ref: posts_api
config: { path: "/v1/users/${users.id}/posts", name: posts }
sink:
ref: archive
config: { path: "posts-${users.id}.jsonl" }