Inventory Device Name Variables
ManageThe Inventory Device Name Variables API provides endpoints to manage and retrieve device configuration parameters and settings for specific devices in your inventory. These endpoints allow you to query device variables by device namevariablesand update device configurations, making it essential forinventorydevicedevices,management,allowingconfigurationretrievalautomation, andupdatesmonitoringofpendingdevice-specificchangesparameteracrossconfigurations.your infrastructure.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Inventory Device Name Variables API enables comprehensive management of device-specific configuration parameters and variables within your network inventory. This API category is specifically designed for scenarios where you need to interact with device settings using the device name as the primary identifier.
Key Capabilities:
Common Integration Scenarios:
This API is particularly useful for network administrators, DevOps engineers, and automation systems that manage large-scale device deployments where configuration consistency and change tracking are critical.
Endpoints
GET /inventory_device_name_variables/
RetrieveDescription: Retrieves configuration parameters and variables for devices in your inventory, filtered by device parameter variables and settings for inventory devices.name. This endpoint allowsis essential for querying current device settings, checking for pending configuration changes, and retrieving detailed parameter metadata. It supports flexible filtering byoptions to target specific parameters or parameter types.
Use Cases:
Full forURL additionalExample:
https://control.zequenze.com/api/v1/inventory_device_name_variables/?parent__name=router-01¶meter__variable_name=hostname,interface_config&pending=true&limit=50
and forcing updates.
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__name | string | query | Yes | |
| parameter__variable_name | string | query | No | |
| parameter__name | string | query | No | |
| parameter__short_name | string | query | No | |
| limit | integer | query | No | Number of results to return per page (default varies, recommended: 50-100) |
| offset | integer | query | No | |
| pending | boolean | query | No | |
| wildcard | boolean | query | No | |
| force_update | boolean | query | No | |
| extra | boolean | query | No | |
| dates | boolean | query | No |
ExamplecURL Request:Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_name_variables/?parent__name=router-01¶meter__variable_name=hostname,ip_addressinterface_speed&extra=true&dates=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 2,25,
"next": null,"https://control.zequenze.com/api/v1/inventory_device_name_variables/?limit=20&offset=20&parent__name=router-01",
"previous": null,
"results": [
{
"id": 1,1247,
"parent_name"device_name": "router-01",
"parameter"parameter_name": {"System Hostname",
"parameter_short_name": "hostname",
"variable_name": "hostname",
"name": "System Hostname",
"short_name": "hostname",
"value"current_value": "router-01.datacenter.company.com",
"pending_value": null,
"data_type": "string"
},
"pending"is_pending": false,
"last_updated": "2024-01-15T10:30:00Z",
"created_at": "2024-01-10T09:15:00Z",
"extra_info": {
"validation_rule": "^[a-zA-Z0-9\\.-]+$",
"restart_required": false,
"category": "system",
"editable": true
}
},
{
"id": 2,1248,
"parent_name"device_name": "router-01",
"parameter"parameter_name": {"Interface Speed",
"parameter_short_name": "int_speed",
"variable_name": "ip_address"interface_speed",
"name"current_value": "Management IP Address"1000",
"short_name"pending_value": "mgmt_ip",
"value": "192.168.1.10"10000",
"data_type": "ipv4"
}integer",
"pending"is_pending": false,true,
"last_updated": "2024-01-16T14:22:00Z",
"created_at": "2024-01-10T09:15:00Z",
"extra_info": {
"unit": "Mbps",
"valid_values": [100, 1000, 10000],
"restart_required": true,
"category": "network",
"editable": true
}
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns the device |
| 400 | Bad Request - |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Device with specified name does not |
PUT /inventory_device_name_variables/{parent__name}/
UpdateDescription: deviceUpdates parameterconfiguration parameters and variables for a specific inventorydevice device.identified by name. This endpoint allows you to modify device settings, apply pending configurations, and bulk updatesupdate multiple parameters in a single operation. It's the primary method for programmatic device configuration management.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_name_variables/router-01/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent__name | string | path | Yes | |
| data | string | body | Yes | JSON |
ExamplecURL Request:Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_name_variables/router-01/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" \
-d '{
"parameters": [
{
"variable_name": "hostname",
"value": "router-01-updated.company.01.newdomain.com"
},
{
"variable_name": "ip_address"interface_speed",
"value": "192.168.1.15"10000"
},
{
"variable_name": "description"snmp_community",
"value": "Updated main office router"production_read_v2"
}
],
"force_commit"apply_immediately": false,
"validate_only": false
}'
Example Request Body:
{
"parameters": [
{
"variable_name": "hostname",
"value": "router-01.production.company.com",
"force_update": false
},
{
"variable_name": "interface_speed",
"value": "10000",
"force_update": true
},
{
"variable_name": "vlan_config",
"value": "100,200,300",
"force_update": false
}
],
"apply_immediately": false,
"validate_only": false,
"backup_current": true
}
Example Response:
{
"success"status": true,
"updated_count": 3,success",
"device_name": "router-01",
"parameters_updated"updated_parameters": [
{
"variable_name": "hostname",
"old_value"previous_value": "router-01.staging.company.com",
"new_value": "router-01-updated.01.production.company.com",
"status": "updated"pending",
"requires_restart": false
},
{
"variable_name": "ip_address"interface_speed",
"old_value"previous_value": "192.168.1.10"1000",
"new_value": "192.168.1.15"10000",
"status": "updated"applied",
"requires_restart": true
},
{
"variable_name": "description"vlan_config",
"old_value"previous_value": null,"100,200",
"new_value": "Updated main office router"100,200,300",
"status": "created"pending",
"requires_restart": false
}
],
"pending_changes"summary": false{
"total_parameters": 3,
"applied_immediately": 1,
"pending_application": 2,
"validation_errors": 0,
"restart_required": true
},
"backup_id": "backup_router-01_20240116_142500",
"timestamp": "2024-01-16T14:25:00Z"
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Parameters updated successfully |
| 400 | Bad Request - Invalid parameter data |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Device with specified name does not |
Common Use Cases
Use Case 1: Configuration Compliance Monitoring
Monitor device configurations across your infrastructure to ensure compliance with organizational standards. Use the GET endpoint with specific parameter filters to check critical settings like SNMP communities, NTP servers, and security policies across all devices.
# Check SNMP configuration across devices
GET /inventory_device_name_variables/?parameter__variable_name=snmp_community,snmp_version&extra=true
Use Case 2: Automated Device Deployment
During device provisioning, use the PUT endpoint to apply standardized configurations to new devices. This ensures consistent setup across your infrastructure and reduces manual configuration errors.
Use Case 3: Pending Change Management
Before maintenance windows, use the GET endpoint with pending=true to identify all devices with pending configuration changes, then coordinate the application of these changes during scheduled maintenance.
Use Case 4: Configuration Drift Detection
Regularly query device parameters and compare against your configuration management database to detect unauthorized changes or configuration drift across your network infrastructure.
Use Case 5: Bulk Parameter Updates
Use the PUT endpoint to update multiple related parameters simultaneously, such as updating VLAN configurations, routing parameters, and security settings as part of a coordinated network change.
Best Practices
-
Use
specificPaginationdevice namesEffectively:AlwaysForprovidelargeexactinventories,devicealwaysnames inuse theparameter (recommended: 50-100 items per page) and implement proper pagination handling to avoidparent__namelimitunexpectedtimeoutsresultsand excessive memory usage. -
Leverage
filteringFiltering: Use specific parameterfiltering optionsfilters (parameter__variable_name,parameter__name) toretrievereduceonlyresponseneeded datasize and improve performance when you only need specific configuration data. -
WildcardHandleusagePending Changes:WhenAlways check theis_pendingfield in responses and consider using thewildcard=pending=true,bequerycautiousparameterwithtobroadidentifypatternsdevicesasrequiringtheyattentionmaybeforereturnmakinglargenewresultchanges.sets -
Batch updates: Group multiple parameter updates in a single PUT request to maintain consistency and reduce API calls
Force updatesUpdates wiselyJudiciously: Use force_update=true onlysparingly whenas it triggers real-time device communication, which can impact performance. Reserve it for critical operations where you need the mostabsolute currentlatest data,data.
Pagination: Implement properProper pagination using limit and offset for devices with many parameters
Use Validation Mode: When updating parameters, consider using validate_only=true in responses,your request to test parameter changes before applying them, especially in production environments.
Monitor Rate Limits: Be mindful of API rate limits when making bulk operations. Implement exponential backoff and respect any rate limiting headers in responses.
Backup Before Changes: Always set backup_current=true when updating critical device parameters with specific data types
pending