# VdsEvent events

> 17 FeatherPanel plugin events on VdsEvent (17 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.

Source: https://featherpanel.com/docs/plugins/events/vds/

Part of the [plugin events reference](https://featherpanel.com/docs/plugins/events/). Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions.

## Setup

Import `VdsEvent` in your entry class and register listeners in `processEvents()`:

```php
<?php

namespace App\Addons\myplugin;

use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\VdsEvent;

class MyPlugin implements AppPlugin
{
    public static function processEvents(PluginEvents $event): void
    {
        $event->on(VdsEvent::onVdsBackupCreated(), function ($userUuid, $vdsId, $vmid, $backupId, $context): void {
            App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:backup:create ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'backup_id' => $backupId, 'context' => $context]));
        });
    }

    public static function pluginInstall(): void
    {
    }

    public static function pluginUninstall(): void
    {
    }
}
```

## `VdsEvent::onVdsBackupCreated()`

- Name: `featherpanel:vds:backup:create`
- emitted at 3 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L83)

Docblock: string|null user uuid, int vds instance id, int vmid, string backup id, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int` |
| 4 | `backup_id` | `$backupId` | `string` |
| 5 | `context` | `$context` | `array` |

When it fires (3 sites)

-   [`VmInstancesController::createBackup`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2121) via `emitVdsEvent()`[`POST /api/admin/vm-instances/{id}/backups`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#post-admin-vm-instances-id-backups)
-   [`VmUserBackupController::createBackup`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserBackupController.php#L315) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/backups`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-backups)
-   [`CreateVdsBackupTool::execute`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Services/Chatbot/Tools/Vds/CreateVdsBackupTool.php#L175)

```php
$event->on(VdsEvent::onVdsBackupCreated(), function ($userUuid, $vdsId, $vmid, $backupId, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:backup:create ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'backup_id' => $backupId, 'context' => $context]));
});
```

## `VdsEvent::onVdsBackupDeleted()`

- Name: `featherpanel:vds:backup:delete`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L91)

Docblock: string|null user uuid, int vds instance id, int vmid, string volid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `volid` | `$volid` | `string`from docblock |
| 5 | `context` | `$context` | `array` |

When it fires (2 sites)

-   [`VmInstancesController::deleteBackupVolume`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2265) via `emitVdsEvent()`[`DELETE /api/admin/vm-instances/{id}/backups`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#delete-admin-vm-instances-id-backups)
-   [`VmUserBackupController::deleteBackup`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserBackupController.php#L473) via `emitVdsEvent()`[`DELETE /api/user/vm-instances/{id}/backups`](https://featherpanel.com/docs/api/reference/user/vds/core/#delete-user-vm-instances-id-backups)

```php
$event->on(VdsEvent::onVdsBackupDeleted(), function ($userUuid, $vdsId, $vmid, $volid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:backup:delete ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'volid' => $volid, 'context' => $context]));
});
```

## `VdsEvent::onVdsBackupRestored()`

- Name: `featherpanel:vds:backup:restore`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L99)

Docblock: string|null user uuid, int vds instance id, int vmid, string restore id, string volid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int` |
| 4 | `restore_id` | `$restoreId` | `string` |
| 5 | `volid` | `$volid` | `string`from docblock |
| 6 | `context` | `$context` | `array` |

When it fires (2 sites)

-   [`VmInstancesController::restoreBackup`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2392) via `emitVdsEvent()`[`POST /api/admin/vm-instances/{id}/backups/restore`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#post-admin-vm-instances-id-backups-restore)
-   [`VmUserBackupController::restoreBackup`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserBackupController.php#L602) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/backups/restore`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-backups-restore)

```php
$event->on(VdsEvent::onVdsBackupRestored(), function ($userUuid, $vdsId, $vmid, $restoreId, $volid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:backup:restore ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'restore_id' => $restoreId, 'volid' => $volid, 'context' => $context]));
});
```

## `VdsEvent::onVdsConsoleAccessed()`

- Name: `featherpanel:vds:console:access`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L155)

Docblock: string|null user uuid, int vds instance id, int vmid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `context` | `$context` | `array` |

When it fires (2 sites)

-   [`VmInstancesController::vncTicket`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L1247) via `emitVdsEvent()`[`GET /api/admin/vm-instances/{id}/vnc-ticket`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#get-admin-vm-instances-id-vnc-ticket)
-   [`VmUserInstanceController::getVncTicket`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L1863) via `emitVdsEvent()`[`GET /api/user/vm-instances/{id}/vnc-ticket`](https://featherpanel.com/docs/api/reference/user/vds/core/#get-user-vm-instances-id-vnc-ticket)

```php
$event->on(VdsEvent::onVdsConsoleAccessed(), function ($userUuid, $vdsId, $vmid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:console:access ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'context' => $context]));
});
```

## `VdsEvent::onVdsCreated()`

- Name: `featherpanel:vds:created`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L27)

Docblock: string|null user uuid, int vds instance id, int vmid, array context. (the emitter passes 5 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | not declared |
| 2 | `vds_id` | `$vdsId` | `null` |
| 3 | `vmid` | `$vmid` | not declared |
| 4 | `creation_id` | `$creationId` | not declared |
| 5 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmInstancesController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L484) via `emitVdsEvent()`[`PUT /api/admin/vm-instances`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#put-admin-vm-instances)

```php
$event->on(VdsEvent::onVdsCreated(), function ($userUuid, $vdsId, $vmid, $creationId, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:created ' . json_encode(['context' => $context]));
});
```

## `VdsEvent::onVdsDeleted()`

- Name: `featherpanel:vds:deleted`
- emitted at 4 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L43)

Docblock: string|null user uuid, int vds instance id, int vmid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int` |
| 4 | `context` | `$context` | `array` |

When it fires (4 sites)

-   [`VmInstancesController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2825) via `emitVdsEvent()`[`DELETE /api/admin/vm-instances/{id}`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#delete-admin-vm-instances-id)
-   [`VmInstancesController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2847) via `emitVdsEvent()`[`DELETE /api/admin/vm-instances/{id}`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#delete-admin-vm-instances-id)
-   [`VmInstancesController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2890) via `emitVdsEvent()`[`DELETE /api/admin/vm-instances/{id}`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#delete-admin-vm-instances-id)
-   [`VmInstancesController::hardDelete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2939) via `emitVdsEvent()`[`DELETE /api/admin/vm-instances/{id}/hard`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#delete-admin-vm-instances-id-hard)

```php
$event->on(VdsEvent::onVdsDeleted(), function ($userUuid, $vdsId, $vmid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:deleted ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'context' => $context]));
});
```

## `VdsEvent::onVdsIsoMounted()`

- Name: `featherpanel:vds:iso:mount`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L139)

Docblock: string|null user uuid, int vds instance id, int vmid, string volid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int` |
| 4 | `volid` | `$volid` | `null` |
| 5 | `context` | `$context` | `array` |

When it fires (2 sites)

-   [`VmUserInstanceController::uploadAndMountIso`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L1348) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/iso-upload-and-mount`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-iso-upload-and-mount)
-   [`VmUserInstanceController::fetchAndMountIsoFromUrl`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L1487) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/iso-fetch-and-mount`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-iso-fetch-and-mount)

```php
$event->on(VdsEvent::onVdsIsoMounted(), function ($userUuid, $vdsId, $vmid, $volid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:iso:mount ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'context' => $context]));
});
```

## `VdsEvent::onVdsIsoUnmounted()`

- Name: `featherpanel:vds:iso:unmount`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L147)

Docblock: string|null user uuid, int vds instance id, int vmid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int`from docblock |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmUserInstanceController::unmountIso`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L1675) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/iso-unmount`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-iso-unmount)

```php
$event->on(VdsEvent::onVdsIsoUnmounted(), function ($userUuid, $vdsId, $vmid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:iso:unmount ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'context' => $context]));
});
```

## `VdsEvent::onVdsNetworkUpdated()`

- Name: `featherpanel:vds:network:update`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L123)

Docblock: string|null user uuid, int vds instance id, int vmid, array dns/network payload, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `changes` | `$changes` | `array` |
| 5 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmUserInstanceController::patchNetworkDns`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L959) via `emitVdsEvent()`[`PATCH /api/user/vm-instances/{id}/network-dns`](https://featherpanel.com/docs/api/reference/user/vds/core/#patch-user-vm-instances-id-network-dns)

```php
$event->on(VdsEvent::onVdsNetworkUpdated(), function ($userUuid, $vdsId, $vmid, $changes, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:network:update ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'changes' => $changes, 'context' => $context]));
});
```

## `VdsEvent::onVdsPowerAction()`

- Name: `featherpanel:vds:power:action`
- emitted at 3 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L51)

Docblock: string|null user uuid, int vds instance id, int vmid, string action, string task id, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int` |
| 4 | `action` | `$action` | `bool` |
| 5 | `task_id` | `$taskId` | `string` |
| 6 | `context` | `$context` | `array` |

When it fires (3 sites)

-   [`VmInstancesController::power`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L1765) via `emitVdsEvent()`[`POST /api/admin/vm-instances/{id}/power`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#post-admin-vm-instances-id-power)
-   [`VmUserInstanceController::powerAction`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L1794) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/power`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-power)
-   [`VdsPowerActionTool::execute`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Services/Chatbot/Tools/Vds/VdsPowerActionTool.php#L154)

```php
$event->on(VdsEvent::onVdsPowerAction(), function ($userUuid, $vdsId, $vmid, $action, $taskId, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:power:action ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'action' => $action, 'task_id' => $taskId, 'context' => $context]));
});
```

## `VdsEvent::onVdsQemuHardwareUpdated()`

- Name: `featherpanel:vds:qemu:hardware:update`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L131)

Docblock: string|null user uuid, int vds instance id, int vmid, array qemu payload, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `changes` | `$changes` | `array` |
| 5 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmUserInstanceController::patchQemuHardware`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L634) via `emitVdsEvent()`[`PATCH /api/user/vm-instances/{id}/qemu-hardware`](https://featherpanel.com/docs/api/reference/user/vds/core/#patch-user-vm-instances-id-qemu-hardware)

```php
$event->on(VdsEvent::onVdsQemuHardwareUpdated(), function ($userUuid, $vdsId, $vmid, $changes, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:qemu:hardware:update ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'changes' => $changes, 'context' => $context]));
});
```

## `VdsEvent::onVdsReinstalled()`

- Name: `featherpanel:vds:reinstall`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L59)

Docblock: string|null user uuid, int vds instance id, int vmid, string reinstall id, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `reinstall_id` | `$reinstallId` | `string`from docblock |
| 5 | `context` | `$context` | `array` |

When it fires (2 sites)

-   [`VmInstancesController::reinstall`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L1835) via `emitVdsEvent()`[`POST /api/admin/vm-instances/{id}/reinstall`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#post-admin-vm-instances-id-reinstall)
-   [`VmUserInstanceController::reinstall`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserInstanceController.php#L1944) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/reinstall`](https://featherpanel.com/docs/api/reference/user/vds/core/#post-user-vm-instances-id-reinstall)

```php
$event->on(VdsEvent::onVdsReinstalled(), function ($userUuid, $vdsId, $vmid, $reinstallId, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:reinstall ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'reinstall_id' => $reinstallId, 'context' => $context]));
});
```

## `VdsEvent::onVdsSubuserCreated()`

- Name: `featherpanel:vds:subuser:create`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L107)

Docblock: string|null user uuid, int vds instance id, int vmid, int subuser id, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `subuser_id` | `$subuserId` | `int`from docblock |
| 5 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmUserSubuserController::createSubuser`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserSubuserController.php#L139) via `emitVdsEvent()`[`POST /api/user/vm-instances/{id}/subusers`](https://featherpanel.com/docs/api/reference/user/vds/subusers/#post-user-vm-instances-id-subusers)

```php
$event->on(VdsEvent::onVdsSubuserCreated(), function ($userUuid, $vdsId, $vmid, $subuserId, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:subuser:create ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'subuser_id' => $subuserId, 'context' => $context]));
});
```

## `VdsEvent::onVdsSubuserDeleted()`

- Name: `featherpanel:vds:subuser:delete`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L115)

Docblock: string|null user uuid, int vds instance id, int vmid, int subuser id, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `subuser_id` | `$subuserId` | `int` |
| 5 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmUserSubuserController::deleteSubuser`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Vds/VmUserSubuserController.php#L192) via `emitVdsEvent()`[`DELETE /api/user/vm-instances/{id}/subusers/{subuserId}`](https://featherpanel.com/docs/api/reference/user/vds/subusers/#delete-user-vm-instances-id-subusers-subuserId)

```php
$event->on(VdsEvent::onVdsSubuserDeleted(), function ($userUuid, $vdsId, $vmid, $subuserId, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:subuser:delete ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'subuser_id' => $subuserId, 'context' => $context]));
});
```

## `VdsEvent::onVdsSuspended()`

- Name: `featherpanel:vds:suspended`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L67)

Docblock: string|null user uuid, int vds instance id, int vmid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmInstancesController::suspend`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2665) via `emitVdsEvent()`[`POST /api/admin/vm-instances/{id}/suspend`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#post-admin-vm-instances-id-suspend)

```php
$event->on(VdsEvent::onVdsSuspended(), function ($userUuid, $vdsId, $vmid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:suspended ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'context' => $context]));
});
```

## `VdsEvent::onVdsUnsuspended()`

- Name: `featherpanel:vds:unsuspended`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L75)

Docblock: string|null user uuid, int vds instance id, int vmid, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `context` | `$context` | `array` |

When it fires (1 site)

-   [`VmInstancesController::unsuspend`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2761) via `emitVdsEvent()`[`POST /api/admin/vm-instances/{id}/unsuspend`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#post-admin-vm-instances-id-unsuspend)

```php
$event->on(VdsEvent::onVdsUnsuspended(), function ($userUuid, $vdsId, $vmid, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:unsuspended ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'context' => $context]));
});
```

## `VdsEvent::onVdsUpdated()`

- Name: `featherpanel:vds:updated`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/VdsEvent.php#L35)

Docblock: string|null user uuid, int vds instance id, int vmid, array changed fields, array context.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | `string|null`from docblock |
| 2 | `vds_id` | `$vdsId` | `int` |
| 3 | `vmid` | `$vmid` | `int`from docblock |
| 4 | `changed_fields` | `$changedFields` | `array` |
| 5 | `context` | `$context` | `array` |

When it fires (2 sites)

-   [`VmInstancesController::update`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L1073) via `emitVdsEvent()`[`PATCH /api/admin/vm-instances/{id}`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#patch-admin-vm-instances-id)
-   [`VmInstancesController::setBackupLimit`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/VmInstancesController.php#L2556) via `emitVdsEvent()`[`PATCH /api/admin/vm-instances/{id}/backup-limit`](https://featherpanel.com/docs/api/reference/admin/vm-instances/#patch-admin-vm-instances-id-backup-limit)

```php
$event->on(VdsEvent::onVdsUpdated(), function ($userUuid, $vdsId, $vmid, $changedFields, $context): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:vds:updated ' . json_encode(['user_uuid' => $userUuid, 'vds_id' => $vdsId, 'vmid' => $vmid, 'changed_fields' => $changedFields, 'context' => $context]));
});
```
