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:
@@ -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
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user