Inventory Device Setting
ManageThe Inventory Device Setting API provides endpoints for managing configuration parameters and settings for devices within your inventory system. These endpoints allow you to retrieve, update, and modify device-specific settings such as operational parameters, configurationsettingsvalues, andparameterscustomforpropertiesinventorythatitems.control device behavior and functionality.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Inventory Device Setting API enables you to manage configuration parameters for devices in your inventory system. Device settings are parameter-value pairs that define how individual devices should operate, including network configurations, operational thresholds, feature toggles, and custom properties.
Key Concepts:
Common Use Cases:
These endpoints work together to provide a complete configuration management system where you can list current settings, and update them as needed for operational requirements.
Endpoints
GET /inventory_device_setting/
RetrieveDescription: Retrieves a paginated list of device settings filteredbased on various filter criteria. This endpoint is essential for viewing current device configurations, finding settings by variousparameter parameters.names, and checking for pending changes across your device inventory.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_setting/?parent_id=123¶meter__variable_name=network_timeout&pending=false
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent_id | integer | query | Yes | |
| parameter_id | string | query | No | Filter by specific parameter ID |
| parameter__variable_name | string | query | No | Filter |
| parameter__name | string | query | No | Filter |
| parameter__short_name | string | query | No | Filter |
ExamplecURL Request:Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_setting/?parent_id=123¶meter__name=temperature&limit=1010" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 25,
"next": "https://control.zequenze.com/api/v1/inventory_device_setting/?parent_id=123&limit=10&offset=10",
"previous": null,
"results": [
{
"id": 1,
"parent_id": 123,
"parameter": {
"id": "temp_001"net_timeout",
"variable_name": "device_temperature"network_timeout",
"name": "TemperatureNetwork Setting"Timeout",
"short_name": "temp"Net TO"
},
"value": "25.5"30",
"pending": false,
"last_updated"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:25:00Z"
},
{
"id": 2,
"parent_id": 123,
"parameter": {
"id": "max_conn",
"variable_name": "max_connections",
"name": "Maximum Connections",
"short_name": "Max Conn"
},
"value": "100",
"pending": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-22T09:15:00Z"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns the filtered device settings |
| 400 | Bad |
| 401 | Unauthorized - Invalid or missing API token |
PUT /inventory_device_setting/{parent_id}/
UpdateDescription: Performs a complete update of device settings for the specified device. This endpoint replaces all existing settings for the device with the provided data set. Use this when you need to perform bulk configuration updates or reset a specificdevice's parentconfiguration device.entirely.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_setting/123/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent_id | integer | path | Yes | The device ID |
| data | string | body | Yes | Complete JSON |
ExamplecURL Request:Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_setting/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" \
-d '{
"settings": [
{
"parameter_id": "temp_001"network_timeout",
"value": "26.0"45"
},
{
"parameter_id": "humidity_001"max_connections",
"value": "45.5"150"
},
{
"parameter_id": "enable_logging",
"value": "true"
}
]
}'
Example Response:
{
"success": true,
"updated_count"message": 2,"Device settings updated successfully",
"settings"updated_settings": [
{
"id": 1,
"parameter_id"parent_id": 123,
"parameter": {
"id": "temp_001"network_timeout",
"variable_name": "network_timeout",
"name": "Network Timeout"
},
"value": "26.0"45",
"pending": true,
"last_updated"updated_at": "2024-01-15T11:45:22T15:30:00Z"
},
{
"id": 2,
"parameter_id"parent_id": 123,
"parameter": {
"id": "humidity_001"max_connections",
"variable_name": "max_connections",
"name": "Maximum Connections"
},
"value": "45.5"150",
"pending": true,
"last_updated"updated_at": "2024-01-15T11:45:22T15:30:00Z"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing API token |
PATCH /inventory_device_setting/{parent_id}/
PartiallyDescription: updatePerforms partial updates to specific device settings without affecting other existing settings. This endpoint allows you to modify individual parameters or small groups of settings while preserving all other current configurations. Ideal for atargeted parentconfiguration device.changes.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_setting/123/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent_id | integer | path | Yes | The device ID |
| data | string | body | Yes | JSON |
ExamplecURL Request:Example:
curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device_setting/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" \
-d '{
"updates": [
{
"parameter_id": "temp_001"network_timeout",
"value": "27.2"60"
}
]
}'
Example Response:
{
"success": true,
"message": "Device settings partially updated",
"updated_settings": [
{
"id": 1,
"parent_id": 123,
"parameter": {
"id": "temp_001"network_timeout",
"variable_name": "device_temperature"network_timeout",
"name": "TemperatureNetwork Setting"Timeout",
"short_name": "temp"Net TO"
},
"value": "27.2"60",
"previous_value": "45",
"pending": true,
"last_updated"updated_at": "2024-01-15T12:00:22T16:45:00Z"
}
],
"unchanged_settings_count": 24
}
Response Codes:
| Status | Description |
|---|---|
| 200 | |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing API token |
Common Use Cases
Use Case 1: Device Configuration Audit
Retrieve all settings for multiple devices to ensure compliance with organizational standards. Use the GET endpoint with different parent_id values and compare configurations across your device fleet.
Use Case 2: Bulk Configuration Deployment
Apply standardized settings to new devices or update existing devices with new operational parameters. Use PUT for complete configuration replacement or PATCH for targeted updates.
Use Case 3: Monitoring Pending Changes
Track configuration changes that haven't been deployed to devices yet by filtering with pending=true. This helps manage deployment schedules and ensure changes are properly applied.
Use Case 4: Parameter-Based Configuration Management
Find all devices with specific parameter configurations using the parameter filter options, enabling targeted updates across devices with similar configurations.
Use Case 5: Incremental Configuration Updates
Use PATCH to make small, targeted changes to device settings without disrupting other configurations, ideal for performance tuning and gradual rollouts.
Best Practices
-
Always specify parent_id: The parent_id parameter is required for GET requests and critical for identifying the
parent_idwhen listingcorrect devicesettingsfor updates.
Use pagination effectively: For devices with many settings, implement proper pagination using limit and offset to ensureavoid properperformance filteringissues.
Monitor pending changes: Regularly check for pending settings using the pending parameterfilter to checkensure ifconfiguration settingschanges are awaitingproperly synchronizationdeployed.
Validate parameter names: Use the parameter filter options to verify parameter names and IDs before making updates to avoid configuration errors.
Implement proper error handling: Always check response codes and handle 404 errors for cases where parentnon-existent devices don'tor existparameters gracefully.
Use PATCH for incremental updates: When updatingmodifying multipleonly a few settings, preferuse PATCH instead of PUT overto multiplepreserve PATCHexisting requestsconfigurations forand betterreduce performancethe risk of accidental overwrites.
Batch filtersrelated (parameter__name,changes: parameter__variable_name)Group related configuration changes into single API calls when possible to findmaintain specificconfiguration setting types
limitconsistency and offsetreduce pending