Skip to main content

Inventory Device Name Diags

The 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 entries, with optional real-time status updates to ensure accurate device 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 devices in your inventory. This endpoint supports filtering by specific device IDs and 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 performing 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 When true, uses configured helpers to update device status before returning diagnostic information

cURL Example:

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

Example Response:

{
  "count": 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": "Router-Dallas-Core-01",
      "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": "2024-01-15T14:30:22Z",
      "created_at": "2024-01-15T14:30:00Z",
      "diagnostic_details": {
        "uptime": "45 days, 12:34:56",
        "temperature": "42°C",
        "power_status": "normal",
        "error_count": 0
      }
    },
    {
      "id": "diag-002",
      "device_id": "device-67890",
      "device_name": "Switch-Austin-Floor2-03",
      "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": "2024-01-15T14:25:15Z",
      "created_at": "2024-01-15T14:25:00Z",
      "diagnostic_details": {
        "uptime": "12 days, 8:15:32",
        "temperature": "58°C",
        "power_status": "normal",
        "error_count": 3
      }
    }
  ]
}

Response Codes:

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

POST /inventory_device_name_diags/

Description: Creates a new diagnostic entry for a device 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 JSON string containing the diagnostic information to be stored

cURL Example:

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

Example Response:

{
  "id": "diag-003",
  "device_id": "device-55555",
  "device_name": "Firewall-Phoenix-DMZ-01",
  "transaction_id": "txn-11111",
  "diagnostic_type": "security_scan",
  "status": "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": "2024-01-15T15:45:30Z",
  "diagnostic_details": {
    "uptime": "89 days, 15: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 - Diagnostic entry successfully created
400 Bad Request - Invalid or malformed diagnostic data
401 Unauthorized - Invalid 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 Status Updates Judiciously: The update_status=true parameter triggers real-time device queries, which can increase response times. Use this only when you need the most current data, not for routine monitoring queries.

  • Implement Proper 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 diagnostic_details object to ensure compatibility with reporting and analysis tools.

  • Optimize for Pagination: For large inventories, always implement pagination when retrieving diagnostic data. Use reasonable limit values (10-100 records) to balance performance with data completeness.

  • Cache Frequently Accessed Data: If you're building dashboards or reports that don't require real-time data, cache diagnostic information to reduce API calls and improve application performance.

  • Validate Input Data: Before sending diagnostic data via POST, validate that all required fields are present and properly formatted to avoid 400/422 errors.

  • Monitor Rate Limits: Be mindful of API rate limits, especially when implementing automated diagnostic collection systems that may generate high volumes of requests.