Skip to main content

Inventory Device Name Headless Operation

ManageThe Inventory Device Name Headless Operation API provides endpoints for managing and monitoring automated device operations that run without direct user interface interaction. These endpoints allow you to retrieve information about scheduled device operations and create new headless device operations for inventory devices,management including listing scheduled transactions and creating new operations.workflows.

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 Headless Operation API is designed for automated device management scenarios where operations need to run independently without user intervention. This API category is particularly useful for:

    Automated Inventory Updates: Running scheduled operations to sync device information, update statuses, and maintain inventory accuracy Background Device Monitoring: Executing headless operations that continuously monitor device health, connectivity, and performance metrics Batch Processing: Creating and managing bulk operations that process multiple devices without requiring manual oversight Integration Workflows: Enabling third-party systems to trigger and monitor device operations programmatically

    These endpoints work together to provide complete lifecycle management of headless operations - from creation and scheduling to monitoring and status updates. The API supports both real-time status updates and background processing, making it ideal for enterprise-scale device management scenarios.

    Key concepts to understand:

      Headless Operations: Automated tasks that run without user interface interaction Scheduled Transactions: Time-based operations that execute according to predefined schedules Status Updates: Real-time synchronization of device states using configured helpers Operation Lifecycle: The complete process from operation creation to completion and monitoring

      Endpoints

      GET /inventory_device_name_headless_operation/

      RetrieveDescription: Retrieves a list of scheduled headless operations for inventory devices. OptionallyThis endpoint allows you to monitor the status of automated operations, filter by specific transaction IDs, and optionally trigger real-time status updates using configured helpers before returning the data.

      Use Cases:

        Monitor the progress and status of scheduled device inventory operations Retrieve specific operation details using transaction ID andfiltering updateGet real-time device status updates before returningprocessing results.operation results Generate reports on completed and pending headless operations

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_device_name_headless_operation/?id=txn_12345&update_status=true
        

        Parameters:

        Parameter Type In Required Description
        id string query No ID of the scheduled transaction to filter byresults. Use this to retrieve specific operation details
        update_status boolean query No UseWhen set to true, triggers configured helpers to update device status before returning information
        information, ensuring real-time limit integer query No Number of results to return per page (default: 100) offset integer query No The initial index from which to return resultsaccuracy

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device_name_headless_operation/?id=txn_123&update_status=truetrue" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 2,15,
          "next": null,"https://control.zequenze.com/api/v1/inventory_device_name_headless_operation/?limit=10&offset=10",
          "previous": null,
          "results": [
            {
              "id": "txn_123"txn_12345",
              "device_name": "server-01"WS-001-LAB-PC",
              "operation_type": "reboot"inventory_sync",
              "status": "pending"running",
              "scheduled_at": "2024-01-15T10:30:00Z",
              "created_at"started_at": "2024-01-15T09:15:00Z"15T10:30:15Z",
              "parameters"progress": 75,
              "device_details": {
                "force"serial_number": false,"SN123456789",
                "timeout"model": 300"OptiPlex 7090",
                "manufacturer": "Dell",
                "location": "Building A, Floor 2",
                "last_seen": "2024-01-15T10:45:30Z"
              },
              "operation_details": {
                "total_tasks": 8,
                "completed_tasks": 6,
                "current_task": "updating_software_inventory"
              }
            },
            {
              "id": "txn_124"txn_12346",
              "device_name": "workstation-05"SRV-002-DB-01",
              "operation_type": "update"health_check",
              "status": "completed",
              "scheduled_at": "2024-01-15T08:15T09:00:00Z",
              "created_at"started_at": "2024-01-15T07:45:00Z"15T09:00:05Z",
              "parameters"completed_at": "2024-01-15T09:15:22Z",
              "progress": 100,
              "device_details": {
                "package_list"serial_number": ["security-updates"]SN987654321",
                "model": "PowerEdge R740",
                "manufacturer": "Dell",
                "location": "Data Center Rack 15",
                "last_seen": "2024-01-15T09:15:22Z"
              },
              "result": {
                "status": "healthy",
                "checks_passed": 12,
                "checks_failed": 0,
                "warnings": 1
              }
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 Success - Returns list of headless operations with current status
        401 Unauthorized - Invalid or missing BearerAPI token
        403 Forbidden - Insufficient permissions to access operation data
        500 Internal Server Error - Error updating device status or retrieving operations

        POST /inventory_device_name_headless_operation/

        CreateDescription: Creates a new headless operation for an inventory device.device management. This endpoint schedulesallows operationsyou to beschedule executedautomated ontasks devicessuch as inventory synchronization, device health checks, or batch updates that will run without user interaction.intervention. The operation data should be provided in the request body.

        Use Cases:

          Schedule automated inventory synchronization for specific devices or device groups Create background health monitoring operations for critical infrastructure Initiate bulk device updates during maintenance windows Set up recurring device compliance checks and reporting

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_device_name_headless_operation/
          

          Parameters:

          Parameter Type In Required Description
          data string body Yes JSON string containing the operation detailsconfiguration including device targets, operation type, schedule, and parameters

          ExamplecURL Request:Example:

          curl -X POST "https://control.zequenze.com/api/v1/inventory_device_name_headless_operation/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
            "device_name": "server-02",
              "operation_type": "restart_service"inventory_sync",
              "scheduled_at"device_targets": ["WS-001-LAB-PC", "WS-002-LAB-PC"],
              "schedule": {
                "type": "2024-01-15T14:00:00Z"immediate"
              },
              "parameters": {
                "service_name"sync_software": true,
                "sync_hardware": true,
                "update_location": false,
                "timeout_minutes": 30
              },
              "notification": {
                "on_completion": true,
                "on_failure": true,
                "email": "nginx"admin@company.com"
              }
            }'
          

          Example Request Body:

          {
            "operation_type": "health_check",
            "verify_status"device_targets": true["SRV-001-DB-01", "SRV-002-DB-01"],
            "schedule": {
              "type": "recurring",
              "cron": "0 2 * * 1",
              "timezone": "UTC"
            },
            "parameters": {
              "check_disk_space": true,
              "check_memory_usage": true,
              "check_network_connectivity": true,
              "check_running_services": true,
              "disk_threshold_percent": 85,
              "memory_threshold_percent": 90,
              "timeout_minutes": 15
            },
            "notification": {
              "on_completion": false,
              "on_failure": true,
              "webhook_url": "https://monitoring.company.com/webhook/device-alerts"
            },
            "retry_policy": {
              "max_attempts": 3,
              "retry_delay_minutes": 5
            }
          }
          

          Example Response:

          {
            "id": "txn_125",
            "device_name": "server-02",
            "operation_type": "restart_service"txn_12347",
            "status": "scheduled",
            "scheduled_at"operation_type": "2024-01-15T14:00:00Z"health_check",
            "device_targets": ["SRV-001-DB-01", "SRV-002-DB-01"],
            "created_at": "2024-01-15T13:45:15T11:20:00Z",
            "scheduled_for": "2024-01-22T02:00:00Z",
            "estimated_duration_minutes": 30,
            "parameters": {
              "service_name"check_disk_space": "nginx",true,
              "verify_status"check_memory_usage": truetrue,
              "check_network_connectivity": true,
              "check_running_services": true,
              "disk_threshold_percent": 85,
              "memory_threshold_percent": 90,
              "timeout_minutes": 15
            },
            "estimated_duration"schedule": 120{
              "type": "recurring",
              "cron": "0 2 * * 1",
              "timezone": "UTC",
              "next_execution": "2024-01-22T02:00:00Z"
            },
            "monitoring_url": "https://control.zequenze.com/api/v1/inventory_device_name_headless_operation/?id=txn_12347"
          }
          

          Response Codes:

          Status Description
          201 Created - OperationHeadless operation successfully scheduled
          400 Bad Request - Invalid operation data format or missing required fieldsparameters
          401 Unauthorized - Invalid or missing BearerAPI token
          403 Forbidden - Insufficient permissions to create operations for specified devices
          404422 NotUnprocessable FoundEntity - DeviceValid nameJSON notbut foundinvalid inoperation inventoryconfiguration
          500 Internal Server Error - Error scheduling the operation

          Common Use Cases

          Use Case 1: Automated Nightly Inventory Sync

          Schedule recurring operations to synchronize device inventory information every night, ensuring accurate asset tracking and compliance reporting. Use POST to create the recurring operation and GET to monitor daily execution status.

          Use Case 2: Real-time Operation Monitoring Dashboard

          Build a dashboard that polls the GET endpoint with update_status=true to display real-time progress of running operations, allowing IT teams to monitor automation workflows and quickly identify issues.

          Use Case 3: Maintenance Window Automation

          Create batch operations during scheduled maintenance windows to update device configurations, install software, or perform health checks across multiple devices simultaneously without manual intervention.

          Use Case 4: Compliance and Audit Reporting

          Set up weekly headless operations to collect device compliance data, security status, and configuration drift information, automatically generating reports for audit and governance purposes.

          Use Case 5: Proactive Device Health Monitoring

          Implement continuous monitoring by creating recurring health check operations that automatically detect device issues, performance degradation, or connectivity problems before they impact business operations.


          Best Practices

          • Operation Scheduling Operations: AlwaysUse scheduleappropriate operationsscheduling duringstrategies - immediate execution for urgent tasks, recurring schedules for routine maintenance, and maintenance windows tofor minimizeresource-intensive serviceoperations.

            disruption
          • Status Monitoring: Use the update_status=true parameter when you need real-time device status information

          Error Handling: CheckAlways deviceimplement availabilityretry beforelogic schedulingand criticalmonitor operation status. Use the GET endpoint with specific transaction IDs to track individual operations and handle failures gracefully.

          TimeoutPerformance ConfigurationOptimization: When monitoring multiple operations, use pagination parameters and consider caching results. The update_status parameter should be used judiciously as it triggers real-time device communication.

          Security Considerations: Ensure API tokens have appropriate scope limitations. Store operation configurations securely and avoid exposing sensitive device credentials in operation parameters.

          Resource Management: Set appropriate timeout values infor parametersoperations basedand onlimit operationconcurrent complexityexecutions to prevent overwhelming target devices. Monitor system resources during bulk operations.

          BatchNotification OperationsStrategy: ForConfigure multiplenotifications devices,for makeoperation separatefailures APIbut callsconsider ratherusing thanwebhooks batchinginstead inof aemail singlefor request

          high-frequency Status Polling: After creating an operation, poll the GET endpointoperations to monitoravoid executionspam progressand improve integration with monitoring systems.