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 configurationlogschanges,formonitortrackingdevicechangesoperations, anddevicemaintainstatus.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:
Common Integration Scenarios:
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:
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 |
| datetime__lte | string | query | No | Filter logs |
| parent__id | string | query | No | Filter logs by specific device ID |
| action | string | query | No | Filter by |
| 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 |
| variable_name | string | query | No | Filter |
| cursor | string | query | No | Pagination cursor for |
| limit | integer | query | No | Number of results per page (default: |
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 |
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:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_log/1001/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | path | Yes | ||
| datetime__gte | string | query | No | |
| datetime__lte | string | query | No | |
| parent__id | string | query | No | |
| variable_name | string | query | No | |
| action | string | query | No | |
| is_pending | boolean | query | No | |
| is_applied | boolean | query | No |
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 |
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 formatfor datetime parameters. You can specify date only (2024-01-01), datewithtime (2024-01-01 10:30:00), or includetimezone(2024-01-01information10:30:00+00:00)for accuracy. -
Implement Proper Pagination
:- Use thecursor-basedcursorparameterpagination forefficient pagination throughlargedatasetsdatasets.ratherSetthanappropriateoffset-basedlimitpaginationvalues (recommended: 25-50 for UI displays, 100+ for bulk processing). -
FilteringMonitorcombinationsPending Operations:Combine-multipleRegularlyfilterscheck for operations withis_pending=truetonarrowidentifydownstuckresultsdeployments(e.g.,orfilterconfigurationbypipelinedeviceissues.and pending status) -
PerformanceCombine Filters Strategically:When-queryingUselargemultiple filter parameters together to create precise queries. For example, combine device ID with dateranges,rangeuseandactionlimitparametertypetoforcontrolfocusedresponsetroubleshooting.size -
MonitoringError Handling Best Practices:Track- Always check theis_pendingis_appliedlogs to monitor ongoing operationsandfields when reviewing operation results. Implement retry logic foris_applied=falseerror_messagefailedtransientoperationsnetwork issues. -
AuditSecuritytrailsConsiderations: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.