CloudManagementEvent events
5 FeatherPanel plugin events on CloudManagementEvent (4 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.
Last synced from FeatherPanel 15b94e9 on .
On this page
Part of the plugin events reference. Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions. 1 of these events are declared but no code emits them yet; they are marked not emitted.
Setup
Import CloudManagementEvent in your entry class and register listeners in processEvents():
<?php
namespace App\Addons\myplugin;
use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\CloudManagementEvent;
class MyPlugin implements AppPlugin
{
public static function processEvents(PluginEvents $event): void
{
$event->on(CloudManagementEvent::onCloudCredentialsRetrieved(), function ($credentials): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:cloud:credentials:retrieved ' . json_encode(['credentials' => $credentials]));
});
}
public static function pluginInstall(): void
{
}
public static function pluginUninstall(): void
{
}
}CloudManagementEvent::onCloudCredentialsStored()
Docblock: array credentials data. (the emitter passes 2 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | credentials | $credentials | array |
| 2 | stored_by | $storedBy | not declared |
| Arguments passed | Emitted from |
|---|---|
credentials, stored_by | CloudManagementController::storeCloud |
credentials, stored_by, source, team_uuid, mythic_user_id | CloudManagementController::saveOAuth2Callback |
When it fires (2 sites)
$event->on(CloudManagementEvent::onCloudCredentialsStored(), function ($credentials, $storedBy, ...$rest): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:cloud:cloud:credentials:stored ' . json_encode(['credentials' => $credentials]));
});CloudManagementEvent::onCloudCredentialsRetrieved()
Docblock: array credentials data.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | credentials | $credentials | array |
When it fires (1 site)
$event->on(CloudManagementEvent::onCloudCredentialsRetrieved(), function ($credentials): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:cloud:credentials:retrieved ' . json_encode(['credentials' => $credentials]));
});CloudManagementEvent::onCloudCredentialsRotated()
Docblock: string credential type. (the emitter passes 2 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | credential_type | $credentialType | string |
| 2 | rotated_by | $rotatedBy | not declared |
When it fires (1 site)
$event->on(CloudManagementEvent::onCloudCredentialsRotated(), function ($credentialType, $rotatedBy): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:cloud:credentials:rotated ' . json_encode(['credential_type' => $credentialType]));
});CloudManagementEvent::onCloudManagementError()
Docblock: string error message, array context.
$event->on(CloudManagementEvent::onCloudManagementError(), function (...$args): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:cloud:error ' . json_encode($args));
});No code emits this event yet, so the arguments are unknown. The listener accepts any.
CloudManagementEvent::onPanelCredentialsStored()
Docblock: array credentials data. (the emitter passes 2 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | credentials | $credentials | array |
| 2 | stored_by | $storedBy | not declared |
When it fires (1 site)
$event->on(CloudManagementEvent::onPanelCredentialsStored(), function ($credentials, $storedBy): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:cloud:panel:credentials:stored ' . json_encode(['credentials' => $credentials]));
});