Inventory Device Variables
The Inventory Device Variables API provides complete control over device configuration parameters and settings variables. These endpoints allow you to retrieve and update device-specific variables that control device behavior, configuration settings, and operational parameters within your inventory management system.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Inventory Device Variables API category manages device configuration variables that define how devices operate within your inventory system. These variables can include network settings, operational parameters, feature flags, thresholds, and other device-specific configurations.
This API is essential for:
- Device Configuration Management: Centrally manage device settings and parameters
- Bulk Configuration Updates: Update multiple device variables efficiently
- Configuration Monitoring: Track pending changes and variable states
- Dynamic Device Behavior: Modify device behavior without physical access
- Compliance and Standards: Ensure devices meet organizational requirements
The two endpoints work together to provide complete CRUD functionality - retrieve current variable states with filtering and search capabilities, then update specific device configurations as needed. The API supports advanced features like wildcard searching, pending change tracking, and forced updates to ensure real-time configuration management.
Endpoints
GET /inventory_device_variables/
Description: Retrieves device configuration variables with extensive filtering and search capabilities. This endpoint allows you to query device variables by parent device, variable names, parameter names, and includes options for tracking pending changes and forcing real-time updates.
Use Cases:
- Retrieve all configuration variables for a specific device
- Search for specific parameters across devices using variable names or parameter names
- Monitor pending configuration changes before applying them
- Audit device configurations and compliance status
- Export device settings for backup or migration purposes
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123¶meter__variable_name=network_config,device_timeout&pending=true&extra=true
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent_id | integer | query | Yes | The device ID to filter settings by. This identifies which device's variables to retrieve |
| parameter__variable_name | string | query | No | Comma-separated list of specific variable names to retrieve (e.g., "network_ip,device_port,timeout_value") |
| parameter__name | string | query | No | Comma-separated list of parameter display names to retrieve |
| parameter__short_name | string | query | No | Comma-separated list of parameter short names for quick identification |
| limit | integer | query | No | Number of results per page for pagination (default varies by system configuration) |
| offset | integer | query | No | Starting index for pagination results |
| pending | boolean | query | No | Include pending change information to show variables with uncommitted updates |
| wildcard | boolean | query | No | Enable wildcard (*) character matching in variable_name and parameter name fields |
| force_update | boolean | query | No | Force refresh device settings from the actual device before returning results |
| extra | boolean | query | No | Include additional metadata and extended information about each parameter |
| dates | boolean | query | No | Include creation, modification, and last sync date information |
cURL Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123¶meter__variable_name=network_config,security_mode&pending=true&extra=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 15,
"next": "https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123&limit=10&offset=10",
"previous": null,
"results": [
{
"id": 1001,
"name": "Network Configuration",
"variable_name": "network_config",
"value": "192.168.1.100",
"type": "ip_address",
"short_name": "net_cfg",
"extra": true,
"extra_value": "Static IP assignment for production network",
"pending": false
},
{
"id": 1002,
"name": "Security Mode",
"variable_name": "security_mode",
"value": "enhanced",
"type": "enum",
"short_name": "sec_mode",
"extra": false,
"extra_value": null,
"pending": true
},
{
"id": 1003,
"name": "Device Timeout",
"variable_name": "device_timeout",
"value": "300",
"type": "integer",
"short_name": "timeout",
"extra": true,
"extra_value": "Timeout in seconds for device communication",
"pending": false
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns filtered device variables with pagination |
| 400 | Bad Request - Missing required parent_id or invalid parameters |
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Not Found - Device with specified parent_id does not exist |
| 500 | Internal Server Error - System error during variable retrieval |
PUT /inventory_device_variables/{parent_id}/
Description: Updates device configuration variables for a specific device. This endpoint allows you to modify multiple device variables in a single request, with changes typically marked as pending until applied to the actual device.
Use Cases:
- Update device network settings and connectivity parameters
- Modify operational thresholds and limits
- Change security settings and access controls
- Apply configuration templates to devices
- Implement bulk configuration changes across device fleets
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_variables/123/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent_id | integer | path | Yes | The device ID to update variables for (included in URL path) |
| data | string | body | Yes | JSON string containing variable updates with variable names and new values |
cURL Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_variables/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"network_config": "192.168.1.150",
"security_mode": "standard",
"device_timeout": "600"
}'
Example Request Body:
{
"network_config": "192.168.1.150",
"security_mode": "standard",
"device_timeout": "600",
"polling_interval": "30",
"max_connections": "10"
}
Example Response:
{
"id": 1001,
"name": "Network Configuration",
"variable_name": "network_config",
"value": "192.168.1.150",
"type": "ip_address",
"short_name": "net_cfg",
"extra": true,
"extra_value": "Updated static IP assignment",
"pending": true
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Variables updated successfully |
| 400 | Bad Request - Invalid variable names or values in request data |
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Not Found - Device with specified parent_id does not exist |
| 422 | Unprocessable Entity - Variable validation failed |
| 500 | Internal Server Error - System error during update |
Common Use Cases
Use Case 1: Device Network Configuration
Retrieve and update network-related variables for a device to change IP addresses, ports, or connectivity settings. Use GET to check current network configuration, then PUT to apply new network parameters.
Use Case 2: Bulk Security Settings Update
Query devices using wildcard searches to find all security-related variables, then update security modes, access controls, and authentication settings across multiple devices.
Use Case 3: Configuration Change Management
Monitor pending changes using the pending=true parameter to review configuration updates before they're applied to physical devices, ensuring changes can be validated before deployment.
Use Case 4: Device Template Application
Use parameter filtering to retrieve specific configuration templates, then apply standardized variable sets to new devices to ensure consistent configuration across your inventory.
Use Case 5: Compliance Auditing
Retrieve all device variables with extra information and dates to generate compliance reports, track configuration changes over time, and ensure devices meet organizational standards.
Best Practices
-
Use Pagination: Always implement pagination for large device inventories using
limitandoffsetparameters to avoid timeouts and improve performance - Filter Strategically: Use specific variable name filters rather than retrieving all variables when you only need specific parameters
-
Monitor Pending Changes: Regularly check for pending changes using the
pending=trueparameter before applying critical updates -
Force Updates Sparingly: Use
force_update=trueonly when real-time accuracy is essential, as it impacts performance - Validate Before Update: Always retrieve current variable values before updating to ensure you understand the current state
- Error Handling: Implement proper error handling for validation failures (422 status) and retry logic for temporary failures
- Security Considerations: Treat device variables as sensitive data and ensure proper authentication and authorization for all requests
- Batch Updates: Group related variable updates in single PUT requests rather than making multiple individual calls