Skip to main content

Inventory Device Operation

The Inventory Device Operation API enables remote management and control of devices in your inventory through standardized operations. This endpoint allows you to trigger critical device operations like reboots, factory resets, configuration synchronization, and device reconfiguration remotely. It's essential for maintaining and troubleshooting devices at scale across your 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 provides a unified interface for performing remote operations on devices within your inventory management system. This API is designed for system administrators and DevOps teams who need to manage devices remotely without physical access.

Key Capabilities:

  • Remote Device Control: Execute critical operations like reboots and factory resets without physical access
  • Configuration Management: Synchronize device configurations and trigger reconfiguration processes
  • Operational Efficiency: Streamline device maintenance workflows and reduce manual intervention
  • Standardized Operations: Use consistent operation codes across different device types and models

Common Scenarios:

  • Troubleshooting unresponsive devices by triggering remote reboots
  • Preparing devices for redeployment through factory resets
  • Ensuring device configurations are up-to-date across your infrastructure
  • Performing bulk operations on multiple devices for maintenance windows

This API integrates seamlessly with inventory management workflows, allowing you to perform operations directly on devices identified by their inventory IDs. All operations are asynchronous and provide status tracking for monitoring completion.


Endpoints

PUT /inventory_device_operation/{id}/

Description: Executes a specified operation on a device in your inventory. This endpoint allows you to trigger various remote operations including reboots, factory resets, configuration synchronization, and device reconfiguration. The operation is performed asynchronously, and the device's operational status will be updated accordingly.

Use Cases:

  • Remotely reboot an unresponsive device to restore connectivity
  • Perform factory reset before reassigning a device to a different location
  • Synchronize device configuration after updating policies or settings
  • Trigger device reconfiguration after network or security changes

Full URL Example:

https://control.zequenze.com/api/v1/inventory_device_operation/12345/

Parameters:

Parameter Type In Required Description
id integer path Yes The unique identifier of the device in the inventory system
data string body Yes JSON payload containing the operation to perform on the device

Request Body Schema:

Field Type Required Description Allowed Values
operation string Yes Operation to perform on the device reboot, factory, device_factory, sync, reconf

Operation Types:

  • reboot - Performs a standard device reboot
  • factory - Executes a factory reset operation
  • device_factory - Performs a device-specific factory reset
  • sync - Synchronizes device configuration with current policies
  • reconf - Triggers a complete device reconfiguration

cURL Example:

curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_operation/12345/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "reboot"
  }'

Example Request Body:

{
  "operation": "sync"
}

Example Response:

{
  "id": 12345,
  "operation": "sync",
  "status": "initiated",
  "device_id": 12345,
  "device_name": "Network Switch - Floor 3",
  "device_serial": "NS-2024-001-F3",
  "operation_timestamp": "2024-01-15T14:30:22Z",
  "estimated_completion": "2024-01-15T14:35:22Z",
  "initiated_by": "admin@company.com"
}

Response Codes:

Status Description
200 Success - Operation has been initiated successfully
400 Bad Request - Invalid operation type or malformed request
401 Unauthorized - Invalid or missing authentication token
404 Not Found - Device with specified ID does not exist
409 Conflict - Device is currently busy with another operation
500 Internal Server Error - Operation could not be initiated

Common Use Cases

Use Case 1: Emergency Device Reboot

When a network device becomes unresponsive but is still reachable via the management interface, use the reboot operation to restore normal functionality without requiring physical access.

Endpoint: PUT /inventory_device_operation/{id}/ with operation reboot

Use Case 2: Device Preparation for Redeployment

Before moving a device to a new location or reassigning it to a different purpose, perform a factory reset to ensure clean deployment and remove any previous configuration data.

Endpoint: PUT /inventory_device_operation/{id}/ with operation factory

Use Case 3: Configuration Synchronization After Policy Updates

After updating security policies or network configurations centrally, trigger a sync operation across affected devices to ensure all devices reflect the latest configuration state.

Endpoint: PUT /inventory_device_operation/{id}/ with operation sync

Use Case 4: Network Infrastructure Maintenance

During scheduled maintenance windows, perform bulk reconfiguration operations to update device settings, apply firmware updates, or modify network parameters across multiple devices.

Endpoint: PUT /inventory_device_operation/{id}/ with operation reconf

Use Case 5: Troubleshooting Configuration Issues

When a device is experiencing configuration-related problems, use device-specific factory reset followed by reconfiguration to restore proper operation while maintaining device-specific settings.

Endpoint: PUT /inventory_device_operation/{id}/ with operation device_factory


Best Practices

  • Operation Timing: Schedule operations during maintenance windows to minimize service disruption, especially for factory resets and reconfiguration operations
  • Status Monitoring: Implement polling mechanisms to monitor operation completion status, as all operations are performed asynchronously
  • Error Handling: Always check for HTTP 409 (Conflict) responses which indicate the device is busy with another operation before retrying
  • Operation Sequencing: When performing multiple operations on the same device, wait for each operation to complete before initiating the next one
  • Backup Considerations: Ensure device configurations are backed up before performing factory reset operations, as these actions are irreversible
  • Batch Operations: For large-scale operations across multiple devices, implement rate limiting and consider the impact on network infrastructure
  • Logging and Auditing: Maintain detailed logs of all operations performed, including timestamps and operator information for compliance and troubleshooting purposes
  • Validation: Verify device connectivity and operational status before attempting operations to avoid unnecessary failures