docs(scanner): update Bruno requests for new scanner endpoints
- Update Scan Ebooks.bru to reflect async background scanning - Add Get Scan Status.bru for checking job progress - Add Start Watch Mode.bru for instant file monitoring - Add Stop Watch Mode.bru for stopping library monitoring - Add Get Watch Mode Status.bru for checking watched libraries - Document all new endpoints with examples and status codes
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
meta {
|
||||
name: Get Scan Status
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/scanner/status/{{job_id}}
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Scan Status
|
||||
|
||||
Retrieves the status and progress of an asynchronous scan job.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/scanner/status/:jobId
|
||||
|
||||
**Authentication:** Required (Bearer token, Admin only)
|
||||
|
||||
**URL Parameters:**
|
||||
- `jobId` (string, required): The job ID returned from the scan endpoint
|
||||
- Example: `550e8400-e29b-41d4-a716-446655440000`
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"job_id": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"status": "completed",
|
||||
"error": "",
|
||||
"result": {
|
||||
"message": "scan completed",
|
||||
"library_id": "550e8400-e29b-41d4-a716-446655440000"
|
||||
},
|
||||
"progress": 1.0
|
||||
}
|
||||
```
|
||||
|
||||
**Properties:**
|
||||
- `job_id` (string): Job identifier
|
||||
- `status` (string): Current status
|
||||
- `pending`: Job is queued
|
||||
- `running`: Job is currently processing
|
||||
- `completed`: Job finished successfully
|
||||
- `failed`: Job failed with error
|
||||
- `cancelled`: Job was cancelled
|
||||
- `error` (string): Error message if status is "failed"
|
||||
- `result` (object): Scan results when completed
|
||||
- `message` (string): Completion message
|
||||
- `library_id` (string): Library that was scanned
|
||||
- `progress` (number): Progress indicator (0.0 to 1.0)
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Job status retrieved successfully
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Job not found
|
||||
|
||||
**Example Workflow:**
|
||||
1. POST /api/scanner/scan with folder_paths
|
||||
2. Receive job_id in response
|
||||
3. Poll GET /api/scanner/status/{job_id} every few seconds
|
||||
4. When status is "completed" or "failed", stop polling
|
||||
}
|
||||
Reference in New Issue
Block a user