You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add CLI for monitoring vending jobs and events
- Implemented a new CLI tool in `monitor.py` for managing and monitoring vending jobs and events.
- Added commands for listing jobs, peeking dead-letter queue, showing job stats, and watching for new messages.
- Integrated remote mode to interact with the vending API and local mode for direct Azure Storage access.
feat: create jobs handler package
- Introduced a new handler package for jobs with routes for `/jobs/stats`, `/jobs/list`, and `/jobs/dlq`.
- Added controller logic for handling job-related operations including peeking queues and purging the dead-letter queue.
feat: implement job models and responses
- Defined Pydantic models for job requests and responses in `models.py`.
- Created structured responses for job listing, stats, and job lookup.
refactor: update workflow engine usage
- Refactored the workflow engine to remove the deprecated `run_provisioning_workflow` function.
- Updated all references in tests and other modules to use the new `WorkflowEngine` directly.
test: update tests for new workflow engine
- Modified tests to accommodate changes in the workflow engine and ensure proper functionality.
- Ensured that all tests reflect the new structure and logic of the job handling and workflow execution.
Co-authored-by: Copilot <copilot@github.com>
The `/jobs/*` endpoints provide visibility into the Azure Storage Queue used by the `queue` retry strategy. They are always registered but are most useful when `VENDING_RETRY_STRATEGY=queue`.
330
+
331
+
All `/jobs/*` endpoints connect to Azure Storage using the same credentials as the main service (`VENDING_STORAGE_CONNECTION_STRING` or `DefaultAzureCredential` + `VENDING_STORAGE_ACCOUNT_NAME`).
332
+
333
+
---
334
+
335
+
### `GET /jobs/stats`
336
+
337
+
Returns approximate message counts for both the provisioning queue and the dead-letter queue.
338
+
339
+
**Response**`200 OK`
340
+
341
+
```json
342
+
{
343
+
"provisioning": {
344
+
"queue": "vending-jobs",
345
+
"approximate_message_count": 3
346
+
},
347
+
"dead_letter": {
348
+
"queue": "vending-jobs-dlq",
349
+
"approximate_message_count": 1
350
+
}
351
+
}
352
+
```
353
+
354
+
If a queue cannot be reached, the response includes `"error": "<message>"` in place of `approximate_message_count`.
355
+
356
+
---
357
+
358
+
### `GET /jobs/list`
359
+
360
+
Peeks the top N messages in the provisioning queue without removing them.
Peeks the top N messages in the dead-letter queue. Response shape is identical to `/jobs/list`.
391
+
392
+
#### Query parameters
393
+
394
+
| Parameter | Default | Description |
395
+
|-----------|---------|-------------|
396
+
|`count`|`5`| Number of messages to peek |
397
+
398
+
---
399
+
400
+
### `DELETE /jobs/dlq`
401
+
402
+
Clears **all** messages from the dead-letter queue. This is a destructive, irreversible operation.
403
+
404
+
**Response**`200 OK`
405
+
406
+
```json
407
+
{"queue": "vending-jobs-dlq", "deleted": 3}
408
+
```
409
+
410
+
---
411
+
412
+
### `POST /jobs/enqueue`
413
+
414
+
Enqueues a provisioning job directly to the provisioning queue, bypassing the Event Grid webhook. Useful for manual re-queuing or testing without a real Event Grid event.
<p>Watch the full end-to-end provisioning workflow run automatically across five real-world scenarios. The inbound Event Grid webhook, all seven provisioning steps, and the HTTP response are shown in real time.</p>
345
+
<h1>Subscription Vending — Live Demo</h1>
346
+
<p>Watch the full end-to-end provisioning workflow run automatically across six real-world scenarios. The inbound Event Grid webhook, all seven provisioning steps, and the HTTP response are shown in real time.</p>
347
347
<divclass="hero-controls">
348
348
<divclass="status-badge">
349
349
<spanclass="idle-dot" id="status-dot"></span>
@@ -371,7 +371,7 @@ <h1>Subscription Vending � Live Demo</h1>
0 commit comments