change id of x-pack event_log plugin to eventLog (#57612)

change id of x-pack event_log plugin to eventLog
This commit is contained in:
Patrick Mueller 2020-02-16 20:10:35 -05:00 committed by GitHub
parent f998174898
commit 5d3797ee0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 21 deletions

View file

@ -4,7 +4,7 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"configPath": ["xpack", "actions"],
"requiredPlugins": ["licensing", "taskManager", "encryptedSavedObjects", "event_log"],
"requiredPlugins": ["licensing", "taskManager", "encryptedSavedObjects", "eventLog"],
"optionalPlugins": ["spaces"],
"ui": false
}

View file

@ -27,7 +27,7 @@ describe('Actions Plugin', () => {
taskManager: taskManagerMock.createSetup(),
encryptedSavedObjects: encryptedSavedObjectsMock.createSetup(),
licensing: licensingMock.createSetup(),
event_log: eventLogMock.createSetup(),
eventLog: eventLogMock.createSetup(),
};
});
@ -107,7 +107,7 @@ describe('Actions Plugin', () => {
taskManager: taskManagerMock.createSetup(),
encryptedSavedObjects: encryptedSavedObjectsMock.createSetup(),
licensing: licensingMock.createSetup(),
event_log: eventLogMock.createSetup(),
eventLog: eventLogMock.createSetup(),
};
pluginsStart = {
taskManager: taskManagerMock.createStart(),

View file

@ -70,7 +70,7 @@ export interface ActionsPluginsSetup {
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup;
licensing: LicensingPluginSetup;
spaces?: SpacesPluginSetup;
event_log: IEventLogService;
eventLog: IEventLogService;
}
export interface ActionsPluginsStart {
encryptedSavedObjects: EncryptedSavedObjectsPluginStart;
@ -132,8 +132,8 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi
attributesToEncrypt: new Set(['apiKey']),
});
plugins.event_log.registerProviderActions(EVENT_LOG_PROVIDER, Object.values(EVENT_LOG_ACTIONS));
this.eventLogger = plugins.event_log.getLogger({
plugins.eventLog.registerProviderActions(EVENT_LOG_PROVIDER, Object.values(EVENT_LOG_ACTIONS));
this.eventLogger = plugins.eventLog.getLogger({
event: { provider: EVENT_LOG_PROVIDER },
});

View file

@ -9,14 +9,14 @@ and actions.
## Basic Usage - Logging Events
Follow these steps to use `event_log` in your plugin:
Follow these steps to use `eventLog` in your plugin:
1. Declare `event_log` as a dependency in `kibana.json`:
1. Declare `eventLog` as a dependency in `kibana.json`:
```json
{
...
"requiredPlugins": ["event_log"],
"requiredPlugins": ["eventLog"],
...
}
```
@ -28,13 +28,13 @@ API provided in the `setup` stage:
...
import { IEventLogger, IEventLogService } from '../../event_log/server';
interface PluginSetupDependencies {
event_log: IEventLogService;
eventLog: IEventLogService;
}
...
public setup(core: CoreSetup, { event_log }: PluginSetupDependencies) {
public setup(core: CoreSetup, { eventLog }: PluginSetupDependencies) {
...
event_log.registerProviderActions('my-plugin', ['action-1, action-2']);
const eventLogger: IEventLogger = event_log.getLogger({ event: { provider: 'my-plugin' } });
eventLog.registerProviderActions('my-plugin', ['action-1, action-2']);
const eventLogger: IEventLogger = eventLog.getLogger({ event: { provider: 'my-plugin' } });
...
}
...
@ -73,7 +73,7 @@ a new elasticsearch index referred to as the "event log".
Example events are actions firing, alerts running their scheduled functions,
alerts scheduling actions to run, etc.
This functionality will be provided in a new NP plugin `event_log`, and will
This functionality will be provided in a new NP plugin `eventLog`, and will
provide server-side plugin APIs to write to the event log, and run limited
queries against it. For now, access via HTTP will not be available, due to
security concerns and lack of use cases.

View file

@ -1,8 +1,8 @@
{
"id": "event_log",
"id": "eventLog",
"version": "0.0.1",
"kibanaVersion": "kibana",
"configPath": ["xpack", "event_log"],
"configPath": ["xpack", "eventLog"],
"server": true,
"ui": false
}

View file

@ -22,7 +22,8 @@ import { createEsContext, EsContext } from './es';
export type PluginClusterClient = Pick<ClusterClient, 'callAsInternalUser' | 'asScoped'>;
const PROVIDER = 'event_log';
const PROVIDER = 'eventLog';
const ACTIONS = {
starting: 'starting',
stopping: 'stopping',
@ -88,7 +89,7 @@ export class Plugin implements CorePlugin<IEventLogService> {
// will log the event after initialization
this.eventLogger.logEvent({
event: { action: ACTIONS.starting },
message: 'event_log starting',
message: 'eventLog starting',
});
}
@ -101,7 +102,7 @@ export class Plugin implements CorePlugin<IEventLogService> {
// when Kibana is actuaelly stopping, as it's written asynchronously
this.eventLogger.logEvent({
event: { action: ACTIONS.stopping },
message: 'event_log stopping',
message: 'eventLog stopping',
});
}
}

View file

@ -75,7 +75,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
])}`,
`--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`,
'--xpack.alerting.enabled=true',
'--xpack.event_log.logEntries=true',
'--xpack.eventLog.logEntries=true',
...disabledPlugins.map(key => `--xpack.${key}.enabled=false`),
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'alerts')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'actions')}`,

View file

@ -74,7 +74,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
])}`,
`--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`,
'--xpack.alerting.enabled=true',
'--xpack.event_log.logEntries=true',
'--xpack.eventLog.logEntries=true',
...disabledPlugins.map(key => `--xpack.${key}.enabled=false`),
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'alerts')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'actions')}`,