Skip to main content

Inventory Device Name Operation

UpdateThe inventory device namesname inoperation endpoint allows you to update device information by referencing the inventorydevice's system.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}/

    UpdateDescription: theUpdates namean of a specificexisting device record in the inventory system.system using the device name as the identifier. This endpoint allows you to modify device identificationattributes 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 whilefrom maintainingexternal deviceasset associationsmanagement andsystems configuration.

      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 CurrentThe unique name of the device to beupdate. updatedMust match exactly with the device name in the inventory system
      data string body Yes JSON string containing the newdevice fields to update. Can include status, location, metadata, configuration settings, or other device name and related informationattributes

      ExamplecURL Request:Example:

      curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_name_operation/device-001/server-web-01/" \
        -H "Authorization: Bearer YOUR_API_TOKEN" \
        -H "Content-Type: application/jsonjson" Authorization:\
        Bearer-d your-api-token'{
          "status": "maintenance",
          "location": "Data Center B - Rack 15",
          "last_maintenance": "2024-01-15T14:30:00Z",
          "notes": "Scheduled maintenance completed",
          "configuration": {
            "name"cpu_cores": 16,
            "memory_gb": 64,
            "storage_type": "device-001-updated",
        "display_name": "Updated Device 001",
        "description": "Production device with updated naming convention"SSD"
          }
        }'
      

      Example Response:

      {
        "success": true,
        "message": "Device name updated successfully",
        "device": {
          "id": "12345",1247,
        "name": "device-001-updated"server-web-01",
        "display_name"status": "Updated Device 001"maintenance",
        "description"device_type": "Productionserver",
        device"serial_number": with"SRV2024-001247",
        updated"location": naming"Data convention"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-15T10:30:00Z"15T14:35:22Z",
        }"is_active": true
      }
      

      Response Codes:

      Status Description
      200 Success - Device name updated successfullysuccessfully, returns the complete updated device record
      400 Bad Request - Invalid requestJSON data or malformedmissing JSONrequired fields
      401 Unauthorized - invalidInvalid or missing BearerAPI token
      404 Not Found - Device with the specified name does not foundexist
      409422 ConflictUnprocessable Entity - newValid deviceJSON namebut alreadyinvalid existsfield 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 namingDevice Names: Ensure the new device namenames isare unique withinacross 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 NamingPartial conventionsUpdates: FollowOnly consistentinclude namingfields patternsthat forneed easierto devicebe managementchanged in the request body - the API supports partial updates ValidationRate Limiting: TheFor databulk parameteroperations, shouldimplement containappropriate validdelays JSONbetween withrequests requiredto fieldsavoid overwhelming the API Error handlingLogging: AlwaysLog checkboth successful updates and errors for 409audit statustrails codesand when updating to names that might already existtroubleshooting Data Backup references: UpdateConsider anybacking externalup references or documentation that use the oldcurrent device namestate before Atomicmaking operations:significant Devicechanges, nameespecially updatesin areautomated atomic - partial updates will not be applied if validation failsworkflows