Skip to main content

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 device operationstate recordsmodifications, withconfiguration new dataupdates, and operational status information.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:

    Updating device operational status (active, maintenance, decommissioned) Modifying device configuration parameters Changing device assignments to different locations or users Updating device metadata and operational properties Managing device maintenance schedules and operational notes

    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:

      Device Operations: Structured updates that modify device state or configuration Operational Status: Current state of device availability and functionality Device Assignments: Location, user, or organizational unit associations Configuration Updates: Changes to device-specific operational parameters

      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:

        Updating a specificdevice from "active" to "maintenance" status during scheduled downtime Changing device operation.location assignments when equipment is moved Modifying device configuration parameters after firmware updates Recording operational notes and maintenance information Updating device user assignments and access permissions

        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 inventory device operationto update
        data string body Yes JSON datapayload containing the operationoperational detailsupdates to updateapply to the device

        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 OperationSuccess - Device operation updated successfully
        400 Bad Request - Invalid request data format or malformedmissing JSONrequired fields
        401 Unauthorized - invalidInvalid or missing API token
        404 OperationNot Found - Device with specified ID does not foundexist
        403 Forbidden - Insufficient permissions to modify this device 422 ValidationUnprocessable errorEntity - checkValidation requirederrors fieldsin the request data

        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

        • Always validate

          Validate operation status transitionsdata before updatingsubmission: (e.g.,Ensure don'tall changerequired fromfields "completed"are backincluded and data types match the expected format to "in_progress"avoid withoutvalidation propererrors.

          justification)
        • Use meaningful operational notes: Include timestampsdetailed descriptions of changes, reasons for operationupdates, lifecycleand eventsany torelevant maintaincontext accuratethat auditwill trailshelp with future maintenance and troubleshooting.

        • Use descriptive operation types and standardized status values for consistency
        Ensure device_id references exist in your inventory system before creating operations Consider implementing optimistic locking for concurrent operation updates Store detailed notes for maintenance operations to support compliance and troubleshooting Use

        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.

        feedback

        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.