Refactor vCenter snapshot handling and VM operations

- Introduced a new method `resolveVCenterFromProduct` in `SnapshotService` to streamline vCenter resolution from product data.
- Updated `CreateSnapshot`, `RemoveSnapshot`, and `RevertSnapshot` jobs to utilize the new vCenter resolution method.
- Enhanced the `VmController` to support UUID-based service identification for VM operations.
- Added new actions for changing VM IP and RDP port, encapsulating the logic for these operations.
- Improved error handling and logging for VM operations, including detailed responses for API consumers.
- Removed unnecessary relationships in model queries to optimize performance.
This commit is contained in:
pbao9
2026-04-15 23:38:38 +07:00
parent 64a9d603e2
commit bb73d6c5a2
14 changed files with 987 additions and 120 deletions
+6
View File
@@ -61,6 +61,12 @@ class Service extends Model
return $this->hasMany(ServiceAddon::class, 'service_id');
}
/** The VPS/VM associated with this service (if applicable). */
public function vmware()
{
return $this->belongsTo(ModuleVmware::class, 'vm_id', 'vmware_id');
}
// -------------------------------------------------------------------------
// Helpers
// -------------------------------------------------------------------------