Skip to main content

Inventory Device Log

Retrieve device operation and configuration logs for tracking changes and device status.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Endpoints

GET /inventory_device_log/

Retrieve a paginated list of device operation and configuration logs, with support for filtering by datetime, device, action type, and status.

Parameters:

Parameter Type In Required Description
datetime__gte string query No Filter logs from this date/time (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 until this date/time (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 by device ID (parent device)
action string query No Filter by action type (e.g., config_change, restart, update)
is_pending boolean query No Filter by pending status
is_applied boolean query No Filter by applied status
variable_name string query No Filter by configuration variable name
cursor string query No Pagination cursor for next/previous page
limit integer query No Number of results per page (default: 20)

Example Request:

GET /api/v1/inventory_device_log/?datetime__gte=2024-01-01&action=config_change&is_applied=true&limit=10

Example Response:

{
  "count": 156,
  "next": "https://control.zequenze.com/api/v1/inventory_device_log/?cursor=abc123",
  "previous": null,
  "results": [
    {
      "id": 1001,
      "datetime": "2024-01-15T10:30:00Z",
      "parent": {
        "id": "device-001",
        "name": "Router-Main-01"
      },
      "action": "config_change",
      "variable_name": "bgp_neighbor",
      "old_value": "192.168.1.1",
      "new_value": "192.168.1.2",
      "is_pending": false,
      "is_applied": true,
      "applied_at": "2024-01-15T10:31:15Z",
      "user": "admin@company.com"
    },
    {
      "id": 1002,
      "datetime": "2024-01-15T09:15:00Z",
      "parent": {
        "id": "device-002",
        "name": "Switch-Access-05"
      },
      "action": "firmware_update",
      "variable_name": null,
      "old_value": "v2.1.0",
      "new_value": "v2.1.1",
      "is_pending": false,
      "is_applied": true,
      "applied_at": "2024-01-15T09:20:30Z",
      "user": "system"
    }
  ]
}
Status Description
200 Success
401 Unauthorized
403 Forbidden

GET /inventory_device_log/{id}/

Retrieve detailed information about a specific device log entry by ID.

Parameters:

Parameter Type In Required Description
id string path Yes Unique identifier of the device log entry
datetime__gte string query No Filter by minimum datetime (ISO format)
datetime__lte string query No Filter by maximum datetime (ISO format)
parent__id string query No Filter by device ID
variable_name string query No Filter by variable name
action string query No Filter by action type
is_pending boolean query No Filter by pending status
is_applied boolean query No Filter by applied status

Example Request:

GET /api/v1/inventory_device_log/1001/

Example Response:

{
  "id": 1001,
  "datetime": "2024-01-15T10:30:00Z",
  "parent": {
    "id": "device-001",
    "name": "Router-Main-01",
    "model": "Cisco ASR1001-X",
    "location": "Data Center A"
  },
  "action": "config_change",
  "variable_name": "bgp_neighbor",
  "old_value": "192.168.1.1",
  "new_value": "192.168.1.2",
  "is_pending": false,
  "is_applied": true,
  "applied_at": "2024-01-15T10:31:15Z",
  "user": "admin@company.com",
  "change_request_id": "CR-2024-001",
  "rollback_available": true,
  "notes": "Updated BGP neighbor as part of network optimization"
}
Status Description
200 Success
401 Unauthorized
403 Forbidden
404 Log entry not found

Best Practices

  • Date filtering: 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-01 10:30:00+00:00)
  • Pagination: Use the cursor parameter for efficient pagination through large datasets rather than offset-based pagination
  • Filtering combinations: Combine multiple filters to narrow down results (e.g., filter by device and pending status)
  • Performance: When querying large date ranges, use limit parameter to control response size
  • Monitoring: Track is_pending logs to monitor ongoing operations and is_applied=false for failed operations
  • Audit trails: Use this endpoint for compliance and audit reporting by filtering on specific devices or time periods