-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-make-it-ingest' of github.com:elastic/kibana in…
…to feature-ingest
- Loading branch information
Showing
234 changed files
with
53,785 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const AGENT_TYPE_PERMANENT = 'PERMANENT'; | ||
export const AGENT_TYPE_EPHEMERAL = 'EPHEMERAL'; | ||
export const AGENT_TYPE_TEMPORARY = 'TEMPORARY'; | ||
|
||
export const AGENT_POLLING_THRESHOLD_MS = 30000; | ||
|
||
export const DEFAULT_AGENTS_PAGE_SIZE = 20; | ||
export const AGENTS_PAGE_SIZE_OPTIONS = [20, 50, 100]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { INDEX_NAMES } from './index_names'; | ||
export { PLUGIN } from './plugin'; | ||
export * from './agent'; | ||
export const BASE_PATH = '/fleet'; | ||
|
||
export const DEFAULT_POLICY_ID = 'default'; |
11 changes: 11 additions & 0 deletions
11
x-pack/legacy/plugins/fleet/common/constants/index_names.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const INDEX_NAMES = { | ||
FLEET: '.kibana', | ||
}; | ||
|
||
export const POLICY_NAMES = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const PLUGIN = { | ||
ID: 'fleet', | ||
}; | ||
export const CONFIG_PREFIX = 'xpack.fleet'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const REQUIRED_ROLES = ['fleet_admin']; | ||
export const REQUIRED_LICENSES = ['standard', 'gold', 'trial', 'platinum']; | ||
export const LICENSES = ['oss', 'basic', 'standard', 'gold', 'trial', 'platinum']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export interface BaseReturnType { | ||
error?: { | ||
message: string; | ||
code?: number; | ||
}; | ||
success: boolean; | ||
} | ||
|
||
export interface ReturnTypeCreate<T> extends BaseReturnType { | ||
item: T; | ||
action: 'created'; | ||
} | ||
|
||
export interface ReturnTypeUpdate<T> extends BaseReturnType { | ||
item: T; | ||
action: 'updated'; | ||
} | ||
|
||
export interface ReturnTypeBulkCreate<T> extends BaseReturnType { | ||
results: Array<{ | ||
item: T; | ||
success: boolean; | ||
action: 'created'; | ||
error?: { | ||
message: string; | ||
code?: number; | ||
}; | ||
}>; | ||
} | ||
|
||
// delete | ||
export interface ReturnTypeDelete extends BaseReturnType { | ||
action: 'deleted'; | ||
} | ||
|
||
export interface ReturnTypeCheckin extends BaseReturnType { | ||
action: 'checkin'; | ||
actions: Array<{ | ||
type: string; | ||
data?: object; | ||
}>; | ||
policy: { [k: string]: any } | null; | ||
} | ||
|
||
export interface ReturnTypeBulkDelete extends BaseReturnType { | ||
results: Array<{ | ||
success: boolean; | ||
action: 'deleted'; | ||
error?: { | ||
message: string; | ||
code?: number; | ||
}; | ||
}>; | ||
} | ||
|
||
// upsert | ||
export interface ReturnTypeUpsert<T> extends BaseReturnType { | ||
item: T; | ||
action: 'created' | 'updated'; | ||
} | ||
|
||
// upsert bulk | ||
export interface ReturnTypeBulkUpsert extends BaseReturnType { | ||
results: Array<{ | ||
success: boolean; | ||
action: 'created' | 'updated'; | ||
error?: { | ||
message: string; | ||
code?: number; | ||
}; | ||
}>; | ||
} | ||
|
||
export interface ReturnTypeBulkUnenroll extends BaseReturnType { | ||
results: Array<{ | ||
id: string; | ||
success: boolean; | ||
action: 'unenrolled'; | ||
error?: { | ||
message: string; | ||
}; | ||
}>; | ||
} | ||
|
||
// list | ||
export interface ReturnTypeList<T> extends BaseReturnType { | ||
list: T[]; | ||
page: number; | ||
total: number; | ||
perPage: number; | ||
} | ||
|
||
// get | ||
export interface ReturnTypeGet<T> extends BaseReturnType { | ||
item: T; | ||
} | ||
|
||
export interface ReturnTypeBulkGet<T> extends BaseReturnType { | ||
items: T[]; | ||
} | ||
|
||
// action -- e.g. validate config block. Like ES simulate endpoint | ||
export interface ReturnTypeAction extends BaseReturnType { | ||
result: { | ||
[key: string]: any; | ||
}; | ||
} | ||
// e.g. | ||
// { | ||
// result: { | ||
// username: { valid: true }, | ||
// password: { valid: false, error: 'something' }, | ||
// hosts: [ | ||
// { valid: false }, { valid: true }, | ||
// ] | ||
// } | ||
// } | ||
|
||
// bulk action -- e.g. assign tags to beats | ||
export interface ReturnTypeBulkAction extends BaseReturnType { | ||
results?: Array<{ | ||
success: boolean; | ||
result?: { | ||
[key: string]: any; | ||
}; | ||
error?: { | ||
message: string; | ||
code?: number; | ||
}; | ||
}>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* 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 * as t from 'io-ts'; | ||
import { RuntimeAgent, RuntimeAgentAction } from '../../server/repositories/agents/types'; | ||
import { RuntimeAgentEvent } from '../../server/repositories/agent_events/types'; | ||
import { EnrollmentApiKey } from '../../server/repositories/enrollment_api_keys/types'; | ||
|
||
// Here we create the runtime check for a generic, unknown beat config type. | ||
// We can also pass in optional params to create spacific runtime checks that | ||
// can be used to validate blocs on the API and UI | ||
export const createConfigurationInterface = (beatConfigInterface: t.Mixed = t.Dictionary) => | ||
t.interface( | ||
{ | ||
id: t.union([t.undefined, t.string]), | ||
name: t.string, | ||
description: t.union([t.undefined, t.string]), | ||
config: beatConfigInterface, | ||
last_updated_by: t.union([t.undefined, t.string]), | ||
last_updated: t.union([t.undefined, t.number]), | ||
}, | ||
'Config' | ||
); | ||
const BaseConfiguration = createConfigurationInterface(); | ||
export interface ConfigurationBlock | ||
extends Pick< | ||
t.TypeOf<typeof BaseConfiguration>, | ||
Exclude<keyof t.TypeOf<typeof BaseConfiguration>, 'id'> | ||
> { | ||
id: string; | ||
} | ||
|
||
export type Agent = t.TypeOf<typeof RuntimeAgent>; | ||
export type AgentAction = t.TypeOf<typeof RuntimeAgentAction>; | ||
export type AgentEvent = t.TypeOf<typeof RuntimeAgentEvent>; | ||
|
||
export type EnrollmentApiKey = EnrollmentApiKey; | ||
|
||
export type PolicyUpdatedEvent = | ||
| { | ||
type: 'created'; | ||
policyId: string; | ||
payload: any; | ||
} | ||
| { | ||
type: 'updated'; | ||
policyId: string; | ||
payload: any; | ||
} | ||
| { | ||
type: 'deleted'; | ||
policyId: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export type FlatObject<T> = { [Key in keyof T]: string }; | ||
export type RendererResult = React.ReactElement<any> | null; | ||
export type RendererFunction<RenderArgs, Result = RendererResult> = (args: RenderArgs) => Result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* 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 * as t from 'io-ts'; | ||
import { isLeft } from 'fp-ts/lib/Either'; | ||
|
||
export class DateFromStringType extends t.Type<Date, string, t.mixed> { | ||
// eslint-disable-next-line | ||
public readonly _tag: 'DateFromISOStringType' = 'DateFromISOStringType'; | ||
constructor() { | ||
super( | ||
'DateFromString', | ||
(u): u is Date => u instanceof Date, | ||
(u, c) => { | ||
const validation = t.string.validate(u, c); | ||
if (isLeft(validation)) { | ||
return validation as any; | ||
} else { | ||
const s = validation.right; | ||
const d = new Date(s); | ||
return isNaN(d.getTime()) ? t.failure(s, c) : t.success(d); | ||
} | ||
}, | ||
a => a.toISOString() | ||
); | ||
} | ||
} | ||
// eslint-disable-next-line | ||
export interface DateFromString extends DateFromStringType {} | ||
|
||
export const DateFromString: DateFromString = new DateFromStringType(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export type LicenseType = 'oss' | 'basic' | 'trial' | 'standard' | 'basic' | 'gold' | 'platinum'; |
Oops, something went wrong.