Skip to main content

Inventory Device Variables

The Inventory Device Variables API provides accesscomplete tocontrol over device configuration parameters and settings variables for network devices.variables. These endpoints allow you to retrieve and update device-specific variables that control device behavior, configuration values, monitor pending changes,settings, and manageoperational parameterparameters settings acrosswithin your deviceinventory inventory.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:

    ChangeDevice Tracking:Configuration Management: MonitorCentrally pendingmanage configurationdevice changes before they are applied to devices, allowing for validationsettings and approvalparameters workflows.

    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

    through structuredConfiguration APIMonitoring: calls.Track pending changes and variable states Dynamic Device Behavior: Modify device behavior without physical access Compliance and Standards: Ensure devices meet organizational requirements

    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
    Monitor pending configuration changes before applying updatesthem Query specific parameters by variable name or parameter name MonitorAudit device configuration statusconfigurations and compliance status Export device settings for backup or migration purposes

    Full URL Example:

    https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123&parameter__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 retrievefilter settings by. This identifies which device's variables forto retrieve
    parameter__variable_name string query No Comma-separated list of specific variable names to retrieve (e.g., "hostname,ip_address,vlan_id"network_ip,device_port,timeout_value")
    parameter__name string query No Comma-separated list of parameter display names to filter byretrieve
    parameter__short_name string query No Comma-separated list of parameter short names tofor filterquick byidentification
    limit integer query No Number of results to return per page for pagination (default:default 20,varies max:by 100)system configuration)
    offset integer query No Starting index for pagination (default: 0)results
    pending boolean query No Include pending change information aboutto pendingshow changesvariables awaitingwith deploymentuncommitted updates
    wildcard boolean query No AllowEnable wildcard (*) characterscharacter matching in variable_name orand parameter_nameparameter name fields
    force_update boolean query No Force refresh device settings from the actual device before returning dataresults
    extra boolean query No Include additional parameter metadata and detailsextended information about each parameter
    dates boolean query No Include creationcreation, modification, and modificationlast timestampssync date information

    cURL Example:

    curl -X GET "https://control.zequenze.com/api/v1/inventory_device_variables/?parent_id=123&parameter__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 andwith parameterspagination
    400 Bad Request - Invalid parameters or missingMissing required parent_id or invalid parameters
    401 Unauthorized - Invalid or missing authenticationAPI token
    404 Not Found - Device with specified parent_id does not exist
    500 Internal Server Error - UnableSystem toerror retrieveduring devicevariable variablesretrieval

    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
    (hostname,Modify IPoperational addresses,thresholds VLANs)and limits Change security settings and access controls Apply configuration templates to devices Implement bulk configuration changes to aacross device Stage configuration changes for later deployment Modify device-specific operational settingsfleets

    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 payloadstring containing parametervariable updates with variable names and new values

    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 datanames or validationvalues errorsin request data
    401 Unauthorized - Invalid or missing authenticationAPI token
    404 Not Found - Device with specified parent_id does not exist
    422 Unprocessable Entity - Variable validation failed
    500 Internal Server Error - UnableSystem toerror during update device variables

    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 Filtering: Use specific parameter filters (parameter__variable_name, parameter__name) to reduce response size and improve performance when working with devices that have many configuration parameters.

      Pagination:Pagination: Always implement pagination whenfor queryinglarge devicesdevice withinventories extensive configuration parameters. Useusing limit and offset parameters to manageavoid largetimeouts resultand setsimprove efficiently.

      performance

      ChangeFilter Management:Strategically: LeverageUse specific variable name filters rather than retrieving all variables when you only need specific parameters Monitor Pending Changes: Regularly check for pending changes using the pendingpending=true parameter to review configuration changes before deployment.applying Thiscritical allowsupdates for approvalForce workflowsUpdates and change validation processes. Forced Updates:Sparingly: Use force_update=true sparinglyonly when real-time accuracy is essential, as it triggersimpacts real-timeperformance device polling.Validate ReserveBefore thisUpdate: forAlways criticalretrieve situationscurrent wherevariable values before updating to ensure you needunderstand the most current devicestate state.

      Error Handling:Handling: Implement robustproper error handling for validation failures (422)422 status) and deviceretry connectivitylogic issues.for Configurationtemporary updatesfailures

      may fail due to device-specific constraints or network connectivity problems.

      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.

      and

      authorization for all requests

      Batch Operations:Updates: Group related parametervariable updates intoin single APIPUT requests rather than making multiple individual calls to maintain configuration consistency and reduce the number of device interactions required.