Skip to main content

Inventory Device Log

RetrieveThe 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 logschanges, formonitor trackingdevice changesoperations, and devicemaintain status.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/

      RetrieveDescription: Retrieves a paginated list of device operation logs and configuration logs,changes. withThis supportendpoint is the primary method for filteringaccessing 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 datetime,reviewing device,recent actionchanges type,to andspecific status.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)00
        datetime__lte string query No Filter logs untilup to this date/timetime. (Supports ISO format: 2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:00)00
        parent__id string query No Filter logs by specific device ID (parentto device)show only operations for that device
        action string query No Filter by actionoperation type (e.g., config_change,'create', restart,'update', 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 statusoperations
        variable_name string query No Filter bylogs for changes to specific configuration variable namevariables
        cursor string query No Pagination cursor for next/previousretrieving the next page of results
        limit integer query No Number of results per page (default: 20)20, maximum: 100)

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device_log/?parent__id=device-123&datetime__gte=2024-01-01&action=config_change&is_applied=true15T00:00:00Z&limit=1025" \
          -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=abc123"eyJpZCI6MTIzfQ%3D%3D",
          "previous": null,
          "results": [
            {
              "id": 1001,
              "parent_id": "device-123",
              "device_name": "core-switch-01",
              "datetime": "2024-01-15T10:30:15T14:32:00Z",
              "parent": {
                "id": "device-001",
                "name": "Router-Main-01"
              },
              "action": "config_change"update",
              "variable_name": "bgp_neighbor"interface_vlan_config",
              "old_value": "192.168.1.1"vlan 100",
              "new_value": "192.168.1.2"vlan 200",
              "is_pending": false,
              "is_applied": true,
              "applied_at": "2024-01-15T10:31:15T14:33:15Z",
              "user": "admin@company.com",
              "operation_id": "op-789456",
              "error_message": null
            },
            {
              "id": 1002,1000,
              "parent_id": "device-123", 
              "device_name": "core-switch-01",
              "datetime": "2024-01-15T09:15T14:15:00Z",
              "parent": {
                "id": "device-002",
                "name": "Switch-Access-05"
              },
              "action": "firmware_update"create",
              "variable_name": null,"snmp_community",
              "old_value": "v2.1.0",null,
              "new_value": "v2.1.1"monitoring_readonly",
              "is_pending": false,true,
              "is_applied": true,false,
              "applied_at": "2024-01-15T09:20:30Z",null,
              "user": "system"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}/

        RetrieveDescription: Retrieves detailed information aboutfor 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 stringinteger path Yes UniqueThe unique identifier of the devicespecific log entry to retrieve
          datetime__gte string query No FilterAdditional filter by minimum datetimedate/time (ISOrarely format)used for single record retrieval)
          datetime__lte string query No FilterAdditional filter by maximum datetimedate/time (ISOrarely format)used for single record retrieval)
          parent__id string query No FilterAdditional filter by device ID (for validation/security purposes)
          variable_name string query No FilterAdditional filter by variable name (for validation purposes)
          action string query No FilterAdditional filter by action type (for validation purposes)
          is_pending boolean query No FilterAdditional filter by pending status (for validation purposes)
          is_applied boolean query No FilterAdditional filter by applied status (for validation purposes)

          ExamplecURL Request: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-15T10:30:15T14:32:00Z",
            "parent": {
              "id": "device-001",
              "name": "Router-Main-01",
              "model": "Cisco ASR1001-X",
              "location": "Data Center A"
            },
            "action": "config_change"update",
            "variable_name": "bgp_neighbor"interface_vlan_config",
            "variable_category": "network_interfaces",
            "old_value": "192.168.1.1"interface GigabitEthernet0/1\n switchport mode access\n switchport access vlan 100",
            "new_value": "192.168.1.2"interface GigabitEthernet0/1\n switchport mode access\n switchport access vlan 200",
            "is_pending": false,
            "is_applied": true,
            "applied_at": "2024-01-15T10:31:15T14:33:15Z",
            "user": "admin@company.com",
            "change_request_id"user_role": "CR-2024-001"network_administrator",
            "operation_id": "op-789456",
            "batch_id": "batch-456789",
            "error_message": null,
            "rollback_available": true,
            "notes"change_reason": "UpdatedVLAN BGPmigration neighborfor assecurity partcompliance",
            of"approval_required": networktrue,
            optimization""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 foundexist
          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 filteringFiltering Efficiently: - Always include datetime filters when possible to limit result sets and improve query performance. Use ISO 8601 format for datetime parameters. You can specify date only (2024-01-01), date with time (2024-01-01 10:30:00), or include timezone (2024-01-01information 10:30:00+00:00)for accuracy.

          • Implement Proper Pagination: - Use the cursorcursor-based parameterpagination for efficient pagination through large datasetsdatasets. ratherSet thanappropriate offset-basedlimit paginationvalues (recommended: 25-50 for UI displays, 100+ for bulk processing).

          • FilteringMonitor combinationsPending Operations: Combine- multipleRegularly filterscheck for operations with is_pending=true to narrowidentify downstuck resultsdeployments (e.g.,or filterconfiguration bypipeline deviceissues.

            and pending status)
          • PerformanceCombine Filters Strategically: When- queryingUse largemultiple filter parameters together to create precise queries. For example, combine device ID with date ranges,range useand limitaction parametertype tofor controlfocused responsetroubleshooting.

            size
          • MonitoringError Handling Best Practices: Track- Always check the is_pendingis_applied logs to monitor ongoing operations and is_applied=falseerror_message fields when reviewing operation results. Implement retry logic for failedtransient operationsnetwork issues.

          • AuditSecurity trailsConsiderations: Use- thisLog 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 forwhen complianceyou andneed auditdetails reportingabout byknown filteringoperations onto specificreduce devicesAPI orcall timeoverhead.

          periods