Inventory Device Serial Diags
RetrieveThe Inventory Device Serial Diagnostics API provides access to diagnostic information andmanagetesting capabilities for devices in your inventory. These endpoints enable you to retrieve diagnostic data from devices and trigger new diagnostic tests to monitor deviceserialhealthdiagnosticsanddata for inventory items.performance.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Inventory Device Serial Diagnostics API is designed for managing and monitoring the diagnostic status of network devices in your inventory. This API category allows you to:
These endpoints work together to provide comprehensive device monitoring capabilities. The GET endpoint retrieves existing diagnostic information, while the POST endpoint allows you to schedule new diagnostic tests. The update_status parameter enables real-time status updates by running configured diagnostic helpers before returning data.
Common scenarios include automated health monitoring, troubleshooting connectivity issues, and maintaining device inventory accuracy through regular diagnostic checks.
Endpoints
GET /inventory_device_serial_diags/
RetrieveDescription: device serialRetrieves diagnostic information withfor optionalinventory devices. This endpoint returns diagnostic data including device status, connectivity tests, performance metrics, and error logs. You can filter results by specific device IDs and optionally trigger real-time status updates.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_serial_diags/?id=12345&update_status=true
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | string | query | No | ID of the specific device or scheduled transaction to retrieve diagnostics for |
| update_status | boolean | query | No |
ExamplecURL Request:Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_serial_diags/?id=12345&update_status=truetrue" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": "12345",
"device_serial"device_id": "SN001234567"DEV-001",
"serial_number": "SN123456789",
"device_name": "Core Switch 01",
"diagnostic_type": "connectivity"connectivity_test",
"status": "healthy"passed",
"last_check"last_updated": "2024-01-15T10:15T14:30:00Z",
"response_time"response_time_ms": 45,
"error_count": 0,
"created_at"details": {
"ping_test": "2024-01-15T09:00:00Z"success",
"updated_at"snmp_connectivity": "2024-01-15T10:30:00Z"success",
"uptime_seconds": 2547600,
"cpu_usage_percent": 12.5,
"memory_usage_percent": 34.2
},
"scheduled_transaction_id": "ST-789"
},
{
"id": "12346",
"device_serial"device_id": "SN001234568"DEV-002",
"serial_number": "SN987654321",
"device_name": "Access Point 02",
"diagnostic_type": "hardware"performance_test",
"status": "warning",
"last_check"last_updated": "2024-01-15T10:15T14:25:00Z",
"response_time"response_time_ms": null,120,
"error_count": 2,
"created_at"details": {
"ping_test": "2024-01-15T08:45:00Z"success",
"updated_at"snmp_connectivity": "2024-01-15T10:25:00Z"timeout",
"signal_strength_dbm": -65,
"client_count": 23,
"bandwidth_utilization_percent": 78
},
"scheduled_transaction_id": "ST-790"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns diagnostic data for the specified devices |
| 401 | Unauthorized - Invalid or missing authentication token |
POST /inventory_device_serial_diags/
CreateDescription: Creates a new devicediagnostic serialtest request for one or more devices in your inventory. This endpoint schedules diagnostic entry.procedures such as connectivity tests, performance monitoring, or custom diagnostic scripts. The diagnostic data provided should specify the devices to test and the type of diagnostics to perform.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_serial_diags/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| data | string | body | Yes | JSON string containing diagnostic |
ExamplecURL Request:Example:
curl -X POST "https://control.zequenze.com/api/v1/inventory_device_serial_diags/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" \
-d '{
"devices": [
{
"device_serial"device_id": "SN001234569"DEV-003",
"serial_number": "SN555666777"
}
],
"diagnostic_type": "connectivity"full_system_check",
"scheduled_transaction_id"priority": "txn_789"high",
"parameters"schedule_immediately": true,
"test_parameters": {
"timeout"include_performance": 30,true,
"retry_count"include_connectivity": 3true,
"include_security_scan": false,
"timeout_seconds": 300
}
}'
Example Response:
{
"id"transaction_id": "12347",
"device_serial": "SN001234569",
"diagnostic_type": "connectivity"ST-791",
"status": "pending"scheduled",
"scheduled_transaction_id"message": "txn_789"Diagnostic test scheduled successfully",
"parameters"devices_count": 1,
"estimated_completion": "2024-01-15T15:15:00Z",
"diagnostic_details": {
"timeout"diagnostic_type": 30,"full_system_check",
"retry_count"priority": 3
}"high",
"created_at": "2024-01-15T11:15T15:00:00Z",
"updated_at"scheduled_devices": [
{
"device_id": "2024-01-15T11:00:00Z"DEV-003",
"serial_number": "SN555666777",
"device_name": "Router 03",
"test_status": "queued"
}
]
}
}
Response Codes:
| Status | Description |
|---|---|
| 201 | Created - Diagnostic test successfully scheduled |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing authentication token |
| 422 |
Common Use Cases
Use Case 1: Real-time Device Health Monitoring
Monitor critical network devices by regularly calling the GET endpoint with update_status=true to get current diagnostic information and identify devices that may need attention.
Use Case 2: Scheduled Maintenance Diagnostics
Before and after scheduled maintenance windows, use the POST endpoint to trigger comprehensive diagnostic tests, then monitor results through the GET endpoint to verify all systems are functioning properly.
Use Case 3: Troubleshooting Workflow
When users report connectivity issues, use the POST endpoint to immediately schedule diagnostic tests for affected devices, then poll the GET endpoint to retrieve detailed diagnostic results for troubleshooting.
Use Case 4: Inventory Health Reporting
Generate regular reports by retrieving diagnostic data for all devices using the GET endpoint, then analyzing the results to identify trends, recurring issues, or devices requiring replacement.
Use Case 5: Automated Alert System
Implement automated monitoring by combining both endpoints: use POST to schedule regular diagnostic tests, then GET to retrieve results and trigger alerts when devices fail diagnostic checks.
Best Practices
-
Use
Pagination: When retrieving diagnostics for large inventories, implement proper pagination to avoid timeouts and improve performanceupdate_status=true
update_status parameter judiciously as it increases response time; only use when