Update rule + flow hdfs new
This commit is contained in:
26
payload.md
26
payload.md
@@ -9,6 +9,7 @@ Content-Type: multipart/form-data
|
||||
file=@input.pdf
|
||||
request_id=550e8400-e29b-41d4-a716-446655440000 # optional
|
||||
callback_url=http://airflow-webserver:8080/... # optional
|
||||
dag_run_id=callback_test_001 # optional; ID cho callback
|
||||
batch_id=... # optional
|
||||
```
|
||||
|
||||
@@ -25,6 +26,7 @@ Content-Type: application/json
|
||||
"request_id": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"file_path": "/data/bronze/incoming/qudtw216_signed_7829c.pdf",
|
||||
"file_type": "application/pdf",
|
||||
"dag_run_id": "callback_test_001",
|
||||
"callback_url": "http://airflow-webserver:8080/api/v1/dags/bronze_ingest_trigger/dagRuns/{run_id}/taskInstances/trigger_idp/callback"
|
||||
}
|
||||
```
|
||||
@@ -36,6 +38,7 @@ Content-Type: application/json
|
||||
| `file_path` | ✓ | Path tuyệt đối trên HDFS |
|
||||
| `file_type` | optional | mime pdf/audio/json... |
|
||||
| `callback_url` | optional | Callback response |
|
||||
| `dag_run_id` | optional | ID gửi trong callback; nếu bỏ trống dùng `job_id` |
|
||||
|
||||
---
|
||||
|
||||
@@ -58,14 +61,25 @@ POST {callback_url}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"request_id": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"job_id": "job-98765",
|
||||
"status": "done",
|
||||
"output": { ... },
|
||||
"dag_run_id": "callback_test_001",
|
||||
"conf": {
|
||||
"request_id": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"job_id": "job-98765",
|
||||
"status": "done",
|
||||
"output": {
|
||||
"extraction": {
|
||||
"pages": [{ "page_no": 1, "media_type": "image/png", "data_base64": "..." }]
|
||||
},
|
||||
"canonical": { "schema": "dla-document-bundle", "pages": [] }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`output` là `dla-document-bundle`, cùng schema với `GET /jobs/{job_id}/result`.
|
||||
`output.extraction.pages` chứa ảnh PNG 200 DPI từng trang, mã hóa Base64.
|
||||
`output.canonical` là toàn bộ `dla-document-bundle` từ `GET /jobs/{job_id}/result`.
|
||||
Callback thất bại trước khi có kết quả có `status: "failed"` và cả hai trường
|
||||
`extraction`, `canonical` là `null`.
|
||||
|
||||
---
|
||||
|
||||
@@ -77,4 +91,4 @@ Content-Type: application/json
|
||||
| `FILE_READ_ERROR` | Lỗi network/permission khi đọc |
|
||||
| `FILE_STILL_WRITING` | File chưa ghi xong |
|
||||
| `PARSE_ERROR` | File đọc được nhưng lỗi khi xử lý nội dung |
|
||||
| `TIMEOUT` | Xử lý quá thời gian cho phép |
|
||||
| `TIMEOUT` | Xử lý quá thời gian cho phép |
|
||||
|
||||
Reference in New Issue
Block a user