Inventory Device Serial Setting
ManageThe Device Serial Setting API endpoints provide access to configuration parameters and settings for specific devices in your inventory. These endpoints allow you to retrieve, update, and modify device-specific settingsandusingparametersthefor inventory devices bydevice's serialnumber.number as the primary identifier. Common use cases include reading current device configurations, updating device parameters, and managing device-specific operational settings.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Device Serial Setting API category manages configuration parameters and operational settings for individual devices in your inventory system. Each device is uniquely identified by its serial number and can have multiple configurable parameters that control various aspects of device behavior and operation.
Key Concepts:
Common Use Cases:
These endpoints work together to provide complete CRUD operations for device settings, with the GET endpoint for reading configurations and PUT/PATCH endpoints for updating them. The API supports filtering by various parameter attributes to help you find specific settings quickly.
Endpoints
GET /inventory_device_serial_setting/
Description: Retrieves a list of configuration settings for devices based on their serial number. This endpoint allows you to query device settings with various filters to find specific parameters or check for pending configuration changes. It's essential for monitoring device configurations and ensuring devices are properly configured.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_serial_setting/?parent__serial_number=DEV001234&pending=true&limit=50
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__serial_number | string | 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 |
| limit | integer | query | No | Number of results to return per page (default pagination limit applies) |
| offset | integer | query | No | The |
| pending | boolean | query | No |
ExamplecURL Request:Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_serial_setting/?parent__serial_number=DEV001DEV001234¶meter__name=temperature&limit=20parameter__variable_name=network_timeout" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 5,3,
"next": null,
"previous": null,
"results": [
{
"id": 1,101,
"parameter_id"parent_device_serial": "temp_001"DEV001234",
"parameter": {
"id": "net_timeout",
"variable_name": "temp_threshold"network_timeout",
"name": "TemperatureNetwork Threshold"Timeout",
"short_name": "TempTh"NetTO",
"data_type": "integer",
"unit": "seconds"
},
"value"current_value": "75.5"30",
"pending"pending_value": false,"45",
"last_updated"is_pending": true,
"last_modified": "2024-01-15T14:30:00Z",
"applied_at": "2024-01-15T10:30:15:00Z"
},
{
"id": 102,
"parent_device_serial": "DEV001234",
"parameter": {
"id": "auto_backup",
"variable_name": "automatic_backup",
"name": "Automatic Backup",
"short_name": "AutoBak",
"data_type": "boolean"
},
"current_value": "true",
"pending_value": null,
"is_pending": false,
"last_modified": "2024-01-14T09:20:00Z",
"applied_at": "2024-01-14T09:20:00Z"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns the device settings data |
| 400 | Bad Request - Missing required |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Device with specified serial number not found |
PUT /inventory_device_serial_setting/{parent__serial_number}/
UpdateDescription: allPerforms a complete update of device settings for the specified device serial number. This performsendpoint replaces all existing settings with the provided configuration data. Use this method when you need to set multiple parameters at once or perform a complete replacementconfiguration ofoverwrite.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001234/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__serial_number | string | path | Yes | |
| data | body | Yes |
ExamplecURL Request:Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001/DEV001234/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" \
-d '{
"settings": [
{
"parameter_id": "temp_001"network_timeout",
"value": "80.0"60"
},
{
"parameter_id": "voltage_001"automatic_backup",
"value": "12.5"true"
},
{
"parameter_id": "log_level",
"value": "info"
}
]
}'
Example Response:
{
"id"device_serial": "DEV001"DEV001234",
"settings"updated_settings": [
{
"parameter_id": "temp_001"network_timeout",
"value"parameter_name": "80.0"Network Timeout",
"pending": true,
"last_updated"old_value": "2024-01-15T11:45:00Z"30",
"new_value": "60",
"status": "pending"
},
{
"parameter_id": "voltage_001"automatic_backup",
"value"parameter_name": "12.5"Automatic Backup",
"pending"old_value": true,"true",
"last_updated"new_value": "true",
"status": "unchanged"
},
{
"parameter_id": "log_level",
"parameter_name": "Logging Level",
"old_value": "debug",
"new_value": "info",
"status": "pending"
}
],
"pending_changes": 2,
"updated_at": "2024-01-15T11:15T15:45:00Z"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Settings updated successfully |
| 400 | Bad Request - Invalid JSON data |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Device with specified serial number not found |
PATCH /inventory_device_serial_setting/{parent__serial_number}/
PartiallyDescription: Performs a partial update specificof device settings for the specified device serial number. OnlyThis endpoint allows you to update specific settings without affecting other existing configurations. Use this method when you only need to modify a few specific parameters while leaving the providedrest unchanged.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001234/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__serial_number | string | path | Yes | |
| data | body | Yes |
ExamplecURL Request:Example:
curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001/DEV001234/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" \
-d '{
"settings": [
{
"parameter_id": "temp_001"network_timeout",
"value": "82.0"45"
}
]
}'
Example Response:
{
"device_serial": "DEV001234",
"updated_settings": [
{
"parameter_id": "temp_001"network_timeout",
"value"parameter_name": "82.0"Network Timeout",
"pending"old_value": true,"30",
"last_updated"new_value": "45",
"status": "pending",
"change_reason": "Performance optimization"
}
],
"pending_changes": 1,
"total_settings": 15,
"updated_at": "2024-01-15T12:00:15T16:20:00Z"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Specific settings updated successfully |
| 400 | Bad Request - Invalid JSON data |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Device or specified parameter not found |
Common Use Cases
Use Case 1: Device Configuration Audit
Retrieve all current settings for a device to perform a configuration audit or compliance check. Use the GET endpoint with the device serial number to get a complete overview of all parameters and their current values.
Use Case 2: Checking for Pending Changes
Monitor devices that have configuration changes waiting to be applied by using the GET endpoint with pending=true parameter. This helps track deployment status and ensure changes are properly applied.
Use Case 3: Single Parameter Update
When you need to adjust just one setting (like increasing a timeout value), use the PATCH endpoint to modify only that specific parameter without affecting other configurations.
Use Case 4: Configuration Template Deployment
Deploy a standard configuration template to new devices using the PUT endpoint to set all parameters at once, ensuring consistent device setup across your fleet.
Use Case 5: Parameter Search and Filtering
Find specific types of settings across devices by using parameter name filters, helping you identify devices with particular configuration patterns or locate specific parameters quickly.
Best Practices
-
Use Serial Numbers Correctly: Always
includeverify device serial numbers before making updates, as incorrect serial numbers will result in 404 errors or unintended device modifications.
Handle Pending Changes: Check for pending changes before applying new settings. Consider the impact parent__serial_numberparameterof whenoverwriting listingpending deviceconfigurations settingsthat haven't been applied yet.
Implement Proper pendingparameterError Handling: Always check response status codes and handle validation errors appropriately. Parameter validation failures (422 status) should be clearly communicated to checkusers.
Use paginationAppropriate parametersHTTP (Methods: limitand offset) for devices with many settings
pendingImplement Pagination: For devices with many settings, use the limit and offset parameters to implement proper pagination and avoid performance issues with large result sets.
Monitor Configuration Changes: Regularly audit device configurations and track pending changes to ensure your device fleet maintains proper operational parameters and security compliance.