Skip to main content

Inventory Device Setting

ManageThe Inventory Device Setting API provides endpoints for managing configuration parameters and settings for devices within your inventory system. These endpoints allow you to retrieve, update, and modify device-specific settings such as operational parameters, configuration settingsvalues, and parameterscustom forproperties inventorythat items.control device behavior and functionality.

Base URL: https://control.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Device Setting API enables you to manage configuration parameters for devices in your inventory system. Device settings are parameter-value pairs that define how individual devices should operate, including network configurations, operational thresholds, feature toggles, and custom properties.

Key Concepts:

    Parent ID: References the specific device these settings belong to Parameters: Predefined configuration options with variable names, display names, and short names Settings: The actual values assigned to parameters for specific devices Pending Status: Indicates whether setting changes are waiting to be applied to the device

    Common Use Cases:

      Configuring network settings for newly deployed devices Updating operational parameters across multiple devices Managing feature flags and custom properties Bulk configuration management for device fleets Tracking pending configuration changes before deployment

      These endpoints work together to provide a complete configuration management system where you can list current settings, and update them as needed for operational requirements.


      Endpoints

      GET /inventory_device_setting/

      RetrieveDescription: Retrieves a paginated list of device settings filteredbased on various filter criteria. This endpoint is essential for viewing current device configurations, finding settings by variousparameter parameters.names, and checking for pending changes across your device inventory.

      Use Cases:

        View all configuration settings for a specific device Find devices with specific parameter configurations Monitor pending configuration changes across your fleet Audit device configurations for compliance

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_device_setting/?parent_id=123&parameter__variable_name=network_timeout&pending=false
        

        Parameters:

        Parameter Type In Required Description
        parent_id integer query Yes FilterThe settingdevice byID 'parentto ID'filter fieldsettings for. Required to specify which device's settings to retrieve
        parameter_id string query No Filter by specific parameter ID
        parameter__variable_name string query No Filter setting by 'parameterparameter's variable_name'variable fieldname (e.g., "network_timeout", "max_connections")
        parameter__name string query No Filter setting by 'parameterparameter's name'display fieldname
        parameter__short_name string query No Filter setting by 'parameterparameter's short-name'abbreviated field
        pending boolean query No Report if setting is pendingname limit integer query No Number of results to return per page (default: 20, max: 100) offset integer query No TheStarting initialposition indexfor frompagination which toreturnpending theboolean resultsquery No Filter for settings awaiting deployment (true) or applied settings (false)

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device_setting/?parent_id=123&parameter__name=temperature&limit=1010" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 25,
          "next": "https://control.zequenze.com/api/v1/inventory_device_setting/?parent_id=123&limit=10&offset=10",
          "previous": null,
          "results": [
            {
              "id": 1,
              "parent_id": 123,
              "parameter": {
                "id": "temp_001"net_timeout",
                "variable_name": "device_temperature"network_timeout",
                "name": "TemperatureNetwork Setting"Timeout",
                "short_name": "temp"Net TO"
              },
              "value": "25.5"30",
              "pending": false,
              "last_updated"created_at": "2024-01-15T10:30:00Z",
              "updated_at": "2024-01-20T14:25:00Z"
            },
            {
              "id": 2,
              "parent_id": 123,
              "parameter": {
                "id": "max_conn",
                "variable_name": "max_connections",
                "name": "Maximum Connections",
                "short_name": "Max Conn"
              },
              "value": "100",
              "pending": true,
              "created_at": "2024-01-15T10:30:00Z",
              "updated_at": "2024-01-22T09:15:00Z"
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 Success - Returns the filtered device settings
        400 Bad requestRequest - Invalid query parameters or missing required parent_id
        401 Unauthorized - Invalid or missing API token
        403 Forbidden - Insufficient permissions to view device settings

        PUT /inventory_device_setting/{parent_id}/

        UpdateDescription: Performs a complete update of device settings for the specified device. This endpoint replaces all existing settings for the device with the provided data set. Use this when you need to perform bulk configuration updates or reset a specificdevice's parentconfiguration device.entirely.

        Use Cases:

          Complete device reconfiguration during maintenance Applying standardized configuration templates to devices Resetting device settings to factory or baseline configurations Bulk updates when migrating device configurations

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_device_setting/123/
          

          Parameters:

          Parameter Type In Required Description
          parent_id integer path Yes The device ID ofwhose thesettings parentwill devicebe completely updated
          data string body Yes Complete JSON datapayload containing settingall updatesdevice settings to be applied

          ExamplecURL Request:Example:

          curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_setting/123/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
              "settings": [
                {
                  "parameter_id": "temp_001"network_timeout",
                  "value": "26.0"45"
                },
                {
                  "parameter_id": "humidity_001"max_connections",
                  "value": "45.5"150"
                },
                {
                  "parameter_id": "enable_logging",
                  "value": "true"
                }
              ]
            }'
          

          Example Response:

          {
            "success": true,
            "updated_count"message": 2,"Device settings updated successfully",
            "settings"updated_settings": [
              {
                "id": 1,
                "parameter_id"parent_id": 123,
                "parameter": {
                  "id": "temp_001"network_timeout",
                  "variable_name": "network_timeout",
                  "name": "Network Timeout"
                },
                "value": "26.0"45",
                "pending": true,
                "last_updated"updated_at": "2024-01-15T11:45:22T15:30:00Z"
              },
              {
                "id": 2,
                "parameter_id"parent_id": 123,
                "parameter": {
                  "id": "humidity_001"max_connections",
                  "variable_name": "max_connections", 
                  "name": "Maximum Connections"
                },
                "value": "45.5"150",
                "pending": true,
                "last_updated"updated_at": "2024-01-15T11:45:22T15:30:00Z"
              }
            ]
          }
          

          Response Codes:

          Status Description
          200 SettingsSuccess - All device settings updated successfully
          400 Bad Request - Invalid requestdata dataformat or parameter values
          401 Unauthorized - Invalid or missing API token
          403 Forbidden - Insufficient permissions to modify device settings 404 ParentNot deviceFound - Device with specified parent_id does not foundexist

          PATCH /inventory_device_setting/{parent_id}/

          PartiallyDescription: updatePerforms partial updates to specific device settings without affecting other existing settings. This endpoint allows you to modify individual parameters or small groups of settings while preserving all other current configurations. Ideal for atargeted parentconfiguration device.changes.

          Use Cases:

            Updating individual configuration parameters (e.g., changing timeout values) Fine-tuning specific device settings based on performance monitoring Applying security patches that require configuration changes Making incremental adjustments to operational parameters

            Full URL Example:

            https://control.zequenze.com/api/v1/inventory_device_setting/123/
            

            Parameters:

            Parameter Type In Required Description
            parent_id integer path Yes The device ID ofwhose thesettings parentwill devicebe partially updated
            data string body Yes JSON datapayload containing partialonly settingthe updatesspecific settings to be modified

            ExamplecURL Request:Example:

            curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device_setting/123/" \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/jsonjson" \
              -d '{
                "updates": [
                  {
                    "parameter_id": "temp_001"network_timeout",
                    "value": "27.2"60"
                  }
                ]
              }'
            

            Example Response:

            {
              "success": true,
              "message": "Device settings partially updated",
              "updated_settings": [
                {
                  "id": 1,
                  "parent_id": 123,
                  "parameter": {
                    "id": "temp_001"network_timeout",
                    "variable_name": "device_temperature"network_timeout",
                    "name": "TemperatureNetwork Setting"Timeout",
                    "short_name": "temp"Net TO"
                  },
                  "value": "27.2"60",
                  "previous_value": "45",
                  "pending": true,
                  "last_updated"updated_at": "2024-01-15T12:00:22T16:45:00Z"
                }
              ],
              "unchanged_settings_count": 24
            }
            

            Response Codes:

            Status Description
            200 SettingSuccess - Specified settings updated successfully
            400 Bad Request - Invalid requestparameter IDs or values in update data
            401 Unauthorized - Invalid or missing API token
            403 Forbidden - Insufficient permissions to modify device settings 404 ParentNot deviceFound - Device or settingspecified parameters do not foundexist

            Common Use Cases

            Use Case 1: Device Configuration Audit

            Retrieve all settings for multiple devices to ensure compliance with organizational standards. Use the GET endpoint with different parent_id values and compare configurations across your device fleet.

            Use Case 2: Bulk Configuration Deployment

            Apply standardized settings to new devices or update existing devices with new operational parameters. Use PUT for complete configuration replacement or PATCH for targeted updates.

            Use Case 3: Monitoring Pending Changes

            Track configuration changes that haven't been deployed to devices yet by filtering with pending=true. This helps manage deployment schedules and ensure changes are properly applied.

            Use Case 4: Parameter-Based Configuration Management

            Find all devices with specific parameter configurations using the parameter filter options, enabling targeted updates across devices with similar configurations.

            Use Case 5: Incremental Configuration Updates

            Use PATCH to make small, targeted changes to device settings without disrupting other configurations, ideal for performance tuning and gradual rollouts.


            Best Practices

            • Always specify parent_id: The parent_id parameter is required for GET requests and critical for identifying the parent_id when listingcorrect device settingsfor updates.

            Use pagination effectively: For devices with many settings, implement proper pagination using limit and offset to ensureavoid properperformance filteringissues.

            Use

            Monitor pending changes: Regularly check for pending settings using the pending parameterfilter to checkensure ifconfiguration settingschanges are awaitingproperly synchronizationdeployed.

            with physical devices

            Validate parameter names: Use the parameter filter options to verify parameter names and IDs before making updates to avoid configuration errors.

            Implement proper error handling: Always check response codes and handle 404 errors for cases where parentnon-existent devices don'tor existparameters gracefully.

            Use PATCH for incremental updates: When updatingmodifying multipleonly a few settings, preferuse PATCH instead of PUT overto multiplepreserve PATCHexisting requestsconfigurations forand betterreduce performancethe risk of accidental overwrites.

            Use parameter

            Batch filtersrelated (parameter__name,changes: parameter__variable_name)Group related configuration changes into single API calls when possible to findmaintain specificconfiguration setting types

            Consider pagination with limitconsistency and offsetreduce whenAPI dealingoverhead. with devices that have many settings Monitor the pending status after updates to ensure settings are properly applied to devices