Inventory Device Variables
The Inventory Device Variables API provides
accesscompletetocontrol over device configuration parameters and settingsvariables for network devices.variables. These endpoints allow you to retrieve and update device-specific variables that control device behavior, configurationvalues, monitor pending changes,settings, andmanageoperationalparameterparameterssettings acrosswithin yourdeviceinventoryinventory.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 enablescategory managementmanages ofdevice configuration parametersvariables andthat define how devices operate within your inventory system. These variables forcan individual devices in your network inventory. This API category is essential for:
Device Configuration Management: Retrieve and modify configuration parameters for specific devices, includinginclude network settings, operational parameters, feature flags, thresholds, and customother variables.device-specific configurations.
This API is essential for:
Parameter Filtering: Query specific parameters by variable name, parameter name, or short name to focus on relevant configuration data.
Bulk Operations:Configuration Updates: Update multiple device variables efficiently
TheseThe two endpoints work together to provide complete deviceCRUD parameter lifecycle managementfunctionality - from queryingretrieve current valuesvariable states with filtering and pendingsearch changescapabilities, tothen applyingupdate configurationspecific updates.device configurations as needed. The API supports advanced filteringfeatures withlike wildcard patternssearching, pending change tracking, and providesforced optionsupdates forto retrievingensure additionalreal-time metadataconfiguration like timestamps and parameter details.management.
Endpoints
GET /inventory_device_variables/
Description: Retrieves device configuration parametersvariables with extensive filtering and variablessearch for a specific device.capabilities. This endpoint allows you to query device settings, filtervariables by parent device, variable names, parameter types,names, and checkincludes options for tracking pending configuration changes beforeand theyforcing arereal-time applied to the device.updates.
Use Cases:
- Retrieve all configuration
parametersvariables for a specific device CheckSearch for specific parameters across devices using variable names or parameter names
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123¶meter__variable_name=hostname,ip_addressnetwork_config,device_timeout&pending=true&extra=true
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| parent_id | integer | query | Yes | The device ID to |
| parameter__variable_name | string | query | No | Comma-separated list of specific variable names to retrieve (e.g., " |
| parameter__name | string | query | No | Comma-separated list of parameter display names to |
| parameter__short_name | string | query | No | Comma-separated list of parameter short names |
| limit | integer | query | No | Number of results |
| offset | integer | query | No | Starting index for pagination |
| pending | boolean | query | No | Include pending change information |
| wildcard | boolean | query | No | |
| force_update | boolean | query | No | Force refresh device settings from the actual device before returning |
| extra | boolean | query | No | Include additional |
| dates | boolean | query | No | Include |
cURL Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123¶meter__variable_name=hostname,management_ipnetwork_config,security_mode&pending=true&extra=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 2,15,
"next": null,"https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123&limit=10&offset=10",
"previous": null,
"results": [
{
"id": 1001,
"parent_id"name": 123,"Network Configuration",
"variable_name": "hostname"network_config",
"parameter_name"value": "System Hostname"192.168.1.100",
"parameter_short_name"type": "hostname"ip_address",
"current_value"short_name": "sw-core-01"net_cfg",
"pending_value": "sw-core-primary",
"has_pending_changes"extra": true,
"data_type"extra_value": "string"Static IP assignment for production network",
"description"pending": "Device hostname for network identification",
"last_updated": "2024-01-15T10:30:00Z",
"created_at": "2024-01-01T09:00:00Z",
"is_required": true,
"validation_pattern": "^[a-zA-Z0-9-]{1,63}$"false
},
{
"id": 1002,
"parent_id"name": 123,"Security Mode",
"variable_name": "management_ip"security_mode",
"parameter_name"value": "Management IP Address"enhanced",
"parameter_short_name"type": "mgmt_ip"enum",
"current_value"short_name": "192.168.1.10"sec_mode",
"pending_value"extra": false,
"extra_value": null,
"has_pending_changes"pending": false,true
},
{
"data_type"id": 1003,
"name": "ipv4"Device Timeout",
"description"variable_name": "IPdevice_timeout",
address"value": "300",
"type": "integer",
"short_name": "timeout",
"extra": true,
"extra_value": "Timeout in seconds for device management access"communication",
"last_updated"pending": "2024-01-10T14:22:00Z",
"created_at": "2024-01-01T09:00:00Z",
"is_required": true,
"validation_pattern": "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$"false
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns filtered device variables |
| 400 | Bad Request - |
| 401 | Unauthorized - Invalid or missing |
| 404 | Not Found - Device with specified parent_id does not exist |
| 500 | Internal Server Error - |
PUT /inventory_device_variables/{parent_id}/
Description: Updates device configuration parameters and variables for a specific device. This endpoint allows you to modify multiple device settingsvariables byin providinga newsingle valuesrequest, forwith onechanges ortypically more parameters. Changes may be applied immediately or stagedmarked as pending changesuntil dependingapplied onto the deviceactual configuration.device.
Use Cases:
- Update device
configurationnetwork settings and connectivity parameters
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 |
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 '{
"variables": [
{
"variable_name"network_config": "hostname"192.168.1.150",
"value"security_mode": "sw-core-primary"standard",
"apply_immediately": false
},
{
"variable_name"device_timeout": "management_vlan",
"value": "100",
"apply_immediately": true
}
]600"
}'
Example Request Body:
{
"variables": [
{
"variable_name"network_config": "hostname"192.168.1.150",
"value"security_mode": "sw-core-primary"standard",
"apply_immediately": false,
"comment"device_timeout": "Updated hostname for primary core switch"
}600",
{
"variable_name"polling_interval": "management_vlan"30",
"value"max_connections": "100",
"apply_immediately": true,
"comment": "Changed management VLAN to 100"
},
{
"variable_name": "snmp_community",
"value": "secure_community_string",
"apply_immediately": false,
"encrypted": true
}
],
"batch_comment": "Monthly configuration update",
"schedule_deployment": "2024-01-20T02:00:00Z"10"
}
Example Response:
{
"success"id": true,1001,
"updated_variables"name": ["Network {Configuration",
"variable_name": "hostname"network_config",
"previous_value"value": "sw-core-01"192.168.1.150",
"new_value"type": "sw-core-primary"ip_address",
"status"short_name": "pending"net_cfg",
"scheduled_for"extra": true,
"extra_value": "2024-01-20T02:00:00Z"Updated },static {IP "variable_name": "management_vlan"assignment",
"previous_value"pending": "10",
"new_value": "100",
"status": "applied",
"applied_at": "2024-01-15T15:45:00Z"
},
{
"variable_name": "snmp_community",
"previous_value": "[ENCRYPTED]",
"new_value": "[ENCRYPTED]",
"status": "pending",
"scheduled_for": "2024-01-20T02:00:00Z"
}
],
"batch_id": "batch_2024011515450123",
"total_updated": 3,
"pending_count": 2,
"applied_count": 1,
"next_deployment": "2024-01-20T02:00:00Z"true
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Variables updated successfully |
| 400 | Bad Request - Invalid variable |
| 401 | Unauthorized - Invalid or missing |
| 404 | Not Found - Device with specified parent_id does not exist |
| 422 | Unprocessable Entity - Variable validation failed |
| 500 | Internal Server Error - |
Common Use Cases
Use Case 1: Configuration Compliance Check
Query all device parameters to verify compliance with organizational standards, checking for pending changes and validating current configurations against policy requirements.
# Get all variables with pending status and extra details
curl -X GET "https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123&pending=true&extra=true&dates=true" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Use Case 2:Device Network Parameter Updates
Update critical network parameters like hostnames, management IPs, and VLAN configurations as part of network reorganization or device migration.
# Update hostname and management IP for device relocation
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 '{"variables":[{"variable_name":"hostname","value":"sw-new-location"},{"variable_name":"management_ip","value":"10.1.1.50"}]}'
Use Case 3: Security Configuration Management
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 parametersvariables, likethen SNMPupdate communities,security modes, access control lists,controls, and authentication settings across devicemultiple 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 4:5: BulkCompliance Configuration DeploymentAuditing
StageRetrieve multipleall device variables with extra information and dates to generate compliance reports, track configuration changes forover scheduled deployment during maintenance windows, allowing for coordinated network-wide updates.
Use Case 5: Parameter Monitoringtime, and Alerting
ensure Monitordevices specificmeet deviceorganizational parameters for changes and compliance, integrating with monitoring systems to track configuration drift.standards.
Best Practices
parameter__variable_nameparameter__namePagination:Pagination: Always implement pagination whenfor queryinglarge devicesdevice withinventories extensive configuration parameters. Useusing limit and offset parameters to manageavoid largetimeouts resultand setsimprove efficiently.
pendingpending=true parameter force_update=true Error Handling:Handling: Implement robustproper error handling for validation failures (422)422 status) and deviceretry connectivitylogic issues.for Configurationtemporary updatesfailures
Security Considerations:Considerations: Be cautious when updating security-related parameters. Always verify that changes don't lock you out ofTreat device managementvariables access,as especiallysensitive whendata modifyingand IPensure addresses orproper authentication settings.
authorization for all requests
Batch