Skip to main content

Inventory Device Log

The Inventory Device Log endpoints provide access to device operation logs, settings changes, and audit trails for network devices. These endpoints allow you to track configuration changes, monitor device operations, and maintain compliance through comprehensive logging and filtering capabilities.

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 category provides comprehensive access to device operation logs and settings change tracking within your network infrastructure. These endpoints are essential for network administrators who need to monitor device configurations, track changes over time, and maintain audit trails for compliance purposes.

Key Features:

  • Audit Trail Management - Track all configuration changes and operations performed on network devices
  • Advanced Filtering - Filter logs by device, timestamp, action type, and application status
  • Pending Operations Monitoring - Monitor operations that are queued but not yet applied to devices
  • Variable-Level Tracking - Track changes at the individual configuration variable level

Common Integration Scenarios:

  • Network monitoring dashboards displaying recent device changes
  • Compliance reporting systems requiring detailed audit trails
  • Automated alerting systems for failed configuration deployments
  • Troubleshooting tools that correlate device issues with recent changes

The API uses cursor-based pagination for efficient handling of large log datasets and supports ISO 8601 datetime filtering for precise time-based queries.


Endpoints

GET /inventory_device_log/

Description: Retrieves a paginated list of device operation logs and configuration changes. This endpoint is the primary method for accessing historical device activity, monitoring pending operations, and generating audit reports. Use this endpoint to track what changes were made, when they occurred, and their current application status.

Use Cases:

  • Generate compliance reports showing all device changes within a specific timeframe
  • Monitor pending configuration changes across your device inventory
  • Create dashboards displaying recent device activity and operation status
  • Troubleshoot configuration issues by reviewing recent changes to specific devices

Full URL Example:

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

Parameters:

Parameter Type In Required Description
datetime__gte string query No Filter logs from this date/time onward. Supports ISO format: 2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:00
datetime__lte string query No Filter logs up to this date/time. Supports ISO format: 2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:00
parent__id string query No Filter logs by specific device ID to show only operations for that device
action string query No Filter by operation type (e.g., 'create', 'update', 'delete', 'deploy')
is_pending boolean query No Filter by pending status - true for queued operations, false for completed
is_applied boolean query No Filter by application status - true for successfully applied operations
variable_name string query No Filter logs for changes to specific configuration variables
cursor string query No Pagination cursor for retrieving the next page of results
limit integer query No Number of results per page (default: 20, maximum: 100)

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_device_log/?parent__id=device-123&datetime__gte=2024-01-15T00:00:00Z&limit=25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "count": 156,
  "next": "https://control.zequenze.com/api/v1/inventory_device_log/?cursor=eyJpZCI6MTIzfQ%3D%3D",
  "previous": null,
  "results": [
    {
      "id": 1001,
      "parent_id": "device-123",
      "device_name": "core-switch-01",
      "datetime": "2024-01-15T14:32:00Z",
      "action": "update",
      "variable_name": "interface_vlan_config",
      "old_value": "vlan 100",
      "new_value": "vlan 200",
      "is_pending": false,
      "is_applied": true,
      "applied_at": "2024-01-15T14:33:15Z",
      "user": "admin@company.com",
      "operation_id": "op-789456",
      "error_message": null
    },
    {
      "id": 1000,
      "parent_id": "device-123", 
      "device_name": "core-switch-01",
      "datetime": "2024-01-15T14:15:00Z",
      "action": "create",
      "variable_name": "snmp_community",
      "old_value": null,
      "new_value": "monitoring_readonly",
      "is_pending": true,
      "is_applied": false,
      "applied_at": null,
      "user": "network.admin@company.com",
      "operation_id": "op-789455",
      "error_message": null
    }
  ]
}

Response Codes:

Status Description
200 Success - Returns paginated list of device logs
401 Unauthorized - Invalid or missing authentication token
403 Forbidden - Insufficient permissions to access device logs
400 Bad Request - Invalid query parameters or date format

GET /inventory_device_log/{id}/

Description: Retrieves detailed information for a specific device log entry by its unique ID. This endpoint provides complete details about a single operation or configuration change, including its current status, any error messages, and full before/after values. Use this for detailed investigation of specific operations or when you need complete context about a particular change.

Use Cases:

  • Investigate the details of a specific failed configuration change
  • Review the complete context and metadata for a particular operation
  • Verify that a critical configuration change was successfully applied
  • Retrieve detailed error information for troubleshooting deployment issues

Full URL Example:

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

Parameters:

Parameter Type In Required Description
id integer path Yes The unique identifier of the specific log entry to retrieve
datetime__gte string query No Additional filter by minimum date/time (rarely used for single record retrieval)
datetime__lte string query No Additional filter by maximum date/time (rarely used for single record retrieval)
parent__id string query No Additional filter by device ID (for validation/security purposes)
variable_name string query No Additional filter by variable name (for validation purposes)
action string query No Additional filter by action type (for validation purposes)
is_pending boolean query No Additional filter by pending status (for validation purposes)
is_applied boolean query No Additional filter by applied status (for validation purposes)

cURL Example:

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

Example Response:

{
  "id": 1001,
  "parent_id": "device-123",
  "device_name": "core-switch-01",
  "device_type": "cisco_ios",
  "device_ip": "192.168.1.10",
  "datetime": "2024-01-15T14:32:00Z",
  "action": "update",
  "variable_name": "interface_vlan_config",
  "variable_category": "network_interfaces",
  "old_value": "interface GigabitEthernet0/1\n switchport mode access\n switchport access vlan 100",
  "new_value": "interface GigabitEthernet0/1\n switchport mode access\n switchport access vlan 200",
  "is_pending": false,
  "is_applied": true,
  "applied_at": "2024-01-15T14:33:15Z",
  "user": "admin@company.com",
  "user_role": "network_administrator",
  "operation_id": "op-789456",
  "batch_id": "batch-456789",
  "error_message": null,
  "rollback_available": true,
  "change_reason": "VLAN migration for security compliance",
  "approval_required": true,
  "approved_by": "manager@company.com",
  "approved_at": "2024-01-15T14:31:45Z",
  "metadata": {
    "source_system": "network_automation",
    "change_ticket": "CHG-2024-001234",
    "estimated_impact": "low",
    "maintenance_window": "2024-01-15T14:30:00Z to 2024-01-15T15:00:00Z"
  }
}

Response Codes:

Status Description
200 Success - Returns detailed log entry information
401 Unauthorized - Invalid or missing authentication token
403 Forbidden - Insufficient permissions to access this log entry
404 Not Found - Log entry with specified ID does not exist
400 Bad Request - Invalid ID format or query parameters

Common Use Cases

Use Case 1: Compliance Audit Report

Generate a comprehensive audit trail for a specific time period showing all device configuration changes. Use the list endpoint with date filters to extract all operations within your audit timeframe, then format the results for compliance reporting.

GET /inventory_device_log/?datetime__gte=2024-01-01&datetime__lte=2024-01-31&is_applied=true&limit=100

Use Case 2: Monitor Pending Configuration Changes

Track operations that are queued but not yet deployed to devices. This helps identify potential bottlenecks in your configuration deployment pipeline and ensure changes are applied in a timely manner.

GET /inventory_device_log/?is_pending=true&is_applied=false

Use Case 3: Device-Specific Change History

Review all configuration changes for a specific network device when troubleshooting issues or planning maintenance activities. Filter by device ID and recent timeframe.

GET /inventory_device_log/?parent__id=device-123&datetime__gte=2024-01-15T00:00:00Z

Use Case 4: Failed Operation Investigation

Identify and investigate configuration changes that failed to apply properly. Filter for applied=false operations and retrieve detailed error information.

GET /inventory_device_log/?is_applied=false&is_pending=false

Use Case 5: Variable-Specific Change Tracking

Monitor changes to critical configuration variables across all devices, such as security policies or routing configurations.

GET /inventory_device_log/?variable_name=security_policy&datetime__gte=2024-01-01

Best Practices

  • Use Date Filtering Efficiently - Always include datetime filters when possible to limit result sets and improve query performance. Use ISO 8601 format with timezone information for accuracy.

  • Implement Proper Pagination - Use the cursor-based pagination for large datasets. Set appropriate limit values (recommended: 25-50 for UI displays, 100+ for bulk processing).

  • Monitor Pending Operations - Regularly check for operations with is_pending=true to identify stuck deployments or configuration pipeline issues.

  • Combine Filters Strategically - Use multiple filter parameters together to create precise queries. For example, combine device ID with date range and action type for focused troubleshooting.

  • Error Handling Best Practices - Always check the is_applied and error_message fields when reviewing operation results. Implement retry logic for transient network issues.

  • Security Considerations - Log access should be restricted based on user roles. Sensitive configuration values may be masked in log entries depending on your system configuration.

  • Performance Optimization - Cache frequently accessed log data and use the specific log entry endpoint when you need details about known operations to reduce API call overhead.