Skip to content

Commit

Permalink
change id of x-pack event_log plugin to eventLog (#57612)
Browse files Browse the repository at this point in the history
change id of x-pack event_log plugin to eventLog
  • Loading branch information
pmuellr committed Feb 17, 2020
1 parent 196ebe5 commit 5742eaa
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions x-pack/plugins/actions/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Actions Plugin', () => {
taskManager: taskManagerMock.createSetup(),
encryptedSavedObjects: encryptedSavedObjectsMock.createSetup(),
licensing: licensingMock.createSetup(),
event_log: eventLogMock.createSetup(),
eventLog: eventLogMock.createSetup(),
};
});

Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface ActionsPluginsSetup {
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup;
licensing: LicensingPluginSetup;
spaces?: SpacesPluginSetup;
event_log: IEventLogService;
eventLog: IEventLogService;
}
export interface ActionsPluginsStart {
encryptedSavedObjects: EncryptedSavedObjectsPluginStart;
Expand Down Expand Up @@ -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 },
});

Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/event_log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
...
}
```
Expand All @@ -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' } });
...
}
...
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/event_log/kibana.json
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 4 additions & 3 deletions x-pack/plugins/event_log/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
});
}

Expand All @@ -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',
});
}
}
2 changes: 1 addition & 1 deletion x-pack/test/alerting_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')}`,
Expand Down

0 comments on commit 5742eaa

Please sign in to comment.