Skip to main content

Inventory Device Serial Diags

RetrieveThe Inventory Device Serial Diagnostics API provides access to diagnostic information and managetesting capabilities for devices in your inventory. These endpoints enable you to retrieve diagnostic data from devices and trigger new diagnostic tests to monitor device serialhealth diagnosticsand data 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:

    Retrieve Diagnostic Information: Access current and historical diagnostic data for devices, including connection status, performance metrics, and error logs Trigger Diagnostic Tests: Initiate new diagnostic procedures to test device connectivity, functionality, and performance Monitor Device Health: Get real-time updates on device status and identify potential issues before they impact operations

    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:

      Monitor device health across your entire inventory Retrieve diagnostic history for specific devices during troubleshooting Get real-time device status updates for critical infrastructure monitoring Generate reports on device performance and connectivity

      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 UseWhen true, runs configured diagnostic helpers to update device status before returning theresults. informationUseful for real-time monitoring but may increase response time

      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
      400404 InvalidNot parametersFound - No diagnostic data found for the specified ID
      500 Server Error - Diagnostic service temporarily unavailable

      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:

        Schedule regular diagnostic checks for critical network equipment Trigger immediate diagnostic tests when issues are reported Run batch diagnostics across multiple devices after maintenance Initiate custom diagnostic procedures for specific device types

        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 datarequest information including device IDs, diagnostic types, and test parameters

        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 requestdata dataformat or missing required parameters
        401 Unauthorized - Invalid or missing authentication token
        422 ValidationUnprocessable errorEntity - Valid format but logical errors in request data
        500 Server Error - Unable to schedule diagnostic test

        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 update_status=truePagination: When retrieving diagnostics for large inventories, implement proper pagination to avoid timeouts and improve performance
        Monitor Rate Limits: Space out diagnostic requests to avoid overwhelming devices or the API service Handle Async Operations: Diagnostic tests may take time to complete; implement proper polling mechanisms when youchecking needresults real-timeafter devicescheduling status information, but be aware this may increase response timetests Filter byCache specificResults: transactionCache IDsdiagnostic data when trackingappropriate scheduledto diagnosticreduce operationsAPI calls, especially for devices that don't change frequently Monitor error_countError valuesHandling: to identify devices requiring attention Implement properrobust error handling for timeoutnetwork scenariostimeouts, device unavailability, and service interruptions Selective Updates: Use the update_status parameter judiciously as it increases response time; only use when update_statusreal-time data is enabledessential Consider paginationBatch Operations: When possible, include multiple devices in a single POST request rather than making individual calls for largeeach device inventories by adding limit and offset parameters Use appropriate diagnostic_type values: "connectivity", "hardware", "performance", or "security"