Inventory Device Operation
UpdateThe Inventory Device Operation API provides endpoints for managing operational changes and updates to devices within your inventory system. These endpoints handle deviceoperationstaterecordsmodifications,withconfigurationnew dataupdates, and operational statusinformation.changes, enabling real-time management of your device infrastructure.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Inventory Device Operation API category is designed for managing operational aspects of devices in your inventory system. This API enables you to update device configurations, modify operational states, change device assignments, and manage device lifecycle events.
Common use cases include:
This API works in conjunction with the broader inventory management system, allowing you to maintain real-time operational visibility and control over your device infrastructure. Operations performed through these endpoints typically trigger audit logs and may affect device monitoring and alerting systems.
Key concepts:
Endpoints
PUT /inventory_device_operation/{id}/
UpdateDescription: anUpdates existingoperational inventoryparameters and status for a specific device operationin record.the inventory. This endpoint allows you to modify operationdevice details,configurations, change operational status, update assignments, and associatedmanage metadatadevice forlifecycle states. Use this endpoint when you need to reflect real-world changes to device operations, maintenance status, or configuration parameters.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device_operation/123/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | Unique identifier of the |
| data | string | body | Yes | JSON |
ExamplecURL Request:Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_operation/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/jsonjson" Authorization:\
Bearer-d <your-api-token>
'{
"operation_type"operational_status": "maintenance",
"status": "completed",
"device_id": "DEV-001",
"operator_id": "OP-456",
"description": "Routine maintenance check performed",
"started_at": "2024-01-15T10:00:00Z",
"completed_at": "2024-01-15T11:30:00Z",
"notes": "All systems functioning normally",
"location": "WarehouseBuilding A - SectionFloor 3"2",
"assigned_user": "john.doe@company.com",
"maintenance_notes": "Scheduled firmware update completed",
"configuration": {
"network_profile": "production",
"monitoring_enabled": true,
"alert_level": "standard"
},
"next_maintenance": "2024-04-15T09:00:00Z"
}'
Example Response:
{
"id": 123,
"operation_type"device_name": "Network Switch - NS-001",
"serial_number": "NS001-ABC123",
"device_type": "network_switch",
"operational_status": "maintenance",
"status"location": "Building A - Floor 2",
"assigned_user": "john.doe@company.com",
"organization": "IT Infrastructure",
"configuration": {
"network_profile": "production",
"monitoring_enabled": true,
"alert_level": "standard",
"firmware_version": "2.1.4"
},
"maintenance_notes": "Scheduled firmware update completed",
"device_id"next_maintenance": "DEV-001"2024-04-15T09:00:00Z",
"operator_id": "OP-456",
"description": "Routine maintenance check performed",
"started_at"last_updated": "2024-01-15T10:00:15T14:30:00Z",
"completed_at"updated_by": "admin@company.com",
"operational_history": [
{
"timestamp": "2024-01-15T11:15T14:30:00Z",
"notes"action": "All systems functioning normally"status_change",
"location"from_status": "Warehouse A - Section 3"active",
"created_at"to_status": "2024-01-15T09:45:00Z"maintenance",
"updated_at"performed_by": "2024-01-15T11:30:15Z"admin@company.com"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - |
| 404 |
Common Use Cases
Use Case 1: Device Maintenance Workflow
When taking a device offline for maintenance, use the PUT endpoint to update the operational status to "maintenance", add maintenance notes, and schedule the next maintenance window. This ensures proper tracking of device availability and maintenance history.
Use Case 2: Device Relocation
When moving devices to new locations, update the location field and any associated configuration changes (such as network profiles or monitoring settings) that may be required for the new environment.
Use Case 3: User Assignment Changes
When employees change roles or leave the organization, use this endpoint to reassign devices to new users, update access permissions, and modify any user-specific configuration parameters.
Use Case 4: Configuration Management
After firmware updates or configuration changes, use this endpoint to record the new configuration state, update version information, and document any operational changes that result from the updates.
Use Case 5: Device Lifecycle Management
Track devices through their operational lifecycle by updating status from "active" to "maintenance" to "decommissioned", maintaining a complete audit trail of device operational history.
Best Practices
AlwaysvalidateValidate
operation status transitionsdata beforeupdatingsubmission:(e.g.,Ensuredon'tallchangerequiredfromfields"completed"arebackincluded and data types match the expected format to"in_progress"avoidwithoutvalidationpropererrors.justification)-
Use meaningful operational notes: Include
timestampsdetailed descriptions of changes, reasons foroperationupdates,lifecycleandeventsanytorelevantmaintaincontextaccuratethatauditwilltrailshelp with future maintenance and troubleshooting. Usedescriptive operation types and standardized status values for consistency
Implement proper error handling: Always check response status codes and handle different error scenarios appropriately, especially for 404 (device not found) and 403 (permission denied) responses.
Track operational history: The API maintains an operational history for audit purposes. Use this information to catchunderstand validationdevice errorslifecycle patterns and providemaintenance meaningfultrends.
Coordinate with monitoring systems: Status changes may affect monitoring and alerting systems. Ensure your operational procedures account for these dependencies.
Security considerations: Only update devices that your API token has permissions to usersmodify. Device operations may trigger security audits, so ensure all changes are properly authorized and documented.
Batch operations: For multiple device updates, consider implementing retry logic and rate limiting to avoid overwhelming the API while maintaining data consistency.