Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ingest Manager] Rename agent/package config(s) to agent/package policy(ies) #74914

Merged
merged 30 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c0668ba
Initial pass at updating client routes, variables names, code comment…
jen-huang Aug 12, 2020
414d4ae
Adjust server routes and param names, more var names and i18n fixes
jen-huang Aug 13, 2020
1095337
Fix test
jen-huang Aug 13, 2020
1a469bb
More var renaming
jen-huang Aug 13, 2020
1f4b9e1
Rest of server-side var renaming
jen-huang Aug 13, 2020
a451d31
Rest of client side var renaming
jen-huang Aug 13, 2020
6973717
Rename agent SO attributes and add migrations
jen-huang Aug 14, 2020
1a8b0df
Remove agent prefix from policy fields
jen-huang Aug 14, 2020
ec29272
Rename agent policy SO attributes and add migrations
jen-huang Aug 14, 2020
a2b36ec
Rename enrollment api key SO attributes and add migrations
jen-huang Aug 14, 2020
9223661
Rename package policy SO attributes and add migrations
jen-huang Aug 14, 2020
7a2834c
Merge remote-tracking branch 'upstream/master' into ingest/config-to-…
jen-huang Aug 14, 2020
11f1832
Rename agent event SO attributes and add migrations
jen-huang Aug 14, 2020
3c91e01
Rename subtype CONFIG to POLICY (I don't think this string is ever se…
jen-huang Aug 14, 2020
09f75c7
Update snapshot
jen-huang Aug 14, 2020
2935f5a
Remove unnecessary cloning in migrations
jen-huang Aug 14, 2020
a2b365b
Fix migration typos
jen-huang Aug 15, 2020
06e785e
Update naming in tests and es archiver data
jen-huang Aug 17, 2020
667ddc0
Merge remote-tracking branch 'upstream/master' into ingest/config-to-…
jen-huang Aug 17, 2020
a11afec
Rename file names in /common
jen-huang Aug 17, 2020
1856855
Rename /server files
jen-huang Aug 17, 2020
0854124
Rename /public files
jen-huang Aug 17, 2020
bbff4a3
Rename test file names
jen-huang Aug 17, 2020
5f66133
Rename missed files
jen-huang Aug 17, 2020
e9a8d44
Merge remote-tracking branch 'upstream/master' into ingest/config-to-…
jen-huang Aug 18, 2020
6618f41
Merge remote-tracking branch 'upstream/master' into ingest/config-to-…
jen-huang Aug 18, 2020
055c4cf
Merge remote-tracking branch 'upstream/master' into ingest/config-to-…
jen-huang Aug 18, 2020
96182d8
Revert "Rename subtype CONFIG to POLICY (I don't think this string is…
jen-huang Aug 18, 2020
301a412
Add migration version to updated es archiver data to fix tests
jen-huang Aug 18, 2020
0cf533a
Merge remote-tracking branch 'upstream/master' into ingest/config-to-…
jen-huang Aug 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugins/ingest_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Plugin

- The plugin is enabled by default. See the TypeScript type for the [the available plugin configuration options](https://github.com/elastic/kibana/blob/master/x-pack/plugins/ingest_manager/common/types/index.ts#L9-L27)
- Adding `xpack.ingestManager.enabled=false` will disable the plugin including the EPM and Fleet features. It will also remove the `PACKAGE_CONFIG_API_ROUTES` and `AGENT_CONFIG_API_ROUTES` values in [`common/constants/routes.ts`](./common/constants/routes.ts)
- Adding `xpack.ingestManager.enabled=false` will disable the plugin including the EPM and Fleet features. It will also remove the `PACKAGE_POLICY_API_ROUTES` and `AGENT_POLICY_API_ROUTES` values in [`common/constants/routes.ts`](./common/constants/routes.ts)
- Adding `--xpack.ingestManager.fleet.enabled=false` will disable the Fleet API & UI
- [code for adding the routes](https://github.com/elastic/kibana/blob/1f27d349533b1c2865c10c45b2cf705d7416fb36/x-pack/plugins/ingest_manager/server/plugin.ts#L115-L133)
- [Integration tests](server/integration_tests/router.test.ts)
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/ingest_manager/common/constants/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export const AGENT_POLLING_INTERVAL = 1000;
export const AGENT_UPDATE_LAST_CHECKIN_INTERVAL_MS = 30000;
export const AGENT_UPDATE_ACTIONS_INTERVAL_MS = 5000;

export const AGENT_CONFIG_ROLLOUT_RATE_LIMIT_INTERVAL_MS = 5000;
export const AGENT_CONFIG_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL = 25;
export const AGENT_POLICY_ROLLOUT_RATE_LIMIT_INTERVAL_MS = 5000;
export const AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL = 25;
20 changes: 0 additions & 20 deletions x-pack/plugins/ingest_manager/common/constants/agent_config.ts

This file was deleted.

20 changes: 20 additions & 0 deletions x-pack/plugins/ingest_manager/common/constants/agent_policy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { AgentPolicyStatus, DefaultPackages } from '../types';

export const AGENT_POLICY_SAVED_OBJECT_TYPE = 'ingest-agent-policies';

export const DEFAULT_AGENT_POLICY = {
name: 'Default policy',
namespace: 'default',
description: 'Default agent policy created by Kibana',
status: AgentPolicyStatus.Active,
package_policies: [],
is_default: true,
monitoring_enabled: ['logs', 'metrics'] as Array<'logs' | 'metrics'>,
};

export const DEFAULT_AGENT_POLICIES_PACKAGES = [DefaultPackages.system];
4 changes: 2 additions & 2 deletions x-pack/plugins/ingest_manager/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export * from './plugin';
export * from './routes';

export * from './agent';
export * from './agent_config';
export * from './package_config';
export * from './agent_policy';
export * from './package_policy';
export * from './epm';
export * from './output';
export * from './enrollment_api_key';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export const PACKAGE_CONFIG_SAVED_OBJECT_TYPE = 'ingest-package-policies';
export const PACKAGE_POLICY_SAVED_OBJECT_TYPE = 'ingest-package-policies';
38 changes: 19 additions & 19 deletions x-pack/plugins/ingest_manager/common/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
export const API_ROOT = `/api/ingest_manager`;
export const EPM_API_ROOT = `${API_ROOT}/epm`;
export const DATA_STREAM_API_ROOT = `${API_ROOT}/data_streams`;
export const PACKAGE_CONFIG_API_ROOT = `${API_ROOT}/package_configs`;
export const AGENT_CONFIG_API_ROOT = `${API_ROOT}/agent_configs`;
export const PACKAGE_POLICY_API_ROOT = `${API_ROOT}/package_policies`;
export const AGENT_POLICY_API_ROOT = `${API_ROOT}/agent_policies`;
export const FLEET_API_ROOT = `${API_ROOT}/fleet`;

export const LIMITED_CONCURRENCY_ROUTE_TAG = 'ingest:limited-concurrency';
Expand All @@ -32,25 +32,25 @@ export const DATA_STREAM_API_ROUTES = {
LIST_PATTERN: `${DATA_STREAM_API_ROOT}`,
};

// Package config API routes
export const PACKAGE_CONFIG_API_ROUTES = {
LIST_PATTERN: `${PACKAGE_CONFIG_API_ROOT}`,
INFO_PATTERN: `${PACKAGE_CONFIG_API_ROOT}/{packageConfigId}`,
CREATE_PATTERN: `${PACKAGE_CONFIG_API_ROOT}`,
UPDATE_PATTERN: `${PACKAGE_CONFIG_API_ROOT}/{packageConfigId}`,
DELETE_PATTERN: `${PACKAGE_CONFIG_API_ROOT}/delete`,
// Package policy API routes
export const PACKAGE_POLICY_API_ROUTES = {
LIST_PATTERN: `${PACKAGE_POLICY_API_ROOT}`,
INFO_PATTERN: `${PACKAGE_POLICY_API_ROOT}/{packagePolicyId}`,
CREATE_PATTERN: `${PACKAGE_POLICY_API_ROOT}`,
UPDATE_PATTERN: `${PACKAGE_POLICY_API_ROOT}/{packagePolicyId}`,
DELETE_PATTERN: `${PACKAGE_POLICY_API_ROOT}/delete`,
};

// Agent config API routes
export const AGENT_CONFIG_API_ROUTES = {
LIST_PATTERN: `${AGENT_CONFIG_API_ROOT}`,
INFO_PATTERN: `${AGENT_CONFIG_API_ROOT}/{agentConfigId}`,
CREATE_PATTERN: `${AGENT_CONFIG_API_ROOT}`,
UPDATE_PATTERN: `${AGENT_CONFIG_API_ROOT}/{agentConfigId}`,
COPY_PATTERN: `${AGENT_CONFIG_API_ROOT}/{agentConfigId}/copy`,
DELETE_PATTERN: `${AGENT_CONFIG_API_ROOT}/delete`,
FULL_INFO_PATTERN: `${AGENT_CONFIG_API_ROOT}/{agentConfigId}/full`,
FULL_INFO_DOWNLOAD_PATTERN: `${AGENT_CONFIG_API_ROOT}/{agentConfigId}/download`,
// Agent policy API routes
export const AGENT_POLICY_API_ROUTES = {
LIST_PATTERN: `${AGENT_POLICY_API_ROOT}`,
INFO_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}`,
CREATE_PATTERN: `${AGENT_POLICY_API_ROOT}`,
UPDATE_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}`,
COPY_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}/copy`,
DELETE_PATTERN: `${AGENT_POLICY_API_ROOT}/delete`,
FULL_INFO_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}/full`,
FULL_INFO_DOWNLOAD_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}/download`,
};

// Output API routes
Expand Down
12 changes: 6 additions & 6 deletions x-pack/plugins/ingest_manager/common/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { NewPackageConfig, PackageConfig } from './types/models/package_config';
import { NewPackagePolicy, PackagePolicy } from './types';

export const createNewPackageConfigMock = (): NewPackageConfig => {
export const createNewPackagePolicyMock = (): NewPackagePolicy => {
return {
name: 'endpoint-1',
description: '',
namespace: 'default',
enabled: true,
config_id: '93c46720-c217-11ea-9906-b5b8a21b268e',
policy_id: '93c46720-c217-11ea-9906-b5b8a21b268e',
output_id: '',
package: {
name: 'endpoint',
Expand All @@ -23,10 +23,10 @@ export const createNewPackageConfigMock = (): NewPackageConfig => {
};
};

export const createPackageConfigMock = (): PackageConfig => {
const newPackageConfig = createNewPackageConfigMock();
export const createPackagePolicyMock = (): PackagePolicy => {
const newPackagePolicy = createNewPackagePolicyMock();
return {
...newPackageConfig,
...newPackagePolicy,
id: 'c6d16e42-c32d-4dce-8a88-113cfe276ad1',
version: 'abcd',
revision: 1,
Expand Down
Loading