Inventory Device Name Variables
Manage device name variables for inventory devices, allowing retrieval and updates of device-specific parameter configurations.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Endpoints
GET /inventory_device_name_variables/
Retrieve device parameter variables and settings for inventory devices. This endpoint allows filtering by device name and specific parameters, with options for additional metadata and forcing updates.
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__name | string | query | Yes | Filter setting by 'parent (device) name' field |
| parameter__variable_name | string | query | No | Comma separated list of parameter 'variable names' to retrieve |
| parameter__name | string | query | No | Comma separated list of parameter 'names' to retrieve |
| parameter__short_name | string | query | No | Comma separated list of parameter 'short-names' to retrieve |
| limit | integer | query | No | Number of results to return per page |
| offset | integer | query | No | The initial index from which to return the results |
| pending | boolean | query | No | Report if the device have pending settings |
| wildcard | boolean | query | No | Use wildcard ('*') character in 'variable name' or 'parameter name' fields |
| force_update | boolean | query | No | Force update device settings before getting the requested information |
| extra | boolean | query | No | Show additional/extra information of the parameter |
| dates | boolean | query | No | Show date information of the parameter(s) |
Example Request:
GET /api/v1/inventory_device_name_variables/?parent__name=router-01¶meter__variable_name=hostname,ip_address&extra=true
Example Response:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"parent_name": "router-01",
"parameter": {
"variable_name": "hostname",
"name": "System Hostname",
"short_name": "hostname",
"value": "router-01.company.com",
"data_type": "string"
},
"pending": false,
"extra_info": {
"category": "system",
"editable": true
}
},
{
"id": 2,
"parent_name": "router-01",
"parameter": {
"variable_name": "ip_address",
"name": "Management IP Address",
"short_name": "mgmt_ip",
"value": "192.168.1.10",
"data_type": "ipv4"
},
"pending": false,
"extra_info": {
"category": "network",
"editable": true
}
}
]
}
| Status | Description |
|---|---|
| 200 | Success - Returns device name variables |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Not Found - Device not found |
PUT /inventory_device_name_variables/{parent__name}/
Update device parameter variables for a specific inventory device. This endpoint allows bulk updates of device settings and parameters.
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__name | string | path | Yes | Name of the parent device to update |
| data | string | body | Yes | JSON data containing parameter updates |
Example Request:
PUT /api/v1/inventory_device_name_variables/router-01/
Content-Type: application/json
{
"parameters": [
{
"variable_name": "hostname",
"value": "router-01-updated.company.com"
},
{
"variable_name": "ip_address",
"value": "192.168.1.15"
},
{
"variable_name": "description",
"value": "Updated main office router"
}
],
"force_commit": true
}
Example Response:
{
"success": true,
"updated_count": 3,
"device_name": "router-01",
"parameters_updated": [
{
"variable_name": "hostname",
"old_value": "router-01.company.com",
"new_value": "router-01-updated.company.com",
"status": "updated"
},
{
"variable_name": "ip_address",
"old_value": "192.168.1.10",
"new_value": "192.168.1.15",
"status": "updated"
},
{
"variable_name": "description",
"old_value": null,
"new_value": "Updated main office router",
"status": "created"
}
],
"pending_changes": false
}
| Status | Description |
|---|---|
| 200 | Success - Parameters updated successfully |
| 400 | Bad Request - Invalid data format or parameters |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Not Found - Device not found |
| 422 | Unprocessable Entity - Validation errors in parameter data |
Best Practices
-
Use specific device names: Always provide exact device names in the
parent__nameparameter to avoid unexpected results -
Leverage filtering: Use parameter filtering options (
parameter__variable_name,parameter__name) to retrieve only needed data and improve performance -
Wildcard usage: When using
wildcard=true, be cautious with broad patterns as they may return large result sets - Batch updates: Group multiple parameter updates in a single PUT request to maintain consistency and reduce API calls
-
Force updates wisely: Use
force_update=trueonly when you need the most current data, as it may impact performance -
Pagination: Implement proper pagination using
limitandoffsetfor devices with many parameters - Error handling: Always check for validation errors in responses, especially when updating parameters with specific data types
-
Pending changes: Monitor the
pendingflag to track configuration changes that haven't been applied to devices yet