chihsuan commented on code in PR #10240:
URL: https://github.com/apache/ozone/pull/10240#discussion_r3274159981


##########
hadoop-hdds/docs/content/interface/ReconApi.md:
##########
@@ -231,26 +239,99 @@ Returns the UnhealthyContainerMetadata objects for all 
the unhealthycontainers.
 ```
 
 ### GET /api/v1/containers/unhealthy/:state
- 
+
 **Parameters**
 
-* batchNum (optional)
-     
-   The batch number (like "page number") of results to return.
-   Passing 1, will return records 1 to limit. 2 will return
-   limit + 1 to 2 * limit, etc.
- 
 * limit (optional)
 
-   Only returns the limited number of results. The default limit is 1000.  
+   Only returns the limited number of results. The default limit is 1000.
+
+* maxContainerId (optional)
+
+   Upper bound for container IDs (exclusive). When specified, returns 
containers with IDs less
+   than this value in descending order. Use it for backward pagination.
+
+* minContainerId (optional)
+
+   Lower bound for container IDs (exclusive). When `maxContainerId` is not 
specified, returns
+   containers with IDs greater than this value in ascending order. Use it for 
forward pagination.
 
 **Returns**
 
 Returns the UnhealthyContainerMetadata objects for the containers in the given 
state.
-Possible unhealthy container states are `MISSING`, 
`MIS_REPLICATED`,`UNDER_REPLICATED`, `OVER_REPLICATED`.
+Possible unhealthy container states are `MISSING`, `MIS_REPLICATED`, 
`UNDER_REPLICATED`, `OVER_REPLICATED`.
 The response structure is same as `/containers/unhealthy`.
 
 
+### GET /api/v1/containers/unhealthy/export
+
+**Returns**
+
+Lists every unhealthy-container export job currently tracked by Recon, in any 
status.
+Items are `ExportJob` objects (see schema below).
+
+```json
+[
+  {
+    "jobId": "4f7a8b9c-1234-5678-9abc-def012345678",
+    "state": "MISSING",
+    "status": "RUNNING",
+    "submittedAt": 1718640123456,
+    "startedAt": 1718640124000,
+    "completedAt": 0,
+    "totalRecords": 250,
+    "estimatedTotal": 1000,
+    "fileName": "",
+    "errorMessage": null,
+    "progressPercent": 25,
+    "queuePosition": 0,
+    "downloadCount": 0,
+    "downloadsRemaining": 3
+  }
+]
+```
+
+### POST /api/v1/containers/unhealthy/export
+
+**Parameters**
+
+* state (required)
+
+    One of `MISSING`, `MIS_REPLICATED`, `UNDER_REPLICATED`, `OVER_REPLICATED`.
+
+**Returns**
+
+Submits a new CSV export job and returns the `ExportJob` with the assigned 
`jobId`.
+The job initially has `status: QUEUED`.
+
+* `400 Bad Request`: `state` is missing or not a valid unhealthy state.
+* `429 Too Many Requests`: the export queue is full; retry later. Body: `{ 
"error": "Too Many Requests", "message": "<reason>" }`.
+
+### GET /api/v1/containers/unhealthy/export/:jobId
+
+**Returns**
+
+Returns the current `ExportJob` for the given `jobId`. `404 Not Found` if no 
job has that id.
+
+### GET /api/v1/containers/unhealthy/export/:jobId/download
+
+**Returns**
+
+Streams the TAR archive produced by the export job. Response `Content-Type` is 
`application/x-tar` with
+a `Content-Disposition: attachment` header carrying the export filename.
+
+* `404 Not Found`: `jobId` is unknown or the on-disk file was removed.
+* `409 Conflict`: the job has not reached `COMPLETED` status yet.
+* `429 Too Many Requests`: the per-job download limit has been reached. Body 
matches `RateLimitedError`.

Review Comment:
   Split into two schemas. `RateLimitedError` keeps the "Too Many Requests" 
example for POST `/unhealthy/export`. New `DownloadLimitReachedError` carries 
the "Download limit reached" example download
   
   
https://github.com/apache/ozone/pull/10240/changes/5acb1ea58bf81bff89467653443423dec1340fa7



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to