Inventory Device Name Operation
The inventory device name operation endpoint allows you to update device information by referencing the device's name. This is particularly useful for batch operations or when you need to modify device data without knowing the specific device ID.
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 Operation API provides functionality to update device records in your inventory management system using the device name as the identifier. This approach is especially valuable in scenarios where device names are unique and well-known identifiers within your organization, eliminating the need to first retrieve device IDs.
This endpoint is commonly used for:
- Bulk device updates where device names are the primary reference
- Integration with external systems that track devices by name
- Automated inventory management workflows
- Device configuration updates based on naming conventions
The API follows RESTful principles and accepts JSON-formatted data for device updates. All operations require proper authentication and return detailed response information to help with error handling and confirmation of successful updates.
Endpoints
PUT /inventory_device_name_operation/{name}/
Description: Updates an existing device record in the inventory system using the device name as the identifier. This endpoint allows you to modify device attributes such as status, location, configuration, or metadata without needing to know the device's internal ID.
Use Cases:
- Update device status after maintenance operations
- Modify device location when equipment is moved
- Bulk update device configurations based on naming patterns
- Synchronize device information from external asset management systems
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_name_operation/server-web-01/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| name | string | path | Yes | The unique name of the device to update. Must match exactly with the device name in the inventory system |
| data | string | body | Yes | JSON string containing the device fields to update. Can include status, location, metadata, configuration settings, or other device attributes |
cURL Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_name_operation/server-web-01/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "maintenance",
"location": "Data Center B - Rack 15",
"last_maintenance": "2024-01-15T14:30:00Z",
"notes": "Scheduled maintenance completed",
"configuration": {
"cpu_cores": 16,
"memory_gb": 64,
"storage_type": "SSD"
}
}'
Example Response:
{
"id": 1247,
"name": "server-web-01",
"status": "maintenance",
"device_type": "server",
"serial_number": "SRV2024-001247",
"location": "Data Center B - Rack 15",
"organization": "IT Department",
"last_maintenance": "2024-01-15T14:30:00Z",
"notes": "Scheduled maintenance completed",
"configuration": {
"cpu_cores": 16,
"memory_gb": 64,
"storage_type": "SSD",
"network_ports": 4
},
"created_at": "2023-08-10T09:15:00Z",
"updated_at": "2024-01-15T14:35:22Z",
"is_active": true
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Device updated successfully, returns the complete updated device record |
| 400 | Bad Request - Invalid JSON data or missing required fields |
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Not Found - Device with the specified name does not exist |
| 422 | Unprocessable Entity - Valid JSON but invalid field values or constraints |
Common Use Cases
Use Case 1: Scheduled Maintenance Updates
When performing routine maintenance on devices, use this endpoint to update the device status and maintenance records. This helps track maintenance history and current device availability.
Use Case 2: Location Tracking
As devices are moved between locations (data centers, offices, storage facilities), update their location information to maintain accurate inventory records for asset management and support purposes.
Use Case 3: Configuration Management
After hardware upgrades or configuration changes, update the device specifications to reflect current capabilities. This is essential for capacity planning and resource allocation.
Use Case 4: External System Integration
Synchronize device information between your inventory management system and external tools like monitoring systems, CMDB platforms, or asset management solutions that reference devices by name.
Use Case 5: Batch Processing
Process multiple device updates in automated workflows where device names follow predictable patterns, enabling efficient bulk operations for large-scale infrastructure management.
Best Practices
- Unique Device Names: Ensure device names are unique across your inventory to prevent accidental updates to wrong devices
- Validate Data: Always validate JSON data structure before sending requests to avoid 400/422 errors
- Error Handling: Implement robust error handling for 404 responses when device names don't exist in the system
- Partial Updates: Only include fields that need to be changed in the request body - the API supports partial updates
- Rate Limiting: For bulk operations, implement appropriate delays between requests to avoid overwhelming the API
- Logging: Log both successful updates and errors for audit trails and troubleshooting
- Data Backup: Consider backing up current device state before making significant changes, especially in automated workflows