[GH-ISSUE #5] [Feature] Change function to accept array #5

Closed
opened 2026-02-26 17:32:02 +03:00 by kerem · 3 comments
Owner

Originally created by @franklupo on GitHub (Oct 10, 2019).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-php/issues/5

Change function parameter accept array only parameter changed.

example

From

updateVm($acpi = null, $agent = null, $args = null, $autostart = null, $balloon = null, $bios = null, $boot = null, $bootdisk = null, $cdrom = null, $cores = null, $cpu = null, $cpulimit = null, $cpuunits = null, $delete = null, $description = null, $digest = null, $force = null, $freeze = null, $hostpciN = null, $hotplug = null, $hugepages = null, $ideN = null, $keyboard = null, $kvm = null, $localtime = null, $lock = null, $machine = null, $memory = null, $migrate_downtime = null, $migrate_speed = null, $name = null, $netN = null, $numa = null, $numaN = null, $onboot = null, $ostype = null, $parallelN = null, $protection = null, $reboot = null, $revert = null, $sataN = null, $scsiN = null, $scsihw = null, $serialN = null, $shares = null, $skiplock = null, $smbios1 = null, $smp = null, $sockets = null, $startdate = null, $startup = null, $tablet = null, $tdf = null, $template = null, $unusedN = null, $usbN = null, $vcpus = null, $vga = null, $virtioN = null, $vmstatestorage = null, $watchdog = null)

To

$params = [
'acpi' => ...,
'scsihw' => ...,,
];

updateVm($params)

Originally created by @franklupo on GitHub (Oct 10, 2019). Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-php/issues/5 Change function parameter accept array only parameter changed. example **From** > updateVm($acpi = null, $agent = null, $args = null, $autostart = null, $balloon = null, $bios = null, $boot = null, $bootdisk = null, $cdrom = null, $cores = null, $cpu = null, $cpulimit = null, $cpuunits = null, $delete = null, $description = null, $digest = null, $force = null, $freeze = null, $hostpciN = null, $hotplug = null, $hugepages = null, $ideN = null, $keyboard = null, $kvm = null, $localtime = null, $lock = null, $machine = null, $memory = null, $migrate_downtime = null, $migrate_speed = null, $name = null, $netN = null, $numa = null, $numaN = null, $onboot = null, $ostype = null, $parallelN = null, $protection = null, $reboot = null, $revert = null, $sataN = null, $scsiN = null, $scsihw = null, $serialN = null, $shares = null, $skiplock = null, $smbios1 = null, $smp = null, $sockets = null, $startdate = null, $startup = null, $tablet = null, $tdf = null, $template = null, $unusedN = null, $usbN = null, $vcpus = null, $vga = null, $virtioN = null, $vmstatestorage = null, $watchdog = null) **To** > > $params = [ > 'acpi' => ..., > 'scsihw' => ...,, > ]; > > updateVm($params)
kerem 2026-02-26 17:32:02 +03:00
Author
Owner

@balthild commented on GitHub (Jun 8, 2021):

Hello, is this supported now?

<!-- gh-comment-id:856551876 --> @balthild commented on GitHub (Jun 8, 2021): Hello, is this supported now?
Author
Owner

@franklupo commented on GitHub (Jun 8, 2021):

no but I'm planning a new version.

Best regards

<!-- gh-comment-id:856593790 --> @franklupo commented on GitHub (Jun 8, 2021): no but I'm planning a new version. Best regards
Author
Owner

@Exellent1988 commented on GitHub (Oct 28, 2024):

if i try to use only one parameter, like in the updateVM funktion, they all endup in the acpi subarray...

<!-- gh-comment-id:2441940852 --> @Exellent1988 commented on GitHub (Oct 28, 2024): if i try to use only one parameter, like in the updateVM funktion, they all endup in the acpi subarray...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-api-php#5
No description provided.