private function getEventsList() { $events = EVENT_TYPE::getScriptingEventsWithScope(); $envId = null; if ($this->request->getScope() == WebhookConfig::SCOPE_ENVIRONMENT) { $envId = (int) $this->getEnvironmentId(true); } //Temporary added new events like this, workign on events refactoring $events['HostInitFailed'] = ['name' => 'HostInitFailed', 'description' => 'Instance was unable to initialize', 'scope' => 'scalr']; $events['InstanceLaunchFailed'] = ['name' => 'InstanceLaunchFailed', 'description' => 'Scalr failed to launch instance due to cloud error', 'scope' => 'scalr']; $events = array_merge($events, \Scalr\Model\Entity\EventDefinition::getList($this->user->getAccountId(), $envId)); return $events; }
public static function getScriptingData($accountId, $envId) { return ['events' => array_merge(\EVENT_TYPE::getScriptingEventsWithScope(), EventDefinition::getList($accountId, $envId)), 'scripts' => static::getList($accountId, $envId)]; }