Skip to main content

Inventory Device Log

The Inventory Device Log API provides access to device operation logs and settings history within the Zequenze Control platform. These endpoints allow you to retrieve detailed logs of device actions, parameter changes, commands, events, and alerts with comprehensive filtering capabilities. Use these endpoints to monitor device operations, troubleshoot issues, and track configuration changes over time.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Device Log API provides comprehensive access to device operational logs and settings history. This API is essential for monitoring device behavior, tracking configuration changes, and troubleshooting device issues in managed network environments.

Key Features:

  • Action Tracking: Monitor all device actions including set/get operations, commands, events, and alerts
  • Parameter Management: Track parameter value changes and configuration updates
  • Status Monitoring: View operational status with detailed error codes and messages
  • Time-based Filtering: Query logs within specific date/time ranges using ISO format timestamps
  • Device-specific Logs: Filter logs by specific devices or parameter names
  • Operational Status: Track pending operations and applied configurations

Common Scenarios:

  • Audit trails for device configuration changes
  • Troubleshooting device connectivity and parameter issues
  • Monitoring alert conditions and event patterns
  • Tracking command execution and completion status
  • Analyzing device behavior over time periods

The API uses cursor-based pagination for efficient data retrieval and supports extensive filtering options to help you find specific log entries quickly.


Endpoints

GET /inventory_device_log/

Description: Retrieves a paginated list of device logs with comprehensive filtering options. This endpoint is your primary tool for accessing device operational history, including parameter changes, commands, events, and alerts. Use the various filter parameters to narrow down results to specific devices, time periods, actions, or operational states.

Use Cases:

  • Monitor recent device activity and configuration changes
  • Generate audit reports for specific time periods
  • Track pending operations across multiple devices
  • Analyze alert patterns and device events
  • Troubleshoot parameter configuration issues

Full URL Example:

https://control.zequenze.com/api/v1/inventory_device_log/?datetime__gte=2024-01-01&action=sv&is_pending=false&limit=50

Parameters:

Parameter Type In Required Description
datetime__gte string query No Filter logs from this date/time onwards. Supports ISO formats: 2024-01-01, 2024-01-01 10:30:00, 2024-01-01T10:30:00+00:00
datetime__lte string query No Filter logs up to this date/time. Supports ISO formats: 2024-01-01, 2024-01-01 23:59:59, 2024-01-01T23:59:59+00:00
parent__id string query No Filter logs by specific device ID. Use device identifier to get logs for a particular device
action string query No Filter by action type: sv (Set), uv (Unset), gv (Get), sa (Set attribute), cr (Create), de (Delete), cm (Command), ev (Event), er (Error), ar (Alert raised), ac (Alert cleared)
is_pending boolean query No Filter by pending status. true for operations awaiting execution, false for completed operations
is_applied boolean query No Filter by applied status. true for successfully applied operations, false for operations not yet applied
cursor string query No Pagination cursor for retrieving next/previous page results
limit integer query No Number of results per page (default varies, typically 20-100)
variable_name string query No Filter by specific parameter or variable name as expected by device agent

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_device_log/?datetime__gte=2024-01-01&action=sv&limit=20" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "next": "https://control.zequenze.com/api/v1/inventory_device_log/?cursor=eyJjcmVhdGVkIjoiMjAyNC0wMS0xNVQxMDozMDowMFoifQ%3D%3D",
  "previous": null,
  "results": [
    {
      "id": 1247,
      "created": "2024-01-15T10:30:00Z",
      "last_change": "2024-01-15T10:30:15Z",
      "user": 42,
      "parent": 156,
      "type": "string",
      "action": "sv",
      "command": "Reconf",
      "name": "WiFi Configuration Update",
      "variable_name": "Device.WiFi.SSID.1.SSID",
      "value": "Corporate_Network_5G",
      "is_pending": false,
      "is_applied": true,
      "status": 200,
      "message": "Parameter updated successfully"
    },
    {
      "id": 1246,
      "created": "2024-01-15T09:15:00Z",
      "last_change": "2024-01-15T09:15:30Z",
      "user": 38,
      "parent": 156,
      "type": "boolean",
      "action": "sv",
      "command": null,
      "name": "Enable Auto-Update",
      "variable_name": "Device.ManagementServer.AutoUpdate.Enabled",
      "value": "true",
      "is_pending": false,
      "is_applied": true,
      "status": 200,
      "message": "Auto-update enabled successfully"
    },
    {
      "id": 1245,
      "created": "2024-01-15T08:45:00Z",
      "last_change": "2024-01-15T08:45:00Z",
      "user": null,
      "parent": 203,
      "type": null,
      "action": "ev",
      "command": "Boot",
      "name": "Device Boot Event",
      "variable_name": null,
      "value": null,
      "is_pending": false,
      "is_applied": true,
      "status": 200,
      "message": "Device completed boot sequence"
    }
  ]
}

Response Codes:

Status Description
200 Success - Returns paginated device logs with filtering applied
400 Bad Request - Invalid filter parameters or date format
401 Unauthorized - Invalid or missing Bearer token
403 Forbidden - Insufficient permissions to access device logs

GET /inventory_device_log/{id}/

Description: Retrieves detailed information for a specific device log entry by its unique identifier. This endpoint provides complete details about a single device operation, including parameter changes, command execution results, and operational status. Use this when you need comprehensive information about a specific log entry identified from the list endpoint.

Use Cases:

  • Get complete details about a specific device operation
  • Investigate the full context of a failed configuration change
  • Retrieve detailed error messages and status information
  • Audit specific parameter changes with full metadata

Full URL Example:

https://control.zequenze.com/api/v1/inventory_device_log/1247/

Parameters:

Parameter Type In Required Description
id integer path Yes Unique identifier of the device log entry to retrieve
datetime__gte string query No Additional filter for datetime (typically not needed for single record retrieval)
datetime__lte string query No Additional filter for datetime (typically not needed for single record retrieval)
parent__id string query No Additional filter by device ID (typically not needed for single record retrieval)
variable_name string query No Additional filter by variable name (typically not needed for single record retrieval)
action string query No Additional filter by action type (typically not needed for single record retrieval)
is_pending boolean query No Additional filter by pending status (typically not needed for single record retrieval)
is_applied boolean query No Additional filter by applied status (typically not needed for single record retrieval)

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_device_log/1247/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "id": 1247,
  "created": "2024-01-15T10:30:00Z",
  "last_change": "2024-01-15T10:30:15Z",
  "user": 42,
  "parent": 156,
  "type": "string",
  "action": "sv",
  "command": "Reconf",
  "name": "WiFi Configuration Update",
  "variable_name": "Device.WiFi.SSID.1.SSID",
  "value": "Corporate_Network_5G",
  "is_pending": false,
  "is_applied": true,
  "status": 200,
  "message": "Parameter updated successfully"
}

Response Codes:

Status Description
200 Success - Returns detailed information for the specified log entry
401 Unauthorized - Invalid or missing Bearer token
403 Forbidden - Insufficient permissions to access this log entry
404 Not Found - Log entry with specified ID does not exist

Common Use Cases

Use Case 1: Monitor Recent Device Configuration Changes

Track all parameter changes made to devices in the last 24 hours to ensure configuration compliance and detect unauthorized modifications.

# Get all parameter set operations from yesterday
https://control.zequenze.com/api/v1/inventory_device_log/?datetime__gte=2024-01-14&action=sv&is_applied=true

Use Case 2: Troubleshoot Failed Device Operations

Identify and analyze failed operations by filtering for error statuses and pending operations that haven't completed successfully.

# Find all failed operations with error status
https://control.zequenze.com/api/v1/inventory_device_log/?status=500&is_applied=false

Use Case 3: Audit Device Alert Activity

Monitor alert patterns by tracking alert raised and cleared events across devices to identify recurring issues or maintenance needs.

# Get all alert-related events from the past week
https://control.zequenze.com/api/v1/inventory_device_log/?datetime__gte=2024-01-08&action=ar,ac

Use Case 4: Track Specific Parameter Changes

Monitor changes to critical device parameters like WiFi settings, security configurations, or network parameters across your device inventory.

# Monitor WiFi SSID changes across all devices
https://control.zequenze.com/api/v1/inventory_device_log/?variable_name=Device.WiFi.SSID.1.SSID&action=sv

Use Case 5: Generate Device Activity Reports

Create comprehensive activity reports for specific devices by combining device filtering with time-based queries for audit and compliance purposes.

# Get all activity for device ID 156 in January 2024
https://control.zequenze.com/api/v1/inventory_device_log/?parent__id=156&datetime__gte=2024-01-01&datetime__lte=2024-01-31

Response Field Reference

Action Types

  • sv - Set: Parameter value assignment operations
  • uv - Unset: Parameter value removal operations
  • gv - Get: Parameter value retrieval operations
  • sa - Set attribute: Parameter attribute modifications
  • cr - Create: Object or instance creation
  • de - Delete: Object or instance deletion
  • cm - Command: Device command execution
  • ev - Event: System or device events
  • er - Error: Error conditions and failures
  • ar - Alert raised: Alert condition triggered
  • ac - Alert cleared: Alert condition resolved

Status Codes

  • 0 - Pending: Operation queued for execution
  • 100 - Sent: Operation transmitted to device
  • 200 - Ok: Operation completed successfully
  • 400 - Invalid parameter: Parameter name or format error
  • 401 - Authentication error: Device authentication failed
  • 403 - Forbidden: Operation not permitted
  • 404 - Invalid request: Malformed request or unknown operation
  • 406 - Invalid value: Parameter value validation failed
  • 500 - Error: General operational error
  • 504 - Timeout: Operation exceeded time limit

Parameter Types

Common parameter types you'll encounter in device logs include string, integer, boolean, datetime, select, and specialized types like password and deviceDash for dashboard configurations.


Best Practices

  • Use Date Filtering: Always apply datetime__gte and datetime__lte filters to limit results to relevant time periods and improve query performance
  • Monitor Pending Operations: Regularly check for operations with is_pending=true to identify stuck or delayed device communications
  • Implement Error Handling: Check both HTTP status codes and the status field in log entries to properly handle operational failures
  • Leverage Pagination: Use the cursor parameter for efficient pagination through large log datasets rather than high limit values
  • Filter by Device: Use parent__id filtering when troubleshooting specific device issues to reduce noise from other devices
  • Track Critical Parameters: Monitor sensitive parameters like security settings and network configurations using variable_name filtering
  • Correlate Actions: Combine action filtering with status codes to identify patterns in successful vs. failed operations