API-vendor/container/datax/job/restful_to_mysql_orders.json

106 lines
2.9 KiB
JSON

{
"job": {
"content": [
{
"reader": {
"name": "restfulreader",
"parameter": {
"url": "https://your-woocommerce-site.com/wp-json/wc/v3/orders",
"method": "GET",
"headers": {
"Accept": "application/json"
},
"requestParams": {
"consumer_key": "your_consumer_key",
"consumer_secret": "your_consumer_secret",
"per_page": 100
},
"pagination": {
"type": "page",
"pageSize": 100,
"pageNum": 1,
"totalCount": 0,
"dynamicTotalCount": true,
"totalCountPath": "$['X-WP-Total']",
"pageUrlTemplate": "${url}?page=${pageNum}&per_page=${pageSize}&consumer_key=${requestParams.consumer_key}&consumer_secret=${requestParams.consumer_secret}"
},
"dataPath": "$.*",
"column": [
{
"name": "id",
"type": "long"
},
{
"name": "status",
"type": "string"
},
{
"name": "total",
"type": "string"
},
{
"name": "currency",
"type": "string"
},
{
"name": "created_at",
"type": "string"
},
{
"name": "customer_id",
"type": "long"
},
{
"name": "billing.first_name",
"type": "string",
"alias": "billing_first_name"
},
{
"name": "billing.last_name",
"type": "string",
"alias": "billing_last_name"
},
{
"name": "billing.email",
"type": "string",
"alias": "billing_email"
}
]
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"writeMode": "replace",
"username": "root",
"password": "123345678",
"column": [
"id",
"status",
"total",
"currency",
"created_at",
"customer_id",
"billing_first_name",
"billing_last_name",
"billing_email"
],
"connection": [
{
"jdbcUrl": "jdbc:mysql://host.docker.internal:23306/inventory_v2?useUnicode=true&characterEncoding=utf-8",
"table": [
"orders"
]
}
]
}
}
}
],
"setting": {
"speed": {
"channel": 1
}
}
}
}