Skip to main content

Inventory Device Name Setting

Manage device configuration settings for inventory items by device name.

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_setting/

Retrieve a list of device configuration settings filtered by device name and various parameter criteria.

Parameters:

Parameter Type In Required Description
parent__name string query Yes Parent device name
parameter_id string query No Filter by parameter ID
parameter__variable_name string query No Filter by parameter variable name
parameter__name string query No Filter by parameter name
parameter__short_name string query No Filter by parameter short name
limit integer query No Number of results to return per page
offset integer query No Initial index from which to return results
pending boolean query No Filter by pending status

Example Request:

GET /api/v1/inventory_device_name_setting/?parent__name=router-001&parameter__name=hostname&limit=20

Example Response:

{
  "count": 15,
  "next": "https://control.zequenze.com/api/v1/inventory_device_name_setting/?limit=20&offset=20",
  "previous": null,
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "parameter_id": "param_001",
      "parameter": {
        "variable_name": "hostname",
        "name": "Device Hostname",
        "short_name": "hostname"
      },
      "value": "router-001.example.com",
      "pending": false,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ]
}
Status Description
200 Settings retrieved successfully
400 Bad request - missing required parent__name parameter
401 Unauthorized
404 Device not found

PUT /inventory_device_name_setting/{parent__name}/

Update all device settings for a specific device, replacing existing configuration.

Parameters:

Parameter Type In Required Description
parent__name string path Yes Parent device name
data object body Yes Complete device settings data

Example Request:

PUT /api/v1/inventory_device_name_setting/router-001/
Content-Type: application/json

{
  "settings": [
    {
      "parameter_id": "param_001",
      "value": "router-001.newdomain.com"
    },
    {
      "parameter_id": "param_002", 
      "value": "192.168.1.1"
    }
  ]
}

Example Response:

{
  "message": "Device settings updated successfully",
  "updated_count": 2,
  "settings": [
    {
      "parameter_id": "param_001",
      "value": "router-001.newdomain.com",
      "pending": true
    },
    {
      "parameter_id": "param_002",
      "value": "192.168.1.1", 
      "pending": true
    }
  ]
}
Status Description
200 Settings updated successfully
400 Bad request - invalid data format
401 Unauthorized
404 Device not found

PATCH /inventory_device_name_setting/{parent__name}/

Partially update specific device settings without affecting other configuration parameters.

Parameters:

Parameter Type In Required Description
parent__name string path Yes Parent device name
data object body Yes Partial device settings data

Example Request:

PATCH /api/v1/inventory_device_name_setting/router-001/
Content-Type: application/json

{
  "settings": [
    {
      "parameter_id": "param_001",
      "value": "router-001.updated.com"
    }
  ]
}

Example Response:

{
  "message": "Device settings partially updated",
  "updated_count": 1,
  "settings": [
    {
      "parameter_id": "param_001",
      "value": "router-001.updated.com",
      "pending": true,
      "updated_at": "2024-01-15T14:25:00Z"
    }
  ]
}
Status Description
200 Settings partially updated successfully
400 Bad request - invalid data format
401 Unauthorized
404 Device not found

Best Practices

  • Use specific device names: Always provide the exact device name in the parent__name parameter to avoid conflicts
  • Batch updates efficiently: Use PUT for complete setting replacements and PATCH for selective updates
  • Monitor pending status: Check the pending field to track configuration changes that haven't been applied yet
  • Implement pagination: Use limit and offset parameters for large device inventories to improve performance
  • Filter strategically: Combine parameter filters to reduce response size and improve query performance
  • Handle errors gracefully: Always check for 404 responses when working with device names that may not exist
  • Cache results appropriately: Device settings typically change infrequently, making them suitable for caching