Skip to main content

Inventory Device Name Diags

RetrieveThe inventory device name diagnostics endpoints provide functionality for managing and monitoring device diagnostic information within your inventory system. These endpoints allow you to retrieve diagnostic data for specific devices and create new diagnostic informationentries, forwith inventoryoptional real-time status updates to ensure accurate device names.monitoring.

Base URL: https://control.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The inventory device name diagnostics API category is designed for comprehensive device health monitoring and diagnostic data management within your inventory infrastructure. These endpoints serve as the foundation for tracking device performance, identifying issues, and maintaining detailed diagnostic logs.

Key Capabilities:

    Retrieve diagnostic information for specific devices or all devices in your inventory Create new diagnostic entries to track device health events Optionally trigger real-time device status updates using configured helpers Support for scheduled diagnostic transactions and monitoring workflows

    Common Integration Scenarios:

      Network monitoring systems that need to track device health over time Automated diagnostic workflows that collect and store device performance data Inventory management systems requiring real-time device status verification Maintenance scheduling systems that rely on diagnostic data for proactive servicing

      The endpoints work together to provide a complete diagnostic lifecycle - from data collection and storage to retrieval and analysis. The optional status update functionality ensures that retrieved diagnostic information reflects the most current device state.


      Endpoints

      GET /inventory_device_name_diags/

      Description: Retrieves diagnostic information for inventorydevices in your inventory. This endpoint supports filtering by specific device names.IDs Optionallyand can optionally trigger real-time status updates before returning data, ensuring you receive the most current diagnostic information available.

      Use Cases:

        Monitor the health status of all devices in your inventory Retrieve diagnostic history for a specific device during troubleshooting Generate reports on device performance trends over time Validate device status before returningperforming data.maintenance operations

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_device_name_diags/?id=device-12345&update_status=true
        

        Parameters:

        Parameter Type In Required Description
        id string query No ID of the scheduled transaction or device to filter diagnostic results
        update_status boolean query No UseWhen true, uses configured helpers to update device status before returning thediagnostic information

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device_name_diags/?id=device-12345&update_status=truetrue" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 2,25,
          "next": "https://control.zequenze.com/api/v1/inventory_device_name_diags/?limit=10&offset=10",
          "previous": null,
          "results": [
            {
              "id": "diag-001",
              "device_id": "device-12345",
              "device_name": "switch-Router-Dallas-Core-01",
              "diagnostic_status"transaction_id": "txn-98765",
              "diagnostic_type": "health_check",
              "status": "healthy",
              "cpu_usage": 23.5,
              "memory_usage": 67.8,
              "disk_usage": 45.2,
              "network_status": "connected",
              "last_updated": "2023-12-01T10:2024-01-15T14:30:22Z",
              "created_at": "2024-01-15T14:30:00Z",
              "scheduled_transaction_id"diagnostic_details": {
                "uptime": "txn-456"45 days, 12:34:56",
                "network_connectivity": true,
              "hardware_status"temperature": "operational"42°C",
                "power_status": "normal",
                "error_count": 0
              }
            },
            {
              "id": "12346"diag-002",
              "device_id": "device-67890",
              "device_name": "router-02"Switch-Austin-Floor2-03",
              "diagnostic_status"transaction_id": "txn-54321",
              "diagnostic_type": "performance_check",
              "status": "warning",
              "cpu_usage": 78.9,
              "memory_usage": 85.3,
              "disk_usage": 23.1,
              "network_status": "connected",
              "last_updated": "2023-12-01T10:2024-01-15T14:25:15Z",
              "created_at": "2024-01-15T14:25:00Z",
              "scheduled_transaction_id"diagnostic_details": {
                "uptime": "txn-457"12 days, 8:15:32",
                "network_connectivity": true,
              "hardware_status"temperature": "operational"58°C",
                "power_status": "normal",
                "error_count": 3
              }
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 Success - Returns diagnostic data retrievedfor requested devices
        401 Unauthorized - invalidInvalid or missing API token
        403 Forbidden - Insufficient permissions to access diagnostic data 404 Not Found - Specified device ID does not exist 500 Internal serverServer errorError - Issue with status update helpers

        POST /inventory_device_name_diags/

        Description: Creates a new diagnostic informationentry for inventorya device names.in your inventory system. This endpoint allows you to store diagnostic information, performance metrics, and health status data that can be retrieved later for monitoring and analysis purposes.

        Use Cases:

          Log diagnostic results from automated monitoring scripts Store performance metrics collected during scheduled maintenance Create diagnostic entries from external monitoring tools Record device health status changes for audit trails

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_device_name_diags/
          

          Parameters:

          Parameter Type In Required Description
          data string body Yes DiagnosticJSON datastring forcontaining the devicediagnostic information to be stored

          ExamplecURL Request:Example:

          curl -X POST "https://control.zequenze.com/api/v1/inventory_device_name_diags/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
              "device_id": "device-55555",
              "device_name": "firewall-03"Firewall-Phoenix-DMZ-01",
              "scheduled_transaction_id"diagnostic_type": "txn-789"security_scan",
              "diagnostic_tests"status": [
              "connectivity_check"healthy",
              "hardware_status"cpu_usage": 34.7,
              "memory_usage": 52.1,
              "disk_usage": 78.9,
              "network_status": "connected",
              "configuration_validation"diagnostic_details": ]{
                "uptime": "89 days, 15:42:18",
                "priority"temperature": "high"39°C",
                "power_status": "normal",
                "error_count": 0,
                "security_threats_blocked": 1247,
                "firewall_rules_active": 342
              }
            }'
          

          Example Response:

          {
            "id": "12347"diag-003",
            "device_id": "device-55555",
            "device_name": "firewall-03"Firewall-Phoenix-DMZ-01",
            "scheduled_transaction_id"transaction_id": "txn-789"11111",
            "diagnostic_type": "security_scan",
            "status": "pending"healthy",
            "cpu_usage": 34.7,
            "memory_usage": 52.1,
            "disk_usage": 78.9,
            "network_status": "connected",
            "last_updated": "2024-01-15T15:45:30Z",
            "created_at": "2023-12-01T11:00:00Z"2024-01-15T15:45:30Z",
            "estimated_completion"diagnostic_details": {
              "uptime": "2023-12-01T11:89 days, 15:00Z"42:18",
              "temperature": "39°C",
              "power_status": "normal",
              "error_count": 0,
              "security_threats_blocked": 1247,
              "firewall_rules_active": 342
            }
          }
          

          Response Codes:

          Status Description
          201 Created - diagnosticDiagnostic requestentry successfully created
          400 Bad Request - invalidInvalid or malformed diagnostic data format
          401 Unauthorized - invalidInvalid or missing API token
          403 Forbidden - Insufficient permissions to create diagnostic entries 422 Unprocessable Entity - Valid JSON but invalid diagnostic data structure 500 Internal Server Error - Database or server error occurred

          Common Use Cases

          Use Case 1: Real-time Device Health Dashboard

          Build a monitoring dashboard that displays current device status across your entire inventory. Use the GET endpoint with update_status=true to ensure real-time accuracy, then refresh the data periodically to maintain an up-to-date view of device health.

          Use Case 2: Automated Diagnostic Collection

          Implement scheduled scripts that collect diagnostic information from devices and store it using the POST endpoint. This creates a historical record of device performance that can be analyzed for trends and used for predictive maintenance.

          Use Case 3: Troubleshooting and Issue Investigation

          When investigating device issues, use the GET endpoint with a specific device ID to retrieve the diagnostic history. This helps identify patterns, performance degradation, or recurring problems that may not be immediately apparent.

          Use Case 4: Compliance and Audit Reporting

          Generate compliance reports by retrieving diagnostic data for specific time periods or device types. The stored diagnostic information provides an audit trail of device health and performance metrics required for regulatory compliance.

          Use Case 5: Proactive Maintenance Scheduling

          Monitor diagnostic trends to identify devices that may require maintenance before they fail. Use the diagnostic data to schedule proactive maintenance based on performance metrics like CPU usage, temperature, or error counts.


          Best Practices

          • Use theStatus Updates Judiciously: The update_statusupdate_status=true parameter sparinglytriggers asreal-time itdevice mayqueries, which can increase response timetimes. byUse activelythis pollingonly deviceswhen you need the most current data, not for routine monitoring queries.

          • Filter results

            Implement usingProper Error Handling: Always check response status codes and handle errors gracefully, especially for the POST endpoint where data validation failures are common.

          Structure Diagnostic Data Consistently: When creating diagnostic entries, maintain consistent field names and data types in the iddiagnostic_details parameterobject to ensure compatibility with reporting and analysis tools.

          Optimize for Pagination: For large inventories, always implement pagination when lookingretrieving fordiagnostic specificdata. scheduledUse transactionsreasonable limit values (10-100 records) to balance performance with data completeness.

          Monitor

          Cache Frequently Accessed Data: If you're building dashboards or reports that don't require real-time data, cache diagnostic results regularlyinformation to maintainreduce networkAPI healthcalls and improve application performance.

          Batch

          Validate Input Data: Before sending diagnostic requestsdata duringvia maintenancePOST, windowsvalidate that all required fields are present and properly formatted to minimizeavoid network400/422 impacterrors.

          Include proper

          Monitor errorRate handlingLimits: forBe devicesmindful of API rate limits, especially when implementing automated diagnostic collection systems that may begenerate offlinehigh duringvolumes diagnosticof runs

          requests. Set appropriate timeouts when creating diagnostic requests for multiple devices