mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* Move current alert HTTP APIs to legacy folder (#93943) * Move current HTTP APIs to legacy folder * Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH * Fix failing tests and extra files * Create new rule HTTP APIs (#93980) * Move current HTTP APIs to legacy folder * Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH * Fix failing tests and extra files * Move current alert HTTP APIs to legacy folder (#93943) * Move current HTTP APIs to legacy folder * Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH * Fix failing tests and extra files * Add necessary files * Create rule route * Get rule API * Update rule API * Delete rule route * Aggregate rules API * Disable rule API * Enable rule API * Find rules API * Fix Update API * Get rule alert summary API * Get rule state API * Health API * Rule types API * Mute all API * Mute alert API * Unmute all API * Unmute alert route * Update API key API * corrected tpye by making it much more complicated * removed unneeded cocde * Fixes * Add back health route * mutedInstanceIds -> mutedAlertIds * lastRun -> last_run * alert_type_state -> rule_type_state & alert_instances -> alerts Co-authored-by: Gidi Meir Morris <github@gidi.io> * Create docs for new rule HTTP APIs, deprecate old docs (#94745) * Create docs for new APIs, deprecate old docs * Remove connector_type_id * Update docs * Add link to legacy APIs from rules API docs * Remove connector_type_id references * [DOCS] Add legacy APIs to index.asciidoc * Fix camel case Co-authored-by: lcawl <lcawley@elastic.co> * Make alerting tests use new rules APIs (#95159) * Make API integration tests use new HTTP APIs * Fix end to end tests * Fix test failures * Fix more test failures * Rename some files * Add tests for legacy APIs (#95333) * Initial commit (#95457) * Move some new alerting APIs to /internal (#95461) * Initial commit * Update README.md * Use internal API * Merge deprecated warning w/ alternative solution * Update API docs Co-authored-by: Gidi Meir Morris <github@gidi.io> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: lcawl <lcawley@elastic.co> # Conflicts: # api_docs/core.json
This commit is contained in:
parent
8f5fd0fd63
commit
52f41d8750
206 changed files with 9067 additions and 4349 deletions
|
@ -810,7 +810,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/alerts_client/alerts_client.ts",
|
||||
"lineNumber": 132
|
||||
"lineNumber": 133
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -821,7 +821,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/alerts_client/alerts_client.ts",
|
||||
"lineNumber": 133
|
||||
"lineNumber": 134
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -832,7 +832,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/alerts_client/alerts_client.ts",
|
||||
"lineNumber": 134
|
||||
"lineNumber": 135
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -843,7 +843,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/alerts_client/alerts_client.ts",
|
||||
"lineNumber": 135
|
||||
"lineNumber": 136
|
||||
},
|
||||
"signature": [
|
||||
"Pick<",
|
||||
|
@ -860,7 +860,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/alerts_client/alerts_client.ts",
|
||||
"lineNumber": 131
|
||||
"lineNumber": 132
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -905,7 +905,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 111
|
||||
"lineNumber": 93
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -913,13 +913,13 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 103
|
||||
"lineNumber": 85
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 102
|
||||
"lineNumber": 84
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -938,7 +938,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 123
|
||||
"lineNumber": 105
|
||||
},
|
||||
"signature": [
|
||||
"() => Set<",
|
||||
|
@ -994,7 +994,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 124
|
||||
"lineNumber": 106
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1002,7 +1002,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 124
|
||||
"lineNumber": 106
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1013,7 +1013,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 125
|
||||
"lineNumber": 107
|
||||
},
|
||||
"signature": [
|
||||
"() => Promise<",
|
||||
|
@ -1030,7 +1030,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/server/plugin.ts",
|
||||
"lineNumber": 122
|
||||
"lineNumber": 104
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@
|
|||
},
|
||||
"<Params>, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"muteAll\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"mutedInstanceIds\" | \"executionStatus\">>; delete: ({ id }: { id: string; }) => Promise<{}>; create: <Params extends Record<string, unknown> = never>({ data, options, }: ",
|
||||
"CreateOptions",
|
||||
"<Params>) => Promise<",
|
||||
"<Params>) => Promise<Pick<",
|
||||
{
|
||||
"pluginId": "alerting",
|
||||
"scope": "common",
|
||||
|
@ -1126,7 +1126,7 @@
|
|||
"section": "def-common.Alert",
|
||||
"text": "Alert"
|
||||
},
|
||||
"<Params>>; find: <Params>({ options: { fields, ...options }, }?: { options?: ",
|
||||
"<Params>, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"muteAll\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"mutedInstanceIds\" | \"executionStatus\">>; find: <Params>({ options: { fields, ...options }, }?: { options?: ",
|
||||
"FindOptions",
|
||||
" | undefined; }) => Promise<",
|
||||
{
|
||||
|
@ -2922,7 +2922,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/common/index.ts",
|
||||
"lineNumber": 28
|
||||
"lineNumber": 30
|
||||
},
|
||||
"signature": [
|
||||
"\"alerts\""
|
||||
|
@ -3006,16 +3006,16 @@
|
|||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-common.BASE_ALERT_API_PATH",
|
||||
"id": "def-common.BASE_ALERTING_API_PATH",
|
||||
"type": "string",
|
||||
"label": "BASE_ALERT_API_PATH",
|
||||
"label": "BASE_ALERTING_API_PATH",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/common/index.ts",
|
||||
"lineNumber": 27
|
||||
"lineNumber": 28
|
||||
},
|
||||
"signature": [
|
||||
"\"/api/alerts\""
|
||||
"\"/api/alerting\""
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -3034,6 +3034,36 @@
|
|||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-common.INTERNAL_BASE_ALERTING_API_PATH",
|
||||
"type": "string",
|
||||
"label": "INTERNAL_BASE_ALERTING_API_PATH",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/common/index.ts",
|
||||
"lineNumber": 29
|
||||
},
|
||||
"signature": [
|
||||
"\"/internal/alerting\""
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-common.LEGACY_BASE_ALERT_API_PATH",
|
||||
"type": "string",
|
||||
"label": "LEGACY_BASE_ALERT_API_PATH",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/alerting/common/index.ts",
|
||||
"lineNumber": 27
|
||||
},
|
||||
"signature": [
|
||||
"\"/api/alerts\""
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"id": "def-common.RawAlertInstance",
|
||||
"type": "Type",
|
||||
|
|
|
@ -747,7 +747,7 @@
|
|||
"text": "APMEventESSearchRequest"
|
||||
},
|
||||
">(params: TParams, { includeLegacyData }?: { includeLegacyData?: boolean | undefined; }): Promise<",
|
||||
"ESSearchResponse",
|
||||
"InferSearchResponseOf",
|
||||
"<TypeOfProcessorEvent<",
|
||||
"ValuesType"
|
||||
]
|
||||
|
|
|
@ -1431,7 +1431,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/public/doc_links/doc_links_service.ts",
|
||||
"lineNumber": 301
|
||||
"lineNumber": 302
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1442,7 +1442,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/public/doc_links/doc_links_service.ts",
|
||||
"lineNumber": 302
|
||||
"lineNumber": 303
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1453,7 +1453,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/public/doc_links/doc_links_service.ts",
|
||||
"lineNumber": 303
|
||||
"lineNumber": 304
|
||||
},
|
||||
"signature": [
|
||||
"{ readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record<string, string>; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; }; readonly auditbeat: { readonly base: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: string; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; }; readonly addData: string; readonly kibana: string; readonly elasticsearch: Record<string, string>; readonly siem: { readonly guide: string; readonly gettingStarted: string; }; readonly query: { readonly eql: string; readonly luceneQuerySyntax: string; readonly queryDsl: string; readonly kueryQuerySyntax: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record<string, string>; readonly ml: Record<string, string>; readonly transforms: Record<string, string>; readonly visualize: Record<string, string>; readonly apis: Readonly<{ createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putWatch: string; updateTransform: string; }>; readonly observability: Record<string, string>; readonly alerting: Record<string, string>; readonly maps: Record<string, string>; readonly monitoring: Record<string, string>; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record<string, string>; readonly ccs: Record<string, string>; readonly plugins: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; }"
|
||||
|
@ -1462,7 +1462,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/public/doc_links/doc_links_service.ts",
|
||||
"lineNumber": 300
|
||||
"lineNumber": 301
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -3833,7 +3833,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 141
|
||||
"lineNumber": 142
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -3842,7 +3842,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 139
|
||||
"lineNumber": 140
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -3865,7 +3865,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 78
|
||||
"lineNumber": 79
|
||||
},
|
||||
"signature": [
|
||||
"string | string[]"
|
||||
|
@ -3879,7 +3879,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 79
|
||||
"lineNumber": 80
|
||||
},
|
||||
"signature": [
|
||||
"number | undefined"
|
||||
|
@ -3893,7 +3893,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 80
|
||||
"lineNumber": 81
|
||||
},
|
||||
"signature": [
|
||||
"number | undefined"
|
||||
|
@ -3907,7 +3907,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 81
|
||||
"lineNumber": 82
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -3916,15 +3916,15 @@
|
|||
{
|
||||
"tags": [],
|
||||
"id": "def-public.SavedObjectsFindOptions.sortOrder",
|
||||
"type": "string",
|
||||
"type": "CompoundType",
|
||||
"label": "sortOrder",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 82
|
||||
"lineNumber": 83
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
"\"asc\" | \"desc\" | \"_doc\" | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -3937,7 +3937,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 88
|
||||
"lineNumber": 89
|
||||
},
|
||||
"signature": [
|
||||
"string[] | undefined"
|
||||
|
@ -3953,7 +3953,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 90
|
||||
"lineNumber": 91
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -3969,7 +3969,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 92
|
||||
"lineNumber": 93
|
||||
},
|
||||
"signature": [
|
||||
"string[] | undefined"
|
||||
|
@ -3985,10 +3985,10 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 96
|
||||
"lineNumber": 97
|
||||
},
|
||||
"signature": [
|
||||
"unknown[] | undefined"
|
||||
"string[] | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -4001,7 +4001,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 101
|
||||
"lineNumber": 102
|
||||
},
|
||||
"signature": [
|
||||
"string[] | undefined"
|
||||
|
@ -4017,7 +4017,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 107
|
||||
"lineNumber": 108
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -4048,7 +4048,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 111
|
||||
"lineNumber": 112
|
||||
},
|
||||
"signature": [
|
||||
"\"AND\" | \"OR\" | undefined"
|
||||
|
@ -4064,7 +4064,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 116
|
||||
"lineNumber": 117
|
||||
},
|
||||
"signature": [
|
||||
"\"AND\" | \"OR\" | undefined"
|
||||
|
@ -4078,7 +4078,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 117
|
||||
"lineNumber": 118
|
||||
},
|
||||
"signature": [
|
||||
"any"
|
||||
|
@ -4092,7 +4092,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 118
|
||||
"lineNumber": 119
|
||||
},
|
||||
"signature": [
|
||||
"string[] | undefined"
|
||||
|
@ -4108,7 +4108,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 126
|
||||
"lineNumber": 127
|
||||
},
|
||||
"signature": [
|
||||
"Map<string, string[] | undefined> | undefined"
|
||||
|
@ -4124,7 +4124,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 128
|
||||
"lineNumber": 129
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -4140,7 +4140,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 132
|
||||
"lineNumber": 133
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -4156,7 +4156,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 77
|
||||
"lineNumber": 78
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -4177,7 +4177,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 61
|
||||
"lineNumber": 62
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -4188,13 +4188,13 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 62
|
||||
"lineNumber": 63
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 60
|
||||
"lineNumber": 61
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -5753,7 +5753,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/saved_objects/types.ts",
|
||||
"lineNumber": 226
|
||||
"lineNumber": 227
|
||||
},
|
||||
"signature": [
|
||||
"\"multiple\" | \"single\" | \"multiple-isolated\" | \"agnostic\""
|
||||
|
@ -8002,7 +8002,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 459
|
||||
"lineNumber": 462
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8024,7 +8024,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 461
|
||||
"lineNumber": 464
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8046,7 +8046,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 463
|
||||
"lineNumber": 466
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8068,7 +8068,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 465
|
||||
"lineNumber": 468
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8099,7 +8099,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 470
|
||||
"lineNumber": 473
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8121,7 +8121,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 472
|
||||
"lineNumber": 475
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8143,7 +8143,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 474
|
||||
"lineNumber": 477
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8165,7 +8165,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 476
|
||||
"lineNumber": 479
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8187,7 +8187,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 478
|
||||
"lineNumber": 481
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8209,7 +8209,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 480
|
||||
"lineNumber": 483
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8231,7 +8231,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 482
|
||||
"lineNumber": 485
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8247,7 +8247,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 457
|
||||
"lineNumber": 460
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -8272,7 +8272,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 505
|
||||
"lineNumber": 508
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8294,7 +8294,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 507
|
||||
"lineNumber": 510
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8316,7 +8316,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 509
|
||||
"lineNumber": 512
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8338,7 +8338,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 511
|
||||
"lineNumber": 514
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8360,7 +8360,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 513
|
||||
"lineNumber": 516
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8382,7 +8382,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 515
|
||||
"lineNumber": 518
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -8397,7 +8397,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 503
|
||||
"lineNumber": 506
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -14272,7 +14272,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 425
|
||||
"lineNumber": 428
|
||||
},
|
||||
"signature": [
|
||||
"{ savedObjects: { client: Pick<",
|
||||
|
@ -14283,7 +14283,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">; typeRegistry: Pick<",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">; typeRegistry: Pick<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -14307,7 +14307,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">; getExporter: (client: Pick<",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">; getExporter: (client: Pick<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -14320,7 +14320,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 424
|
||||
"lineNumber": 427
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -15689,7 +15689,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">) => ",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">) => ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -15715,7 +15715,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">"
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">"
|
||||
],
|
||||
"description": [],
|
||||
"source": {
|
||||
|
@ -15965,7 +15965,7 @@
|
|||
"lineNumber": 22
|
||||
},
|
||||
"signature": [
|
||||
"Pick<KibanaClient, \"get\" | \"delete\" | \"create\" | \"helpers\" | \"count\" | \"update\" | \"index\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"closePointInTime\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: TransportRequestParams, options?: TransportRequestOptions | undefined): TransportRequestPromise<ApiResponse>; }; }"
|
||||
"Pick<KibanaClient, \"get\" | \"delete\" | \"create\" | \"helpers\" | \"count\" | \"update\" | \"index\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"closePointInTime\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: TransportRequestParams, options?: TransportRequestOptions | undefined): TransportRequestPromise<ApiResponse>; }; }"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -16616,7 +16616,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/core/server/index.ts",
|
||||
"lineNumber": 493
|
||||
"lineNumber": 496
|
||||
},
|
||||
"signature": [
|
||||
"() => Promise<[",
|
||||
|
|
|
@ -974,7 +974,7 @@
|
|||
"lineNumber": 197
|
||||
},
|
||||
"signature": [
|
||||
"\"error\" | \"manual\" | \"follow\" | undefined"
|
||||
"\"error\" | \"follow\" | \"manual\" | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7111,8 +7111,7 @@
|
|||
"docId": "kibDataSearchPluginApi",
|
||||
"section": "def-common.ISearchRequestParams",
|
||||
"text": "ISearchRequestParams"
|
||||
},
|
||||
"<Record<string, any>>"
|
||||
}
|
||||
],
|
||||
"description": [],
|
||||
"children": [
|
||||
|
@ -8785,7 +8784,7 @@
|
|||
"section": "def-common.ISearchRequestParams",
|
||||
"text": "ISearchRequestParams"
|
||||
},
|
||||
"<Record<string, any>>>"
|
||||
">"
|
||||
],
|
||||
"description": [],
|
||||
"tags": [],
|
||||
|
@ -8798,7 +8797,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 20
|
||||
"lineNumber": 19
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -8807,7 +8806,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 19
|
||||
"lineNumber": 18
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -10866,7 +10865,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 37
|
||||
"lineNumber": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -10877,7 +10876,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 38
|
||||
"lineNumber": 41
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -10888,7 +10887,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 39
|
||||
"lineNumber": 42
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -10899,7 +10898,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 40
|
||||
"lineNumber": 43
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -10910,7 +10909,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 41
|
||||
"lineNumber": 44
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -10921,13 +10920,13 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 42
|
||||
"lineNumber": 45
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/search_source/fetch/types.ts",
|
||||
"lineNumber": 36
|
||||
"lineNumber": 39
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -11587,7 +11586,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 13
|
||||
"lineNumber": 12
|
||||
},
|
||||
"signature": [
|
||||
"\"es\""
|
||||
|
@ -11711,7 +11710,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/expressions/kibana_context.ts",
|
||||
"lineNumber": 26
|
||||
"lineNumber": 34
|
||||
},
|
||||
"signature": [
|
||||
"ExpressionFunctionDefinition<\"kibana_context\", ",
|
||||
|
@ -11854,10 +11853,10 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 23
|
||||
"lineNumber": 22
|
||||
},
|
||||
"signature": [
|
||||
"IKibanaSearchResponse<SearchResponse<Source>>"
|
||||
"IKibanaSearchResponse<estypes.SearchResponse<Source>>"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -11950,7 +11949,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 34
|
||||
"lineNumber": 35
|
||||
},
|
||||
"signature": [
|
||||
"ExpressionFunctionDefinition<\"indexPatternLoad\", null, Arguments, Output, ",
|
||||
|
@ -14590,15 +14589,7 @@
|
|||
"lineNumber": 46
|
||||
},
|
||||
"signature": [
|
||||
"{ addQuerySuggestionProvider: (language: string, provider: ",
|
||||
{
|
||||
"pluginId": "data",
|
||||
"scope": "public",
|
||||
"docId": "kibDataAutocompletePluginApi",
|
||||
"section": "def-public.QuerySuggestionGetFn",
|
||||
"text": "QuerySuggestionGetFn"
|
||||
},
|
||||
") => void; getQuerySuggestions: ",
|
||||
"{ getQuerySuggestions: ",
|
||||
{
|
||||
"pluginId": "data",
|
||||
"scope": "public",
|
||||
|
@ -15266,7 +15257,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">, elasticsearchClient: ",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">, elasticsearchClient: ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -15293,7 +15284,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/plugin.ts",
|
||||
"lineNumber": 107
|
||||
"lineNumber": 104
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -15301,7 +15292,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/plugin.ts",
|
||||
"lineNumber": 107
|
||||
"lineNumber": 104
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -15317,7 +15308,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/plugin.ts",
|
||||
"lineNumber": 121
|
||||
"lineNumber": 118
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -19756,7 +19747,7 @@
|
|||
"section": "def-common.ISearchRequestParams",
|
||||
"text": "ISearchRequestParams"
|
||||
},
|
||||
"<Record<string, any>>>"
|
||||
">"
|
||||
],
|
||||
"description": [],
|
||||
"tags": [],
|
||||
|
@ -19769,7 +19760,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 20
|
||||
"lineNumber": 19
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -19778,7 +19769,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 19
|
||||
"lineNumber": 18
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -20682,7 +20673,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 13
|
||||
"lineNumber": 12
|
||||
},
|
||||
"signature": [
|
||||
"\"es\""
|
||||
|
@ -20776,7 +20767,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/expressions/kibana_context.ts",
|
||||
"lineNumber": 26
|
||||
"lineNumber": 34
|
||||
},
|
||||
"signature": [
|
||||
"ExpressionFunctionDefinition<\"kibana_context\", ",
|
||||
|
@ -20885,10 +20876,10 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/search/es_search/types.ts",
|
||||
"lineNumber": 23
|
||||
"lineNumber": 22
|
||||
},
|
||||
"signature": [
|
||||
"IKibanaSearchResponse<SearchResponse<Source>>"
|
||||
"IKibanaSearchResponse<estypes.SearchResponse<Source>>"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -20966,7 +20957,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 34
|
||||
"lineNumber": 35
|
||||
},
|
||||
"signature": [
|
||||
"ExpressionFunctionDefinition<\"indexPatternLoad\", null, Arguments, Output, ",
|
||||
|
|
|
@ -324,7 +324,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/public/autocomplete/autocomplete_service.ts",
|
||||
"lineNumber": 93
|
||||
"lineNumber": 96
|
||||
},
|
||||
"signature": [
|
||||
"{ getQuerySuggestions: QuerySuggestionGetFn; hasQuerySuggestions: (language: string) => boolean; getValueSuggestions: ValueSuggestionsGetFn; }"
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/data_enhanced/public/plugin.ts",
|
||||
"lineNumber": 40
|
||||
"lineNumber": 38
|
||||
},
|
||||
"signature": [
|
||||
"void"
|
||||
|
@ -903,9 +903,7 @@
|
|||
"lineNumber": 27
|
||||
},
|
||||
"signature": [
|
||||
"IKibanaSearchResponse<ApiResponse<T, ",
|
||||
"Context",
|
||||
">>"
|
||||
"IKibanaSearchResponse<ApiResponse<T, unknown>>"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
|
|
@ -368,7 +368,7 @@
|
|||
"section": "def-server.DataPluginStart",
|
||||
"text": "DataPluginStart"
|
||||
},
|
||||
">, { logger, expressions }: ",
|
||||
">, { expressions }: ",
|
||||
{
|
||||
"pluginId": "data",
|
||||
"scope": "server",
|
||||
|
@ -413,12 +413,12 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 49
|
||||
"lineNumber": 47
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Object",
|
||||
"label": "{ logger, expressions }",
|
||||
"label": "{ expressions }",
|
||||
"isRequired": true,
|
||||
"signature": [
|
||||
{
|
||||
|
@ -432,7 +432,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 50
|
||||
"lineNumber": 48
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -440,7 +440,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 48
|
||||
"lineNumber": 46
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -472,7 +472,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">, elasticsearchClient: ",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">, elasticsearchClient: ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -507,7 +507,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 76
|
||||
"lineNumber": 58
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -526,7 +526,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 76
|
||||
"lineNumber": 58
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -534,13 +534,13 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 76
|
||||
"lineNumber": 58
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/data/server/index_patterns/index_patterns_service.ts",
|
||||
"lineNumber": 47
|
||||
"lineNumber": 45
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
|
@ -3992,7 +3992,7 @@
|
|||
"label": "getIndexPatternLoadMeta",
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 41
|
||||
"lineNumber": 42
|
||||
},
|
||||
"tags": [],
|
||||
"returnComment": [],
|
||||
|
@ -6040,7 +6040,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 18
|
||||
"lineNumber": 19
|
||||
},
|
||||
"signature": [
|
||||
"\"index_pattern\""
|
||||
|
@ -6054,7 +6054,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 19
|
||||
"lineNumber": 20
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -6069,7 +6069,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 17
|
||||
"lineNumber": 18
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -6780,7 +6780,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts",
|
||||
"lineNumber": 34
|
||||
"lineNumber": 35
|
||||
},
|
||||
"signature": [
|
||||
"ExpressionFunctionDefinition<\"indexPatternLoad\", null, Arguments, Output, ",
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,6 +36,9 @@ import dataSearchObj from './data_search.json';
|
|||
### Interfaces
|
||||
<DocDefinitionList data={dataSearchObj.server.interfaces}/>
|
||||
|
||||
### Consts, variables and types
|
||||
<DocDefinitionList data={dataSearchObj.server.misc}/>
|
||||
|
||||
## Common
|
||||
|
||||
### Objects
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts",
|
||||
"lineNumber": 35
|
||||
"lineNumber": 36
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -236,7 +236,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts",
|
||||
"lineNumber": 36
|
||||
"lineNumber": 37
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -247,7 +247,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts",
|
||||
"lineNumber": 37
|
||||
"lineNumber": 38
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -258,7 +258,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts",
|
||||
"lineNumber": 38
|
||||
"lineNumber": 39
|
||||
},
|
||||
"signature": [
|
||||
"(Readonly<{ '@timestamp'?: string | undefined; kibana?: Readonly<{ server_uuid?: string | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; } & {}>[] | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ message?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; end?: string | undefined; action?: string | undefined; provider?: string | undefined; duration?: number | undefined; outcome?: string | undefined; reason?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]"
|
||||
|
@ -267,7 +267,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts",
|
||||
"lineNumber": 34
|
||||
"lineNumber": 35
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
|
|
|
@ -1562,7 +1562,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 223
|
||||
"lineNumber": 230
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1570,7 +1570,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 223
|
||||
"lineNumber": 230
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1606,7 +1606,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1619,7 +1619,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1627,7 +1627,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1670,7 +1670,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1683,7 +1683,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1691,7 +1691,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1715,7 +1715,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 250
|
||||
"lineNumber": 258
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -2975,7 +2975,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 40
|
||||
"lineNumber": 35
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -2983,7 +2983,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 40
|
||||
"lineNumber": 35
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3028,7 +3028,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 56
|
||||
"lineNumber": 45
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -3036,7 +3036,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 56
|
||||
"lineNumber": 45
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3079,7 +3079,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 70
|
||||
"lineNumber": 59
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -3087,7 +3087,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 70
|
||||
"lineNumber": 59
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3103,13 +3103,13 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 86
|
||||
"lineNumber": 75
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 37
|
||||
"lineNumber": 32
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -3180,7 +3180,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 40
|
||||
"lineNumber": 35
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -3188,7 +3188,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 40
|
||||
"lineNumber": 35
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3233,7 +3233,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 56
|
||||
"lineNumber": 45
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -3241,7 +3241,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 56
|
||||
"lineNumber": 45
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3284,7 +3284,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 70
|
||||
"lineNumber": 59
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -3292,7 +3292,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 70
|
||||
"lineNumber": 59
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -3308,13 +3308,13 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 86
|
||||
"lineNumber": 75
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 37
|
||||
"lineNumber": 32
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -5908,7 +5908,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 28
|
||||
"lineNumber": 27
|
||||
},
|
||||
"signature": [
|
||||
"() => ExecutionContextSearch"
|
||||
|
@ -5924,7 +5924,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 32
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, unknown>"
|
||||
|
@ -5940,7 +5940,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 38
|
||||
"lineNumber": 37
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, ",
|
||||
|
@ -5964,7 +5964,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 43
|
||||
"lineNumber": 42
|
||||
},
|
||||
"signature": [
|
||||
"AbortSignal"
|
||||
|
@ -5980,7 +5980,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 48
|
||||
"lineNumber": 47
|
||||
},
|
||||
"signature": [
|
||||
"InspectorAdapters"
|
||||
|
@ -5996,7 +5996,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 53
|
||||
"lineNumber": 52
|
||||
},
|
||||
"signature": [
|
||||
"() => string | undefined"
|
||||
|
@ -6012,7 +6012,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 60
|
||||
"lineNumber": 59
|
||||
},
|
||||
"signature": [
|
||||
"(() => ",
|
||||
|
@ -6026,46 +6026,6 @@
|
|||
"<unknown, unknown, unknown, any>) | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ExecutionContext.getSavedObject",
|
||||
"type": "Function",
|
||||
"label": "getSavedObject",
|
||||
"description": [
|
||||
"\nAllows to fetch saved objects from ElasticSearch. In browser `getSavedObject`\nfunction is provided automatically by the Expressions plugin. On the server\nthe caller of the expression has to provide this context function. The\nreason is because on the browser we always know the user who tries to\nfetch a saved object, thus saved object client is scoped automatically to\nthat user. However, on the server we can scope that saved object client to\nany user, or even not scope it at all and execute it as an \"internal\" user."
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 71
|
||||
},
|
||||
"signature": [
|
||||
"(<T extends ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObjectAttributes",
|
||||
"text": "SavedObjectAttributes"
|
||||
},
|
||||
" = ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObjectAttributes",
|
||||
"text": "SavedObjectAttributes"
|
||||
},
|
||||
">(type: string, id: string) => Promise<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObject",
|
||||
"text": "SavedObject"
|
||||
},
|
||||
"<T>>) | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ExecutionContext.isSyncColorsEnabled",
|
||||
|
@ -6076,7 +6036,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 79
|
||||
"lineNumber": 64
|
||||
},
|
||||
"signature": [
|
||||
"(() => boolean) | undefined"
|
||||
|
@ -6085,7 +6045,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 21
|
||||
"lineNumber": 20
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -9481,7 +9441,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 24
|
||||
"lineNumber": 19
|
||||
},
|
||||
"signature": [
|
||||
"{ readonly getType: (name: string) => ",
|
||||
|
@ -9562,7 +9522,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 30
|
||||
"lineNumber": 25
|
||||
},
|
||||
"signature": [
|
||||
"typeof ",
|
||||
|
@ -9583,7 +9543,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 31
|
||||
"lineNumber": 26
|
||||
},
|
||||
"signature": [
|
||||
"typeof ",
|
||||
|
@ -9604,7 +9564,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 32
|
||||
"lineNumber": 27
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -9624,7 +9584,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 28
|
||||
},
|
||||
"signature": [
|
||||
"({ className, dataAttrs, padding, renderError, expression, onEvent, onData$, reload$, debounce, ...expressionLoaderOptions }: ",
|
||||
|
@ -9646,7 +9606,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 34
|
||||
"lineNumber": 29
|
||||
},
|
||||
"signature": [
|
||||
"typeof ",
|
||||
|
@ -9662,7 +9622,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/public/plugin.ts",
|
||||
"lineNumber": 29
|
||||
"lineNumber": 24
|
||||
},
|
||||
"lifecycle": "start",
|
||||
"initialIsOpen": true
|
||||
|
@ -11035,7 +10995,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 223
|
||||
"lineNumber": 230
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -11043,7 +11003,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 223
|
||||
"lineNumber": 230
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -11079,7 +11039,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -11092,7 +11052,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -11100,7 +11060,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -11143,7 +11103,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -11156,7 +11116,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -11164,7 +11124,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -11188,7 +11148,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 250
|
||||
"lineNumber": 258
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -13984,7 +13944,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 28
|
||||
"lineNumber": 27
|
||||
},
|
||||
"signature": [
|
||||
"() => ExecutionContextSearch"
|
||||
|
@ -14000,7 +13960,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 32
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, unknown>"
|
||||
|
@ -14016,7 +13976,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 38
|
||||
"lineNumber": 37
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, ",
|
||||
|
@ -14040,7 +14000,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 43
|
||||
"lineNumber": 42
|
||||
},
|
||||
"signature": [
|
||||
"AbortSignal"
|
||||
|
@ -14056,7 +14016,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 48
|
||||
"lineNumber": 47
|
||||
},
|
||||
"signature": [
|
||||
"InspectorAdapters"
|
||||
|
@ -14072,7 +14032,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 53
|
||||
"lineNumber": 52
|
||||
},
|
||||
"signature": [
|
||||
"() => string | undefined"
|
||||
|
@ -14088,7 +14048,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 60
|
||||
"lineNumber": 59
|
||||
},
|
||||
"signature": [
|
||||
"(() => ",
|
||||
|
@ -14102,46 +14062,6 @@
|
|||
"<unknown, unknown, unknown, any>) | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ExecutionContext.getSavedObject",
|
||||
"type": "Function",
|
||||
"label": "getSavedObject",
|
||||
"description": [
|
||||
"\nAllows to fetch saved objects from ElasticSearch. In browser `getSavedObject`\nfunction is provided automatically by the Expressions plugin. On the server\nthe caller of the expression has to provide this context function. The\nreason is because on the browser we always know the user who tries to\nfetch a saved object, thus saved object client is scoped automatically to\nthat user. However, on the server we can scope that saved object client to\nany user, or even not scope it at all and execute it as an \"internal\" user."
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 71
|
||||
},
|
||||
"signature": [
|
||||
"(<T extends ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObjectAttributes",
|
||||
"text": "SavedObjectAttributes"
|
||||
},
|
||||
" = ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObjectAttributes",
|
||||
"text": "SavedObjectAttributes"
|
||||
},
|
||||
">(type: string, id: string) => Promise<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObject",
|
||||
"text": "SavedObject"
|
||||
},
|
||||
"<T>>) | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ExecutionContext.isSyncColorsEnabled",
|
||||
|
@ -14152,7 +14072,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 79
|
||||
"lineNumber": 64
|
||||
},
|
||||
"signature": [
|
||||
"(() => boolean) | undefined"
|
||||
|
@ -14161,7 +14081,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 21
|
||||
"lineNumber": 20
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -18395,7 +18315,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 223
|
||||
"lineNumber": 230
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -18403,7 +18323,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 223
|
||||
"lineNumber": 230
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -18439,7 +18359,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -18452,7 +18372,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -18460,7 +18380,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 233
|
||||
"lineNumber": 241
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -18503,7 +18423,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -18516,7 +18436,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -18524,7 +18444,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 241
|
||||
"lineNumber": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -18548,7 +18468,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/executor/executor.ts",
|
||||
"lineNumber": 250
|
||||
"lineNumber": 258
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -23230,7 +23150,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 86
|
||||
"lineNumber": 71
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -23250,7 +23170,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 87
|
||||
"lineNumber": 72
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -23265,7 +23185,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 85
|
||||
"lineNumber": 70
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -23362,7 +23282,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 28
|
||||
"lineNumber": 27
|
||||
},
|
||||
"signature": [
|
||||
"() => ExecutionContextSearch"
|
||||
|
@ -23378,7 +23298,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 32
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, unknown>"
|
||||
|
@ -23394,7 +23314,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 38
|
||||
"lineNumber": 37
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, ",
|
||||
|
@ -23418,7 +23338,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 43
|
||||
"lineNumber": 42
|
||||
},
|
||||
"signature": [
|
||||
"AbortSignal"
|
||||
|
@ -23434,7 +23354,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 48
|
||||
"lineNumber": 47
|
||||
},
|
||||
"signature": [
|
||||
"InspectorAdapters"
|
||||
|
@ -23450,7 +23370,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 53
|
||||
"lineNumber": 52
|
||||
},
|
||||
"signature": [
|
||||
"() => string | undefined"
|
||||
|
@ -23466,7 +23386,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 60
|
||||
"lineNumber": 59
|
||||
},
|
||||
"signature": [
|
||||
"(() => ",
|
||||
|
@ -23480,46 +23400,6 @@
|
|||
"<unknown, unknown, unknown, any>) | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-common.ExecutionContext.getSavedObject",
|
||||
"type": "Function",
|
||||
"label": "getSavedObject",
|
||||
"description": [
|
||||
"\nAllows to fetch saved objects from ElasticSearch. In browser `getSavedObject`\nfunction is provided automatically by the Expressions plugin. On the server\nthe caller of the expression has to provide this context function. The\nreason is because on the browser we always know the user who tries to\nfetch a saved object, thus saved object client is scoped automatically to\nthat user. However, on the server we can scope that saved object client to\nany user, or even not scope it at all and execute it as an \"internal\" user."
|
||||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 71
|
||||
},
|
||||
"signature": [
|
||||
"(<T extends ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObjectAttributes",
|
||||
"text": "SavedObjectAttributes"
|
||||
},
|
||||
" = ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObjectAttributes",
|
||||
"text": "SavedObjectAttributes"
|
||||
},
|
||||
">(type: string, id: string) => Promise<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "common",
|
||||
"docId": "kibCorePluginApi",
|
||||
"section": "def-common.SavedObject",
|
||||
"text": "SavedObject"
|
||||
},
|
||||
"<T>>) | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-common.ExecutionContext.isSyncColorsEnabled",
|
||||
|
@ -23530,7 +23410,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 79
|
||||
"lineNumber": 64
|
||||
},
|
||||
"signature": [
|
||||
"(() => boolean) | undefined"
|
||||
|
@ -23539,7 +23419,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "src/plugins/expressions/common/execution/types.ts",
|
||||
"lineNumber": 21
|
||||
"lineNumber": 20
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -704,7 +704,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">; typeRegistry: Pick<",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">; typeRegistry: Pick<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
|
|
@ -1121,13 +1121,7 @@
|
|||
"lineNumber": 58
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "indexManagement",
|
||||
"scope": "common",
|
||||
"docId": "kibIndexManagementPluginApi",
|
||||
"section": "def-common.Health",
|
||||
"text": "Health"
|
||||
}
|
||||
"ClusterStatus"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/infra/server/plugin.ts",
|
||||
"lineNumber": 64
|
||||
"lineNumber": 65
|
||||
},
|
||||
"signature": [
|
||||
"{ readonly sources?: Readonly<{ default?: Readonly<{ fields?: Readonly<{ host?: string | undefined; message?: string[] | undefined; timestamp?: string | undefined; tiebreaker?: string | undefined; container?: string | undefined; pod?: string | undefined; } & {}> | undefined; logAlias?: string | undefined; metricAlias?: string | undefined; } & {}> | undefined; } & {}> | undefined; readonly enabled: boolean; readonly query: Readonly<{} & { partitionSize: number; partitionFactor: number; }>; }"
|
||||
|
@ -222,7 +222,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/infra/server/plugin.ts",
|
||||
"lineNumber": 75
|
||||
"lineNumber": 76
|
||||
},
|
||||
"signature": [
|
||||
"(sourceId: string, sourceProperties: ",
|
||||
|
@ -239,7 +239,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/infra/server/plugin.ts",
|
||||
"lineNumber": 74
|
||||
"lineNumber": 75
|
||||
},
|
||||
"lifecycle": "setup",
|
||||
"initialIsOpen": true
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
"lineNumber": 43
|
||||
},
|
||||
"signature": [
|
||||
"\"cardinality\""
|
||||
"\"unique_count\""
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -238,7 +238,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.tsx",
|
||||
"lineNumber": 73
|
||||
"lineNumber": 74
|
||||
},
|
||||
"signature": [
|
||||
"\"filters\""
|
||||
|
@ -252,7 +252,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.tsx",
|
||||
"lineNumber": 74
|
||||
"lineNumber": 75
|
||||
},
|
||||
"signature": [
|
||||
"{ filters: ",
|
||||
|
@ -269,7 +269,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.tsx",
|
||||
"lineNumber": 72
|
||||
"lineNumber": 73
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -291,7 +291,7 @@
|
|||
"lineNumber": 46
|
||||
},
|
||||
"signature": [
|
||||
"\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"counter_rate\" | \"cardinality\" | \"percentile\" | \"last_value\" | undefined"
|
||||
"\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"average\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"percentile\" | \"last_value\" | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -538,6 +538,30 @@
|
|||
"signature": [
|
||||
"() => boolean"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.LensPublicStart.getXyVisTypes",
|
||||
"type": "Function",
|
||||
"label": "getXyVisTypes",
|
||||
"description": [
|
||||
"\nMethod which returns xy VisualizationTypes array keeping this async as to not impact page load bundle"
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/plugin.ts",
|
||||
"lineNumber": 108
|
||||
},
|
||||
"signature": [
|
||||
"() => Promise<",
|
||||
{
|
||||
"pluginId": "lens",
|
||||
"scope": "public",
|
||||
"docId": "kibLensPluginApi",
|
||||
"section": "def-public.VisualizationType",
|
||||
"text": "VisualizationType"
|
||||
},
|
||||
"[]>"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
|
@ -929,7 +953,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx",
|
||||
"lineNumber": 59
|
||||
"lineNumber": 57
|
||||
},
|
||||
"signature": [
|
||||
"\"terms\""
|
||||
|
@ -943,7 +967,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx",
|
||||
"lineNumber": 60
|
||||
"lineNumber": 58
|
||||
},
|
||||
"signature": [
|
||||
"{ size: number; orderBy: { type: \"alphabetical\"; } | { type: \"column\"; columnId: string; }; orderDirection: \"asc\" | \"desc\"; otherBucket?: boolean | undefined; missingBucket?: boolean | undefined; format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; }"
|
||||
|
@ -952,7 +976,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx",
|
||||
"lineNumber": 58
|
||||
"lineNumber": 56
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -1114,7 +1138,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 420
|
||||
"lineNumber": 423
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -1134,7 +1158,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 421
|
||||
"lineNumber": 424
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -1154,7 +1178,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 422
|
||||
"lineNumber": 425
|
||||
},
|
||||
"signature": [
|
||||
"\"hide\" | \"inside\" | \"outside\" | undefined"
|
||||
|
@ -1168,7 +1192,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 423
|
||||
"lineNumber": 426
|
||||
},
|
||||
"signature": [
|
||||
"\"None\" | \"Zero\" | \"Linear\" | \"Carry\" | \"Lookahead\" | undefined"
|
||||
|
@ -1182,7 +1206,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 424
|
||||
"lineNumber": 427
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -1203,7 +1227,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 425
|
||||
"lineNumber": 428
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -1217,7 +1241,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 426
|
||||
"lineNumber": 429
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -1231,7 +1255,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 427
|
||||
"lineNumber": 430
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
|
@ -1245,7 +1269,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 428
|
||||
"lineNumber": 431
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -1266,7 +1290,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 429
|
||||
"lineNumber": 432
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -1287,7 +1311,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 430
|
||||
"lineNumber": 433
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -1299,11 +1323,25 @@
|
|||
},
|
||||
" | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.XYState.curveType",
|
||||
"type": "CompoundType",
|
||||
"label": "curveType",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 434
|
||||
},
|
||||
"signature": [
|
||||
"\"LINEAR\" | \"CURVE_MONOTONE_X\" | undefined"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/xy_visualization/types.ts",
|
||||
"lineNumber": 419
|
||||
"lineNumber": 422
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
|
@ -1318,10 +1356,10 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx",
|
||||
"lineNumber": 127
|
||||
"lineNumber": 126
|
||||
},
|
||||
"signature": [
|
||||
"BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"avg\"; }"
|
||||
"BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"average\"; }"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -1380,12 +1418,12 @@
|
|||
"tags": [],
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/derivative.tsx",
|
||||
"lineNumber": 35
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/differences.tsx",
|
||||
"lineNumber": 37
|
||||
},
|
||||
"signature": [
|
||||
"BaseIndexPatternColumn",
|
||||
" & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & ReferenceBasedIndexPatternColumn & { operationType: 'derivative'; }"
|
||||
" & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & ReferenceBasedIndexPatternColumn & { operationType: typeof OPERATION_NAME; }"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -1456,7 +1494,7 @@
|
|||
"section": "def-public.DateHistogramIndexPatternColumn",
|
||||
"text": "DateHistogramIndexPatternColumn"
|
||||
},
|
||||
" | MetricColumn<\"min\"> | MetricColumn<\"max\"> | MetricColumn<\"avg\"> | ",
|
||||
" | MetricColumn<\"min\"> | MetricColumn<\"max\"> | MetricColumn<\"average\"> | ",
|
||||
{
|
||||
"pluginId": "lens",
|
||||
"scope": "public",
|
||||
|
@ -1475,7 +1513,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx",
|
||||
"lineNumber": 129
|
||||
"lineNumber": 128
|
||||
},
|
||||
"signature": [
|
||||
"BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"max\"; }"
|
||||
|
@ -1490,7 +1528,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx",
|
||||
"lineNumber": 130
|
||||
"lineNumber": 129
|
||||
},
|
||||
"signature": [
|
||||
"BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"median\"; }"
|
||||
|
@ -1505,7 +1543,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx",
|
||||
"lineNumber": 128
|
||||
"lineNumber": 127
|
||||
},
|
||||
"signature": [
|
||||
"BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"min\"; }"
|
||||
|
@ -1541,7 +1579,7 @@
|
|||
"lineNumber": 406
|
||||
},
|
||||
"signature": [
|
||||
"\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"counter_rate\" | \"cardinality\" | \"percentile\" | \"last_value\""
|
||||
"\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"average\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"percentile\" | \"last_value\""
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -1598,7 +1636,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx",
|
||||
"lineNumber": 126
|
||||
"lineNumber": 125
|
||||
},
|
||||
"signature": [
|
||||
"BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"sum\"; }"
|
||||
|
|
|
@ -3698,6 +3698,188 @@
|
|||
"lineNumber": 48
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"id": "def-server.UpdateExceptionListItemOptions",
|
||||
"type": "Interface",
|
||||
"label": "UpdateExceptionListItemOptions",
|
||||
"description": [],
|
||||
"tags": [],
|
||||
"children": [
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions._version",
|
||||
"type": "string",
|
||||
"label": "_version",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 144
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.comments",
|
||||
"type": "Array",
|
||||
"label": "comments",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 145
|
||||
},
|
||||
"signature": [
|
||||
"({ comment: string; } & { id?: string | undefined; })[]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.entries",
|
||||
"type": "Array",
|
||||
"label": "entries",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 146
|
||||
},
|
||||
"signature": [
|
||||
"({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"long\" | \"double\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"short\" | \"binary\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"double_range\" | \"float_range\" | \"half_float\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.id",
|
||||
"type": "string",
|
||||
"label": "id",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 147
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.itemId",
|
||||
"type": "string",
|
||||
"label": "itemId",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 148
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.namespaceType",
|
||||
"type": "CompoundType",
|
||||
"label": "namespaceType",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 149
|
||||
},
|
||||
"signature": [
|
||||
"\"single\" | \"agnostic\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.name",
|
||||
"type": "string",
|
||||
"label": "name",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 150
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.osTypes",
|
||||
"type": "Array",
|
||||
"label": "osTypes",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 151
|
||||
},
|
||||
"signature": [
|
||||
"(\"windows\" | \"linux\" | \"macos\")[]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.description",
|
||||
"type": "string",
|
||||
"label": "description",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 152
|
||||
},
|
||||
"signature": [
|
||||
"string | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.meta",
|
||||
"type": "Uncategorized",
|
||||
"label": "meta",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 153
|
||||
},
|
||||
"signature": [
|
||||
"object | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.tags",
|
||||
"type": "Array",
|
||||
"label": "tags",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 154
|
||||
},
|
||||
"signature": [
|
||||
"string[] | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.UpdateExceptionListItemOptions.type",
|
||||
"type": "string",
|
||||
"label": "type",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 155
|
||||
},
|
||||
"signature": [
|
||||
"\"simple\" | undefined"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts",
|
||||
"lineNumber": 143
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
],
|
||||
"enums": [],
|
||||
|
|
1394
api_docs/ml.json
1394
api_docs/ml.json
File diff suppressed because it is too large
Load diff
|
@ -474,7 +474,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/hooks/use_fetcher.tsx",
|
||||
"lineNumber": 30
|
||||
"lineNumber": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -487,7 +487,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/hooks/use_fetcher.tsx",
|
||||
"lineNumber": 31
|
||||
"lineNumber": 32
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -505,7 +505,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/hooks/use_fetcher.tsx",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 34
|
||||
},
|
||||
"signature": [
|
||||
"boolean | undefined"
|
||||
|
@ -514,7 +514,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/hooks/use_fetcher.tsx",
|
||||
"lineNumber": 32
|
||||
"lineNumber": 33
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -522,7 +522,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/hooks/use_fetcher.tsx",
|
||||
"lineNumber": 29
|
||||
"lineNumber": 30
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -1359,6 +1359,136 @@
|
|||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"id": "def-public.ObservabilityPublicPluginsSetup",
|
||||
"type": "Interface",
|
||||
"label": "ObservabilityPublicPluginsSetup",
|
||||
"description": [],
|
||||
"tags": [],
|
||||
"children": [
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ObservabilityPublicPluginsSetup.data",
|
||||
"type": "Object",
|
||||
"label": "data",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 30
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "data",
|
||||
"scope": "public",
|
||||
"docId": "kibDataPluginApi",
|
||||
"section": "def-public.DataPublicPluginSetup",
|
||||
"text": "DataPublicPluginSetup"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ObservabilityPublicPluginsSetup.home",
|
||||
"type": "Object",
|
||||
"label": "home",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 31
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "home",
|
||||
"scope": "public",
|
||||
"docId": "kibHomePluginApi",
|
||||
"section": "def-public.HomePublicPluginSetup",
|
||||
"text": "HomePublicPluginSetup"
|
||||
},
|
||||
" | undefined"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 29
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"id": "def-public.ObservabilityPublicPluginsStart",
|
||||
"type": "Interface",
|
||||
"label": "ObservabilityPublicPluginsStart",
|
||||
"description": [],
|
||||
"tags": [],
|
||||
"children": [
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ObservabilityPublicPluginsStart.home",
|
||||
"type": "Object",
|
||||
"label": "home",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 35
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "home",
|
||||
"scope": "public",
|
||||
"docId": "kibHomePluginApi",
|
||||
"section": "def-public.HomePublicPluginStart",
|
||||
"text": "HomePublicPluginStart"
|
||||
},
|
||||
" | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ObservabilityPublicPluginsStart.data",
|
||||
"type": "Object",
|
||||
"label": "data",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 36
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "data",
|
||||
"scope": "public",
|
||||
"docId": "kibDataPluginApi",
|
||||
"section": "def-public.DataPublicPluginStart",
|
||||
"text": "DataPublicPluginStart"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ObservabilityPublicPluginsStart.lens",
|
||||
"type": "Object",
|
||||
"label": "lens",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 37
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "lens",
|
||||
"scope": "public",
|
||||
"docId": "kibLensPluginApi",
|
||||
"section": "def-public.LensPublicStart",
|
||||
"text": "LensPublicStart"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 34
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"id": "def-public.Series",
|
||||
"type": "Interface",
|
||||
|
@ -1951,21 +2081,21 @@
|
|||
],
|
||||
"objects": [],
|
||||
"setup": {
|
||||
"id": "def-public.ObservabilityPluginSetup",
|
||||
"id": "def-public.ObservabilityPublicSetup",
|
||||
"type": "Interface",
|
||||
"label": "ObservabilityPluginSetup",
|
||||
"label": "ObservabilityPublicSetup",
|
||||
"description": [],
|
||||
"tags": [],
|
||||
"children": [
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-public.ObservabilityPluginSetup.dashboard",
|
||||
"id": "def-public.ObservabilityPublicSetup.dashboard",
|
||||
"type": "Object",
|
||||
"label": "dashboard",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 25
|
||||
"lineNumber": 26
|
||||
},
|
||||
"signature": [
|
||||
"{ register: typeof ",
|
||||
|
@ -1982,20 +2112,20 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 24
|
||||
"lineNumber": 25
|
||||
},
|
||||
"lifecycle": "setup",
|
||||
"initialIsOpen": true
|
||||
},
|
||||
"start": {
|
||||
"id": "def-public.ObservabilityPluginStart",
|
||||
"id": "def-public.ObservabilityPublicStart",
|
||||
"type": "Type",
|
||||
"label": "ObservabilityPluginStart",
|
||||
"label": "ObservabilityPublicStart",
|
||||
"tags": [],
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/public/plugin.ts",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 40
|
||||
},
|
||||
"signature": [
|
||||
"void"
|
||||
|
@ -2086,8 +2216,8 @@
|
|||
"pluginId": "observability",
|
||||
"scope": "server",
|
||||
"docId": "kibObservabilityPluginApi",
|
||||
"section": "def-server.MappingsDefinition",
|
||||
"text": "MappingsDefinition"
|
||||
"section": "def-server.Mappings",
|
||||
"text": "Mappings"
|
||||
},
|
||||
"; client: ",
|
||||
{
|
||||
|
@ -2118,26 +2248,26 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 32
|
||||
"lineNumber": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.createOrUpdateIndex.{\n- index,\n mappings,\n client,\n logger,\n}.mappings",
|
||||
"type": "Object",
|
||||
"type": "CompoundType",
|
||||
"label": "mappings",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 33
|
||||
"lineNumber": 21
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
"pluginId": "observability",
|
||||
"scope": "server",
|
||||
"docId": "kibObservabilityPluginApi",
|
||||
"section": "def-server.MappingsDefinition",
|
||||
"text": "MappingsDefinition"
|
||||
"section": "def-server.Mappings",
|
||||
"text": "Mappings"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -2149,7 +2279,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 34
|
||||
"lineNumber": 22
|
||||
},
|
||||
"signature": [
|
||||
{
|
||||
|
@ -2169,7 +2299,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 35
|
||||
"lineNumber": 23
|
||||
},
|
||||
"signature": [
|
||||
"Logger"
|
||||
|
@ -2178,7 +2308,7 @@
|
|||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 31
|
||||
"lineNumber": 19
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -2186,7 +2316,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 26
|
||||
"lineNumber": 14
|
||||
},
|
||||
"initialIsOpen": false
|
||||
},
|
||||
|
@ -2224,82 +2354,32 @@
|
|||
"initialIsOpen": false
|
||||
}
|
||||
],
|
||||
"interfaces": [
|
||||
{
|
||||
"id": "def-server.MappingsDefinition",
|
||||
"type": "Interface",
|
||||
"label": "MappingsDefinition",
|
||||
"description": [],
|
||||
"tags": [],
|
||||
"children": [
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.MappingsDefinition.dynamic",
|
||||
"type": "CompoundType",
|
||||
"label": "dynamic",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 21
|
||||
},
|
||||
"signature": [
|
||||
"boolean | \"strict\" | undefined"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.MappingsDefinition.properties",
|
||||
"type": "Object",
|
||||
"label": "properties",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 22
|
||||
},
|
||||
"signature": [
|
||||
"Record<string, ",
|
||||
{
|
||||
"pluginId": "observability",
|
||||
"scope": "server",
|
||||
"docId": "kibObservabilityPluginApi",
|
||||
"section": "def-server.MappingsDefinition",
|
||||
"text": "MappingsDefinition"
|
||||
},
|
||||
" | ",
|
||||
{
|
||||
"pluginId": "observability",
|
||||
"scope": "server",
|
||||
"docId": "kibObservabilityPluginApi",
|
||||
"section": "def-server.MappingsObject",
|
||||
"text": "MappingsObject"
|
||||
},
|
||||
">"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.MappingsDefinition.dynamic_templates",
|
||||
"type": "Array",
|
||||
"label": "dynamic_templates",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 23
|
||||
},
|
||||
"signature": [
|
||||
"any[] | undefined"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 20
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
],
|
||||
"interfaces": [],
|
||||
"enums": [],
|
||||
"misc": [
|
||||
{
|
||||
"id": "def-server.Mappings",
|
||||
"type": "Type",
|
||||
"label": "Mappings",
|
||||
"tags": [],
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts",
|
||||
"lineNumber": 11
|
||||
},
|
||||
"signature": [
|
||||
"TypeMapping",
|
||||
" & { all_field?: ",
|
||||
"AllField",
|
||||
" | undefined; date_detection?: boolean | undefined; dynamic?: boolean | \"strict\" | undefined; dynamic_date_formats?: string[] | undefined; dynamic_templates?: Record<string, ",
|
||||
"DynamicTemplate",
|
||||
"> | Record<string, ",
|
||||
"DynamicTemplate",
|
||||
">[] | undefined; field_names_field?: ",
|
||||
"FieldNamesField"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
},
|
||||
{
|
||||
"id": "def-server.ObservabilityConfig",
|
||||
"type": "Type",
|
||||
|
@ -2330,7 +2410,9 @@
|
|||
"Annotation",
|
||||
"; }>; getById: (getByIdParams: { id: string; }) => Promise<",
|
||||
"GetResponse",
|
||||
">; delete: (deleteParams: { id: string; }) => Promise<Record<string, any>>; }"
|
||||
"<unknown>>; delete: (deleteParams: { id: string; }) => Promise<",
|
||||
"DeleteResponse",
|
||||
">; }"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
}
|
||||
|
|
|
@ -42,9 +42,6 @@ import observabilityObj from './observability.json';
|
|||
### Classes
|
||||
<DocDefinitionList data={observabilityObj.server.classes}/>
|
||||
|
||||
### Interfaces
|
||||
<DocDefinitionList data={observabilityObj.server.interfaces}/>
|
||||
|
||||
### Consts, variables and types
|
||||
<DocDefinitionList data={observabilityObj.server.misc}/>
|
||||
|
||||
|
|
|
@ -1285,7 +1285,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">) => Promise<",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">) => Promise<",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -1310,7 +1310,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">"
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">"
|
||||
],
|
||||
"description": [],
|
||||
"source": {
|
||||
|
|
|
@ -982,7 +982,7 @@
|
|||
"lineNumber": 109
|
||||
},
|
||||
"signature": [
|
||||
"{ type: string; reason: string; caused_by: { type: string; reason: string; }; }[] | undefined"
|
||||
"{ type: string; reason: string; caused_by?: { type: string; reason: string; } | undefined; }[] | undefined"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 75
|
||||
"lineNumber": 79
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -60,7 +60,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 75
|
||||
"lineNumber": 79
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -144,7 +144,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 98
|
||||
"lineNumber": 103
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -163,7 +163,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 98
|
||||
"lineNumber": 103
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -171,7 +171,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 98
|
||||
"lineNumber": 103
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -215,7 +215,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 348
|
||||
"lineNumber": 353
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -234,7 +234,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 348
|
||||
"lineNumber": 353
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -242,7 +242,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 348
|
||||
"lineNumber": 353
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -258,13 +258,13 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 393
|
||||
"lineNumber": 398
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/public/plugin.tsx",
|
||||
"lineNumber": 72
|
||||
"lineNumber": 75
|
||||
},
|
||||
"initialIsOpen": false
|
||||
}
|
||||
|
@ -607,7 +607,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/server/plugin.ts",
|
||||
"lineNumber": 338
|
||||
"lineNumber": 339
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -626,7 +626,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/server/plugin.ts",
|
||||
"lineNumber": 338
|
||||
"lineNumber": 339
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -634,7 +634,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/server/plugin.ts",
|
||||
"lineNumber": 338
|
||||
"lineNumber": 339
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -650,7 +650,7 @@
|
|||
"returnComment": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/security_solution/server/plugin.ts",
|
||||
"lineNumber": 404
|
||||
"lineNumber": 405
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1415,9 +1415,7 @@
|
|||
"signature": [
|
||||
"Error & Partial<",
|
||||
"ResponseError",
|
||||
"<Record<string, any>, ",
|
||||
"Context",
|
||||
">>"
|
||||
"<Record<string, any>, unknown>>"
|
||||
],
|
||||
"description": [],
|
||||
"source": {
|
||||
|
@ -1429,9 +1427,7 @@
|
|||
"signature": [
|
||||
"(err: Error & Partial<",
|
||||
"ResponseError",
|
||||
"<Record<string, any>, ",
|
||||
"Context",
|
||||
">>) => ",
|
||||
"<Record<string, any>, unknown>>) => ",
|
||||
"OutputError"
|
||||
],
|
||||
"description": [],
|
||||
|
|
|
@ -334,7 +334,7 @@
|
|||
"signature": [
|
||||
"({ esClient }: ",
|
||||
"StatsCollectionConfig",
|
||||
") => Promise<{ clusterUuid: any; }[]>"
|
||||
") => Promise<{ clusterUuid: string; }[]>"
|
||||
],
|
||||
"description": [
|
||||
"\nGet the cluster uuids from the connected cluster."
|
||||
|
@ -369,7 +369,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts",
|
||||
"lineNumber": 59
|
||||
"lineNumber": 60
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -388,7 +388,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts",
|
||||
"lineNumber": 60
|
||||
"lineNumber": 61
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -407,7 +407,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts",
|
||||
"lineNumber": 61
|
||||
"lineNumber": 62
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -434,7 +434,7 @@
|
|||
"label": "getLocalStats",
|
||||
"source": {
|
||||
"path": "src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts",
|
||||
"lineNumber": 58
|
||||
"lineNumber": 59
|
||||
},
|
||||
"tags": [],
|
||||
"returnComment": [],
|
||||
|
@ -453,7 +453,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">, uiSettingsClient: ",
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">, uiSettingsClient: ",
|
||||
{
|
||||
"pluginId": "core",
|
||||
"scope": "server",
|
||||
|
@ -478,7 +478,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">"
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">"
|
||||
],
|
||||
"description": [],
|
||||
"source": {
|
||||
|
@ -694,7 +694,7 @@
|
|||
"description": [],
|
||||
"source": {
|
||||
"path": "src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts",
|
||||
"lineNumber": 50
|
||||
"lineNumber": 51
|
||||
},
|
||||
"signature": [
|
||||
"{ timestamp: string; cluster_uuid: string; cluster_name: string; version: string; cluster_stats: any; collection: string; stack_stats: { data: DataTelemetryPayload | undefined; kibana: { count: number; indices: number; os: {}; versions: { version: string; count: number; }[]; plugins: { [plugin: string]: any; }; } | undefined; }; }"
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
"section": "def-server.SavedObjectsClient",
|
||||
"text": "SavedObjectsClient"
|
||||
},
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\">"
|
||||
", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"bulkCreate\" | \"bulkGet\" | \"bulkUpdate\" | \"errors\" | \"checkConflicts\" | \"resolve\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -11,167 +11,25 @@
|
|||
"server": {
|
||||
"classes": [],
|
||||
"functions": [],
|
||||
"interfaces": [
|
||||
"interfaces": [],
|
||||
"enums": [],
|
||||
"misc": [
|
||||
{
|
||||
"id": "def-server.ESLicense",
|
||||
"type": "Interface",
|
||||
"type": "Type",
|
||||
"label": "ESLicense",
|
||||
"description": [],
|
||||
"tags": [],
|
||||
"children": [
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.status",
|
||||
"type": "string",
|
||||
"label": "status",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 12
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.uid",
|
||||
"type": "string",
|
||||
"label": "uid",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.hkey",
|
||||
"type": "string",
|
||||
"label": "hkey",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 14
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.type",
|
||||
"type": "string",
|
||||
"label": "type",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 15
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.issue_date",
|
||||
"type": "string",
|
||||
"label": "issue_date",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 16
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.issue_date_in_millis",
|
||||
"type": "number",
|
||||
"label": "issue_date_in_millis",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 17
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.expiry_date",
|
||||
"type": "string",
|
||||
"label": "expiry_date",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 18
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.expiry_date_in_millis",
|
||||
"type": "number",
|
||||
"label": "expiry_date_in_millis",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 19
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.max_nodes",
|
||||
"type": "number",
|
||||
"label": "max_nodes",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.issued_to",
|
||||
"type": "string",
|
||||
"label": "issued_to",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 21
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.issuer",
|
||||
"type": "string",
|
||||
"label": "issuer",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 22
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.start_date_in_millis",
|
||||
"type": "number",
|
||||
"label": "start_date_in_millis",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [],
|
||||
"id": "def-server.ESLicense.max_resource_units",
|
||||
"type": "number",
|
||||
"label": "max_resource_units",
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 24
|
||||
}
|
||||
}
|
||||
],
|
||||
"description": [],
|
||||
"source": {
|
||||
"path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts",
|
||||
"lineNumber": 11
|
||||
"lineNumber": 10
|
||||
},
|
||||
"signature": [
|
||||
"estypes.LicenseInformation"
|
||||
],
|
||||
"initialIsOpen": false
|
||||
}
|
||||
],
|
||||
"enums": [],
|
||||
"misc": [],
|
||||
"objects": []
|
||||
},
|
||||
"common": {
|
||||
|
|
|
@ -13,6 +13,6 @@ import telemetryCollectionXpackObj from './telemetry_collection_xpack.json';
|
|||
|
||||
## Server
|
||||
|
||||
### Interfaces
|
||||
<DocDefinitionList data={telemetryCollectionXpackObj.server.interfaces}/>
|
||||
### Consts, variables and types
|
||||
<DocDefinitionList data={telemetryCollectionXpackObj.server.misc}/>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
{
|
||||
"pluginId": "data",
|
||||
"scope": "server",
|
||||
"docId": "kibDataPluginApi",
|
||||
"docId": "kibDataSearchPluginApi",
|
||||
"section": "def-server.DataRequestHandlerContext",
|
||||
"text": "DataRequestHandlerContext"
|
||||
},
|
||||
|
|
47
docs/api/alerting.asciidoc
Normal file
47
docs/api/alerting.asciidoc
Normal file
|
@ -0,0 +1,47 @@
|
|||
[[alerting-apis]]
|
||||
== Alerting APIs
|
||||
|
||||
The following APIs are available for {kib} alerting.
|
||||
|
||||
* <<create-rule-api, Create rule API>> to create a rule
|
||||
|
||||
* <<update-rule-api, Update rule API>> to update the attributes for existing rules
|
||||
|
||||
* <<get-rule-api, Get rule API>> to retrieve a single rule by ID
|
||||
|
||||
* <<delete-rule-api, Delete rule API>> to permanently remove a rule
|
||||
|
||||
* <<find-rules-api, Find rules API>> to retrieve a paginated set of rules by condition
|
||||
|
||||
* <<list-rule-types-api, List rule types API>> to retrieve a list of rule types
|
||||
|
||||
* <<enable-rule-api, Enable rule API>> to enable a single rule by ID
|
||||
|
||||
* <<disable-rule-api, Disable rule API>> to disable a single rule by ID
|
||||
|
||||
* <<mute-alert-api, Mute alert API>> to mute alert for a single rule by ID
|
||||
|
||||
* <<unmute-alert-api, Unmute alert API>> to unmute alert for a single rule by ID
|
||||
|
||||
* <<mute-all-alerts-api, Mute all alerts API>> to mute all alerts for a single rule by ID
|
||||
|
||||
* <<unmute-all-alerts-api, Unmute all alerts API>> to unmute all alerts for a single rule by ID
|
||||
|
||||
* <<get-alerting-framework-health-api, Get Alerting framework health API>> to retrieve the health of the Alerting framework
|
||||
|
||||
For deprecated APIs, refer to <<alerts-api>>.
|
||||
|
||||
include::alerting/create_rule.asciidoc[]
|
||||
include::alerting/update_rule.asciidoc[]
|
||||
include::alerting/get_rules.asciidoc[]
|
||||
include::alerting/delete_rule.asciidoc[]
|
||||
include::alerting/find_rules.asciidoc[]
|
||||
include::alerting/list_rule_types.asciidoc[]
|
||||
include::alerting/enable_rule.asciidoc[]
|
||||
include::alerting/disable_rule.asciidoc[]
|
||||
include::alerting/mute_all_alerts.asciidoc[]
|
||||
include::alerting/mute_alert.asciidoc[]
|
||||
include::alerting/unmute_all_alerts.asciidoc[]
|
||||
include::alerting/unmute_alert.asciidoc[]
|
||||
include::alerting/health.asciidoc[]
|
||||
include::alerting/legacy/index.asciidoc[]
|
196
docs/api/alerting/create_rule.asciidoc
Normal file
196
docs/api/alerting/create_rule.asciidoc
Normal file
|
@ -0,0 +1,196 @@
|
|||
[[create-rule-api]]
|
||||
=== Create rule API
|
||||
++++
|
||||
<titleabbrev>Create rule</titleabbrev>
|
||||
++++
|
||||
|
||||
Create {kib} rules.
|
||||
|
||||
[[create-rule-api-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<id>`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>`
|
||||
|
||||
[[create-rule-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`<id>`::
|
||||
(Optional, string) Specifies a UUID v1 or v4 to use instead of a randomly generated ID.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[create-rule-api-request-body]]
|
||||
==== Request body
|
||||
|
||||
`name`::
|
||||
(Required, string) A name to reference and search.
|
||||
|
||||
`tags`::
|
||||
(Optional, string array) A list of keywords to reference and search.
|
||||
|
||||
`rule_type_id`::
|
||||
(Required, string) The ID of the rule type that you want to call when the rule is scheduled to run.
|
||||
|
||||
`schedule`::
|
||||
(Required, object) The schedule specifying when this rule should be run, using one of the available schedule formats specified under
|
||||
+
|
||||
._Schedule Formats_.
|
||||
[%collapsible%open]
|
||||
=====
|
||||
A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule.
|
||||
|
||||
We currently support the _Interval format_ which specifies the interval in seconds, minutes, hours or days at which the rule should execute.
|
||||
Example: `{ interval: "10s" }`, `{ interval: "5m" }`, `{ interval: "1h" }`, `{ interval: "1d" }`.
|
||||
|
||||
There are plans to support multiple other schedule formats in the near future.
|
||||
=====
|
||||
|
||||
`throttle`::
|
||||
(Optional, string) How often this rule should fire the same actions. This will prevent the rule from sending out the same notification over and over. For example, if a rule with a `schedule` of 1 minute stays in a triggered state for 90 minutes, setting a `throttle` of `10m` or `1h` will prevent it from sending 90 notifications during this period.
|
||||
|
||||
`notify_when`::
|
||||
(Required, string) The condition for throttling the notification: `onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval`.
|
||||
|
||||
`enabled`::
|
||||
(Optional, boolean) Indicates if you want to run the rule on an interval basis after it is created.
|
||||
|
||||
`consumer`::
|
||||
(Required, string) The name of the application that owns the rule. This name has to match the Kibana Feature name, as that dictates the required RBAC privileges.
|
||||
|
||||
`params`::
|
||||
(Required, object) The parameters to pass to the rule type executor `params` value. This will also validate against the rule type params validator, if defined.
|
||||
|
||||
`actions`::
|
||||
(Optional, object array) An array of the following action objects.
|
||||
+
|
||||
.Properties of the action objects:
|
||||
[%collapsible%open]
|
||||
=====
|
||||
`group`:::
|
||||
(Required, string) Grouping actions is recommended for escalations for different types of alerts. If you don't need this, set this value to `default`.
|
||||
|
||||
`id`:::
|
||||
(Required, string) The ID of the connector saved object to execute.
|
||||
|
||||
`params`:::
|
||||
(Required, object) The map to the `params` that the <<action-types,connector type>> will receive. ` params` are handled as Mustache templates and passed a default set of context.
|
||||
=====
|
||||
|
||||
|
||||
[[create-rule-api-request-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
[[create-rule-api-example]]
|
||||
==== Example
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
|
||||
{
|
||||
"params":{
|
||||
"aggType":"avg",
|
||||
"termSize":6,
|
||||
"thresholdComparator":">",
|
||||
"timeWindowSize":5,
|
||||
"timeWindowUnit":"m",
|
||||
"groupBy":"top",
|
||||
"threshold":[
|
||||
1000
|
||||
],
|
||||
"index":[
|
||||
".test-index"
|
||||
],
|
||||
"timeField":"@timestamp",
|
||||
"aggField":"sheet.version",
|
||||
"termField":"name.keyword"
|
||||
},
|
||||
"consumer":"alerts",
|
||||
"rule_type_id":".index-threshold",
|
||||
"schedule":{
|
||||
"interval":"1m"
|
||||
},
|
||||
"actions":[
|
||||
{
|
||||
"id":"dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2",
|
||||
"group":"threshold met",
|
||||
"params":{
|
||||
"level":"info",
|
||||
"message":"alert '{{alertName}}' is active for group '{{context.group}}':\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}}\n- Timestamp: {{context.date}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags":[
|
||||
"cpu"
|
||||
],
|
||||
"notify_when":"onActionGroupChange",
|
||||
"name":"my alert"
|
||||
}'
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
||||
|
||||
The API returns the following:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"id": "41893910-6bca-11eb-9e0d-85d233e3ee35",
|
||||
"notify_when": "onActionGroupChange",
|
||||
"params": {
|
||||
"aggType": "avg",
|
||||
"termSize": 6,
|
||||
"thresholdComparator": ">",
|
||||
"timeWindowSize": 5,
|
||||
"timeWindowUnit": "m",
|
||||
"groupBy": "top",
|
||||
"threshold": [
|
||||
1000
|
||||
],
|
||||
"index": [
|
||||
".kibana"
|
||||
],
|
||||
"timeField": "@timestamp",
|
||||
"aggField": "sheet.version",
|
||||
"termField": "name.keyword"
|
||||
},
|
||||
"consumer": "alerts",
|
||||
"rule_type_id": ".index-threshold",
|
||||
"schedule": {
|
||||
"interval": "1m"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"connector_type_id": ".server-log",
|
||||
"group": "threshold met",
|
||||
"params": {
|
||||
"level": "info",
|
||||
"message": "alert {{alertName}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}}\n- Timestamp: {{context.date}}"
|
||||
},
|
||||
"id": "dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"cpu"
|
||||
],
|
||||
"name": "my alert",
|
||||
"enabled": true,
|
||||
"throttle": null,
|
||||
"api_key_owner": "elastic",
|
||||
"created_by": "elastic",
|
||||
"updated_by": "elastic",
|
||||
"mute_all": false,
|
||||
"muted_alert_ids": [],
|
||||
"updated_at": "2021-02-10T18:03:19.961Z",
|
||||
"created_at": "2021-02-10T18:03:19.961Z",
|
||||
"scheduled_task_id": "425b0800-6bca-11eb-9e0d-85d233e3ee35",
|
||||
"execution_status": {
|
||||
"last_execution_date": "2021-02-10T18:03:19.966Z",
|
||||
"status": "pending"
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
41
docs/api/alerting/delete_rule.asciidoc
Normal file
41
docs/api/alerting/delete_rule.asciidoc
Normal file
|
@ -0,0 +1,41 @@
|
|||
[[delete-rule-api]]
|
||||
=== Delete rule API
|
||||
++++
|
||||
<titleabbrev>Delete rule</titleabbrev>
|
||||
++++
|
||||
|
||||
Permanently remove a rule.
|
||||
|
||||
WARNING: Once you delete a rule, you cannot recover it.
|
||||
|
||||
[[delete-rule-api-request]]
|
||||
==== Request
|
||||
|
||||
`DELETE <kibana host>:<port>/api/alerting/rule/<id>`
|
||||
|
||||
`DELETE <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>`
|
||||
|
||||
[[delete-rule-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule that you want to remove.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[delete-rule-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Delete a rule with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X DELETE api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
39
docs/api/alerting/disable_rule.asciidoc
Normal file
39
docs/api/alerting/disable_rule.asciidoc
Normal file
|
@ -0,0 +1,39 @@
|
|||
[[disable-rule-api]]
|
||||
=== Disable rule API
|
||||
++++
|
||||
<titleabbrev>Disable rule</titleabbrev>
|
||||
++++
|
||||
|
||||
Disable a rule.
|
||||
|
||||
[[disable-rule-api-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<id>/_disable`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>/_disable`
|
||||
|
||||
[[disable-rule-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule that you want to disable.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[disable-rule-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Disable a rule with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_disable
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
39
docs/api/alerting/enable_rule.asciidoc
Normal file
39
docs/api/alerting/enable_rule.asciidoc
Normal file
|
@ -0,0 +1,39 @@
|
|||
[[enable-rule-api]]
|
||||
=== Enable rule API
|
||||
++++
|
||||
<titleabbrev>Enable rule</titleabbrev>
|
||||
++++
|
||||
|
||||
Enable a rule.
|
||||
|
||||
[[enable-rule-api-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<id>/_enable`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>/_enable`
|
||||
|
||||
[[enable-rule-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule that you want to enable.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[enable-rule-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Enable a rule with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_enable
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
127
docs/api/alerting/find_rules.asciidoc
Normal file
127
docs/api/alerting/find_rules.asciidoc
Normal file
|
@ -0,0 +1,127 @@
|
|||
[[find-rules-api]]
|
||||
=== Find rules API
|
||||
++++
|
||||
<titleabbrev>Find rules</titleabbrev>
|
||||
++++
|
||||
|
||||
Retrieve a paginated set of rules based on condition.
|
||||
|
||||
NOTE: As rules change in {kib}, the results on each page of the response also
|
||||
change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data.
|
||||
|
||||
[[find-rules-api-request]]
|
||||
==== Request
|
||||
|
||||
`GET <kibana host>:<port>/api/alerting/rules/_find`
|
||||
|
||||
`GET <kibana host>:<port>/s/<space_id>/api/alerting/rules/_find`
|
||||
|
||||
[[find-rules-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[find-rules-api-query-params]]
|
||||
==== Query Parameters
|
||||
|
||||
NOTE: Rule `params` are stored as a {ref}/flattened.html[flattened field type] and analyzed as keywords.
|
||||
|
||||
`per_page`::
|
||||
(Optional, number) The number of rules to return per page.
|
||||
|
||||
`page`::
|
||||
(Optional, number) The page number.
|
||||
|
||||
`search`::
|
||||
(Optional, string) An Elasticsearch {ref}/query-dsl-simple-query-string-query.html[simple_query_string] query that filters the rules in the response.
|
||||
|
||||
`default_search_operator`::
|
||||
(Optional, string) The operator to use for the `simple_query_string`. The default is 'OR'.
|
||||
|
||||
`search_fields`::
|
||||
(Optional, array|string) The fields to perform the `simple_query_string` parsed query against.
|
||||
|
||||
`fields`::
|
||||
(Optional, array|string) The fields to return in the `attributes` key of the response.
|
||||
|
||||
`sort_field`::
|
||||
(Optional, string) Sorts the response. Could be a rule field returned in the `attributes` key of the response.
|
||||
|
||||
`sort_order`::
|
||||
(Optional, string) Sort direction, either `asc` or `desc`.
|
||||
|
||||
`has_reference`::
|
||||
(Optional, object) Filters the rules that have a relation with the reference objects with the specific "type" and "ID".
|
||||
|
||||
`filter`::
|
||||
(Optional, string) A <<kuery-query, KQL>> string that you filter with an attribute from your saved object.
|
||||
It should look like savedObjectType.attributes.title: "myTitle". However, If you used a direct attribute of a saved object, such as `updatedAt`,
|
||||
you will have to define your filter, for example, savedObjectType.updatedAt > 2018-12-22.
|
||||
|
||||
[[find-rules-api-request-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Examples
|
||||
|
||||
Find rules with names that start with `my`:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X GET api/alerting/rules/_find?search_fields=name&search=my*
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
||||
|
||||
The API returns the following:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"page": 1,
|
||||
"per_page": 10,
|
||||
"total": 1,
|
||||
"data": [
|
||||
{
|
||||
"id": "0a037d60-6b62-11eb-9e0d-85d233e3ee35",
|
||||
"notify_when": "onActionGroupChange",
|
||||
"params": {
|
||||
"aggType": "avg",
|
||||
},
|
||||
"consumer": "alerts",
|
||||
"rule_type_id": "test.rule.type",
|
||||
"schedule": {
|
||||
"interval": "1m"
|
||||
},
|
||||
"actions": [],
|
||||
"tags": [],
|
||||
"name": "test rule",
|
||||
"enabled": true,
|
||||
"throttle": null,
|
||||
"api_key_owner": "elastic",
|
||||
"created_by": "elastic",
|
||||
"updated_by": "elastic",
|
||||
"mute_all": false,
|
||||
"muted_alert_ids": [],
|
||||
"updated_at": "2021-02-10T05:37:19.086Z",
|
||||
"created_at": "2021-02-10T05:37:19.086Z",
|
||||
"scheduled_task_id": "0b092d90-6b62-11eb-9e0d-85d233e3ee35",
|
||||
"execution_status": {
|
||||
"last_execution_date": "2021-02-10T17:55:14.262Z",
|
||||
"status": "ok"
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
--------------------------------------------------
|
||||
|
||||
For parameters that accept multiple values (e.g. `fields`), repeat the
|
||||
query parameter for each value:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X GET api/alerting/rules/_find?fields=id&fields=name
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
75
docs/api/alerting/get_rules.asciidoc
Normal file
75
docs/api/alerting/get_rules.asciidoc
Normal file
|
@ -0,0 +1,75 @@
|
|||
[[get-rule-api]]
|
||||
=== Get rule API
|
||||
++++
|
||||
<titleabbrev>Get rule</titleabbrev>
|
||||
++++
|
||||
|
||||
Retrieve a rule by ID.
|
||||
|
||||
[[get-rule-api-request]]
|
||||
==== Request
|
||||
|
||||
`GET <kibana host>:<port>/api/alerting/rule/<id>`
|
||||
|
||||
`GET <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>`
|
||||
|
||||
[[get-rule-api-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule to retrieve.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[get-rule-api-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
[[get-rule-api-example]]
|
||||
==== Example
|
||||
|
||||
Retrieve the rule object with the ID `41893910-6bca-11eb-9e0d-85d233e3ee35`:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X GET api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
||||
|
||||
The API returns the following:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"id": "0a037d60-6b62-11eb-9e0d-85d233e3ee35",
|
||||
"notify_when": "onActionGroupChange",
|
||||
"params": {
|
||||
"aggType": "avg",
|
||||
},
|
||||
"consumer": "alerts",
|
||||
"rule_type_id": "test.rule.type",
|
||||
"schedule": {
|
||||
"interval": "1m"
|
||||
},
|
||||
"actions": [],
|
||||
"tags": [],
|
||||
"name": "test rule",
|
||||
"enabled": true,
|
||||
"throttle": null,
|
||||
"api_key_owner": "elastic",
|
||||
"created_by": "elastic",
|
||||
"updated_by": "elastic",
|
||||
"mute_all": false,
|
||||
"muted_alert_ids": [],
|
||||
"updated_at": "2021-02-10T05:37:19.086Z",
|
||||
"created_at": "2021-02-10T05:37:19.086Z",
|
||||
"scheduled_task_id": "0b092d90-6b62-11eb-9e0d-85d233e3ee35",
|
||||
"execution_status": {
|
||||
"last_execution_date": "2021-02-10T17:55:14.262Z",
|
||||
"status": "ok"
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
93
docs/api/alerting/health.asciidoc
Normal file
93
docs/api/alerting/health.asciidoc
Normal file
|
@ -0,0 +1,93 @@
|
|||
[[get-alerting-framework-health-api]]
|
||||
=== Get Alerting framework health API
|
||||
++++
|
||||
<titleabbrev>Get Alerting framework health</titleabbrev>
|
||||
++++
|
||||
|
||||
Retrieve the health status of the Alerting framework.
|
||||
|
||||
[[get-alerting-framework-health-api-request]]
|
||||
==== Request
|
||||
|
||||
`GET <kibana host>:<port>/api/alerting/_health`
|
||||
|
||||
`GET <kibana host>:<port>/s/<space_id>/api/alerting/_health`
|
||||
|
||||
[[get-alerting-framework-health-api-params]]
|
||||
==== Path parameters
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[get-alerting-framework-health-api-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
[[get-alerting-framework-health-api-example]]
|
||||
==== Example
|
||||
|
||||
Retrieve the health status of the Alerting framework:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X GET api/alerting/_health
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
||||
|
||||
The API returns the following:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"is_sufficiently_secure":true,
|
||||
"has_permanent_encryption_key":true,
|
||||
"alerting_framework_health":{
|
||||
"decryption_health":{
|
||||
"status":"ok",
|
||||
"timestamp":"2021-02-10T23:35:04.949Z"
|
||||
},
|
||||
"execution_health":{
|
||||
"status":"ok",
|
||||
"timestamp":"2021-02-10T23:35:04.949Z"
|
||||
},
|
||||
"read_health":{
|
||||
"status":"ok",
|
||||
"timestamp":"2021-02-10T23:35:04.949Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
|
||||
The health API response contains the following properties:
|
||||
|
||||
[cols="2*<"]
|
||||
|===
|
||||
|
||||
| `is_sufficiently_secure`
|
||||
| Returns `false` if security is enabled, but TLS is not.
|
||||
|
||||
| `has_permanent_encryption_key`
|
||||
| Return the state `false` if Encrypted Saved Object plugin has not a permanent encryption Key.
|
||||
|
||||
| `alerting_framework_health`
|
||||
| This state property has three substates that identify the health of the alerting framework API: `decryption_health`, `execution_health`, and `read_health`.
|
||||
|
||||
|===
|
||||
|
||||
`alerting_framework_health` consists of the following properties:
|
||||
|
||||
[cols="2*<"]
|
||||
|===
|
||||
|
||||
| `decryption_health`
|
||||
| Returns the timestamp and status of the rule decryption: `ok`, `warn` or `error` .
|
||||
|
||||
| `execution_health`
|
||||
| Returns the timestamp and status of the rule execution: `ok`, `warn` or `error`.
|
||||
|
||||
| `read_health`
|
||||
| Returns the timestamp and status of the rule reading events: `ok`, `warn` or `error`.
|
||||
|
||||
|===
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-create]]
|
||||
=== Create alert API
|
||||
=== Legacy create alert API
|
||||
++++
|
||||
<titleabbrev>Create alert</titleabbrev>
|
||||
<titleabbrev>Legacy create alert</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<create-rule-api>> instead.
|
||||
|
||||
Create {kib} alerts.
|
||||
|
||||
[[alerts-api-create-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-delete]]
|
||||
=== Delete alert API
|
||||
=== Legacy delete alert API
|
||||
++++
|
||||
<titleabbrev>Delete alert</titleabbrev>
|
||||
<titleabbrev>Legacy delete alert</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<delete-rule-api>> instead.
|
||||
|
||||
Permanently remove an alert.
|
||||
|
||||
WARNING: Once you delete an alert, you cannot recover it.
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-disable]]
|
||||
=== Disable alert API
|
||||
=== Legacy disable alert API
|
||||
++++
|
||||
<titleabbrev>Disable alert</titleabbrev>
|
||||
<titleabbrev>Legacy disable alert</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<disable-rule-api>> instead.
|
||||
|
||||
Disable an alert.
|
||||
|
||||
[[alerts-api-disable-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-enable]]
|
||||
=== Enable alert API
|
||||
=== Legacy enable alert API
|
||||
++++
|
||||
<titleabbrev>Enable alert</titleabbrev>
|
||||
<titleabbrev>Legacy enable alert</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<enable-rule-api>> instead.
|
||||
|
||||
Enable an alert.
|
||||
|
||||
[[alerts-api-enable-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-find]]
|
||||
=== Find alerts API
|
||||
=== Legacy find alerts API
|
||||
++++
|
||||
<titleabbrev>Find alerts</titleabbrev>
|
||||
<titleabbrev>Legacy find alerts</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<find-rules-api>> instead.
|
||||
|
||||
Retrieve a paginated set of alerts based on condition.
|
||||
|
||||
NOTE: As alerts change in {kib}, the results on each page of the response also
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-get]]
|
||||
=== Get alert API
|
||||
=== Legacy get alert API
|
||||
++++
|
||||
<titleabbrev>Get alert</titleabbrev>
|
||||
<titleabbrev>Legacy get alert</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<get-rule-api>> instead.
|
||||
|
||||
Retrieve an alert by ID.
|
||||
|
||||
[[alerts-api-get-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-health]]
|
||||
=== Get Alerting framework health API
|
||||
=== Legacy get Alerting framework health API
|
||||
++++
|
||||
<titleabbrev>Get Alerting framework health</titleabbrev>
|
||||
<titleabbrev>Legacy get Alerting framework health</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<get-alerting-framework-health-api>> instead.
|
||||
|
||||
Retrieve the health status of the Alerting framework.
|
||||
|
||||
[[alerts-api-health-request]]
|
18
docs/api/alerting/legacy/index.asciidoc
Normal file
18
docs/api/alerting/legacy/index.asciidoc
Normal file
|
@ -0,0 +1,18 @@
|
|||
[[alerts-api]]
|
||||
=== Deprecated 7.x APIs
|
||||
|
||||
These APIs are deprecated and will be removed as of 8.0.
|
||||
|
||||
include::create.asciidoc[leveloffset=+1]
|
||||
include::delete.asciidoc[leveloffset=+1]
|
||||
include::disable.asciidoc[leveloffset=+1]
|
||||
include::enable.asciidoc[leveloffset=+1]
|
||||
include::find.asciidoc[leveloffset=+1]
|
||||
include::get.asciidoc[leveloffset=+1]
|
||||
include::health.asciidoc[leveloffset=+1]
|
||||
include::list.asciidoc[leveloffset=+1]
|
||||
include::mute.asciidoc[leveloffset=+1]
|
||||
include::mute_all.asciidoc[leveloffset=+1]
|
||||
include::unmute.asciidoc[leveloffset=+1]
|
||||
include::unmute_all.asciidoc[leveloffset=+1]
|
||||
include::update.asciidoc[leveloffset=+1]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-list]]
|
||||
=== List alert types API
|
||||
=== Legacy list alert types API
|
||||
++++
|
||||
<titleabbrev>List all alert types API</titleabbrev>
|
||||
<titleabbrev>Legacy list all alert types</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<list-rule-types-api>> instead.
|
||||
|
||||
Retrieve a list of all alert types.
|
||||
|
||||
[[alerts-api-list-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-mute]]
|
||||
=== Mute alert instance API
|
||||
=== Legacy mute alert instance API
|
||||
++++
|
||||
<titleabbrev>Mute alert instance</titleabbrev>
|
||||
<titleabbrev>Legacy mute alert instance</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<mute-alert-api>> instead.
|
||||
|
||||
Mute an alert instance.
|
||||
|
||||
[[alerts-api-mute-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-mute-all]]
|
||||
=== Mute all alert instances API
|
||||
=== Legacy mute all alert instances API
|
||||
++++
|
||||
<titleabbrev>Mute all alert instances</titleabbrev>
|
||||
<titleabbrev>Legacy mute all alert instances</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<mute-all-alerts-api>> instead.
|
||||
|
||||
Mute all alert instances.
|
||||
|
||||
[[alerts-api-mute-all-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-unmute]]
|
||||
=== Unmute alert instance API
|
||||
=== Legacy unmute alert instance API
|
||||
++++
|
||||
<titleabbrev>Unmute alert instance</titleabbrev>
|
||||
<titleabbrev>Legacy unmute alert instance</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<unmute-alert-api>> instead.
|
||||
|
||||
Unmute an alert instance.
|
||||
|
||||
[[alerts-api-unmute-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-unmute-all]]
|
||||
=== Unmute all alert instances API
|
||||
=== Legacy unmute all alert instances API
|
||||
++++
|
||||
<titleabbrev>Unmute all alert instances</titleabbrev>
|
||||
<titleabbrev>Legacy unmute all alert instances</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<unmute-all-alerts-api>> instead.
|
||||
|
||||
Unmute all alert instances.
|
||||
|
||||
[[alerts-api-unmute-all-request]]
|
|
@ -1,9 +1,11 @@
|
|||
[[alerts-api-update]]
|
||||
=== Update alert API
|
||||
=== Legacy update alert API
|
||||
++++
|
||||
<titleabbrev>Update alert</titleabbrev>
|
||||
<titleabbrev>Legacy update alert</titleabbrev>
|
||||
++++
|
||||
|
||||
WARNING: Deprecated in 7.13.0. Use <<update-rule-api>> instead.
|
||||
|
||||
Update the attributes for an existing alert.
|
||||
|
||||
[[alerts-api-update-request]]
|
135
docs/api/alerting/list_rule_types.asciidoc
Normal file
135
docs/api/alerting/list_rule_types.asciidoc
Normal file
|
@ -0,0 +1,135 @@
|
|||
[[list-rule-types-api]]
|
||||
=== List rule types API
|
||||
++++
|
||||
<titleabbrev>List rule types</titleabbrev>
|
||||
++++
|
||||
|
||||
Retrieve a list of alerting rule types.
|
||||
|
||||
[[list-rule-types-api-request]]
|
||||
==== Request
|
||||
|
||||
`GET <kibana host>:<port>/api/alerting/rule_types`
|
||||
|
||||
`GET <kibana host>:<port>/s/<space_id>/api/alerting/rule_types`
|
||||
|
||||
[[list-rule-types-api-params]]
|
||||
==== Path parameters
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[list-rule-types-api-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
[[list-rule-types-api-example]]
|
||||
==== Example
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X GET api/alerting/rule_types
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
||||
|
||||
The API returns the following:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
[
|
||||
{
|
||||
"id":".index-threshold",
|
||||
"name":"Index threshold",
|
||||
"action_groups":[
|
||||
{
|
||||
"id":"threshold met",
|
||||
"name":"Threshold met"
|
||||
},
|
||||
{
|
||||
"id":"recovered",
|
||||
"name":"Recovered"
|
||||
}
|
||||
],
|
||||
"recovery_action_group":{
|
||||
"id":"recovered",
|
||||
"name":"Recovered"
|
||||
},
|
||||
"default_action_group_id":"threshold met",
|
||||
"action_variables":{
|
||||
"context":[
|
||||
{
|
||||
"name":"message",
|
||||
"description":"A pre-constructed message for the alert."
|
||||
},
|
||||
],
|
||||
"state":[],
|
||||
"params":[
|
||||
{
|
||||
"name":"threshold",
|
||||
"description":"An array of values to use as the threshold; 'between' and 'notBetween' require two values, the others require one."
|
||||
},
|
||||
{
|
||||
"name":"index",
|
||||
"description":"index"
|
||||
},
|
||||
]
|
||||
},
|
||||
"producer":"stackAlerts",
|
||||
"minimum_license_required":"basic",
|
||||
"enabled_in_license":true,
|
||||
"authorized_consumers":{
|
||||
"alerts":{
|
||||
"read":true,
|
||||
"all":true
|
||||
},
|
||||
"stackAlerts":{
|
||||
"read":true,
|
||||
"all":true
|
||||
},
|
||||
"uptime":{
|
||||
"read":true,
|
||||
"all":true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
--------------------------------------------------
|
||||
|
||||
Each rule type contains the following properties:
|
||||
|
||||
[cols="2*<"]
|
||||
|===
|
||||
|
||||
| `name`
|
||||
| The descriptive name of the rule type.
|
||||
|
||||
| `id`
|
||||
| The unique ID of the rule type.
|
||||
|
||||
| `minimum_license_required`
|
||||
| The license required to use the rule type.
|
||||
|
||||
| `enabled_in_license`
|
||||
| Whether the rule type is enabled or disabled based on the license.
|
||||
|
||||
| `action_groups`
|
||||
| An explicit list of groups for which the rule type can schedule actions, each with the action group's unique ID and human readable name. Rule `actions` validation will use this configuration to ensure that groups are valid. Use `kbn-i18n` to translate the names of the action group when registering the rule type.
|
||||
|
||||
| `recovery_action_group`
|
||||
| An action group to use when an alert goes from an active state, to an inactive one. Do not specify this action group under the `action_groups` property. If `recovery_action_group` is not specified, the default `recovered` action group is used.
|
||||
|
||||
| `default_action_group_od`
|
||||
| The default ID for the rule type group.
|
||||
|
||||
| `action_variables`
|
||||
| An explicit list of action variables that the rule type makes available via context and state in action parameter templates, and a short human readable description. The Rule UI will use this information to prompt users for these variables in action parameter editors. Use `kbn-i18n` to translate the descriptions.
|
||||
|
||||
| `producer`
|
||||
| The ID of the application producing this rule type.
|
||||
|
||||
| `authorized_consumers`
|
||||
| The list of the plugins IDs that have access to the rule type.
|
||||
|
||||
|===
|
42
docs/api/alerting/mute_alert.asciidoc
Normal file
42
docs/api/alerting/mute_alert.asciidoc
Normal file
|
@ -0,0 +1,42 @@
|
|||
[[mute-alert-api]]
|
||||
=== Mute alert API
|
||||
++++
|
||||
<titleabbrev>Mute alert</titleabbrev>
|
||||
++++
|
||||
|
||||
Mute an alert.
|
||||
|
||||
[[mute-alert-api-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<rule_id>/alert/<alert_id>/_mute`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<rule_id>/alert/<alert_id>/_mute`
|
||||
|
||||
[[mute-alert-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`rule_id`::
|
||||
(Required, string) The ID of the rule whose alert you want to mute.
|
||||
|
||||
`alert_id`::
|
||||
(Required, string) The ID of the alert that you want to mute.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[mute-alert-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Mute alert with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/alert/dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2/_mute
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
39
docs/api/alerting/mute_all_alerts.asciidoc
Normal file
39
docs/api/alerting/mute_all_alerts.asciidoc
Normal file
|
@ -0,0 +1,39 @@
|
|||
[[mute-all-alerts-api]]
|
||||
=== Mute all alerts API
|
||||
++++
|
||||
<titleabbrev>Mute all alerts</titleabbrev>
|
||||
++++
|
||||
|
||||
Mute all alerts.
|
||||
|
||||
[[mute-all-alerts-api-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<id>/_mute_all`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>/_mute_all`
|
||||
|
||||
[[mute-all-alerts-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule whose alerts you want to mute.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[mute-all-alerts-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Mute all alerts with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_mute_all
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
42
docs/api/alerting/unmute_alert.asciidoc
Normal file
42
docs/api/alerting/unmute_alert.asciidoc
Normal file
|
@ -0,0 +1,42 @@
|
|||
[[unmute-alert-api]]
|
||||
=== Unmute alert API
|
||||
++++
|
||||
<titleabbrev>Unmute alert</titleabbrev>
|
||||
++++
|
||||
|
||||
Unmute an alert.
|
||||
|
||||
[[unmute-alert-api-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<rule_id>/alert/<alert_id>/_unmute`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<rule_id>/alert/<alert_id>/_unmute`
|
||||
|
||||
[[unmute-alert-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`rule_id`::
|
||||
(Required, string) The ID of the rule whose alert you want to mute.
|
||||
|
||||
`alert_id`::
|
||||
(Required, string) The ID of the alert that you want to unmute.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[unmute-alert-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Unmute alert with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/alert/dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2/_unmute
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
39
docs/api/alerting/unmute_all_alerts.asciidoc
Normal file
39
docs/api/alerting/unmute_all_alerts.asciidoc
Normal file
|
@ -0,0 +1,39 @@
|
|||
[[unmute-all-alerts-api]]
|
||||
=== Unmute all alerts API
|
||||
++++
|
||||
<titleabbrev>Unmute all alerts</titleabbrev>
|
||||
++++
|
||||
|
||||
Unmute all alerts.
|
||||
|
||||
[[unmute-all-alerts-api-all-request]]
|
||||
==== Request
|
||||
|
||||
`POST <kibana host>:<port>/api/alerting/rule/<id>/_unmute_all`
|
||||
|
||||
`POST <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>/_unmute_all`
|
||||
|
||||
[[unmute-all-alerts-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule whose alerts you want to unmute.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[unmute-all-alerts-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
==== Example
|
||||
|
||||
Unmute all alerts with ID:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X POST api/alerting/rule/41893910-6bca-11eb-9e0d-85d233e3ee35/_unmute_all
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
136
docs/api/alerting/update_rule.asciidoc
Normal file
136
docs/api/alerting/update_rule.asciidoc
Normal file
|
@ -0,0 +1,136 @@
|
|||
[[update-rule-api]]
|
||||
=== Update rule API
|
||||
++++
|
||||
<titleabbrev>Update rule</titleabbrev>
|
||||
++++
|
||||
|
||||
Update the attributes for an existing rule.
|
||||
|
||||
[[update-rule-api-request]]
|
||||
==== Request
|
||||
|
||||
`PUT <kibana host>:<port>/api/alerting/rule/<id>`
|
||||
|
||||
`PUT <kibana host>:<port>/s/<space_id>/api/alerting/rule/<id>`
|
||||
|
||||
[[update-rule-api-path-params]]
|
||||
==== Path parameters
|
||||
|
||||
`id`::
|
||||
(Required, string) The ID of the rule that you want to update.
|
||||
|
||||
`space_id`::
|
||||
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
||||
|
||||
[[update-rule-api-request-body]]
|
||||
==== Request body
|
||||
|
||||
`name`::
|
||||
(Required, string) A name to reference and search.
|
||||
|
||||
`tags`::
|
||||
(Optional, string array) A list of keywords to reference and search.
|
||||
|
||||
`schedule`::
|
||||
(Required, object) When to run this rule. Use one of the available schedule formats.
|
||||
+
|
||||
._Schedule Formats_.
|
||||
[%collapsible%open]
|
||||
=====
|
||||
A schedule uses a key: value format. {kib} currently supports the _Interval format_ , which specifies the interval in seconds, minutes, hours, or days at which to execute the rule.
|
||||
|
||||
Example: `{ interval: "10s" }`, `{ interval: "5m" }`, `{ interval: "1h" }`, `{ interval: "1d" }`.
|
||||
|
||||
=====
|
||||
|
||||
`throttle`::
|
||||
(Optional, string) How often this rule should fire the same actions. This will prevent the rule from sending out the same notification over and over. For example, if a rule with a `schedule` of 1 minute stays in a triggered state for 90 minutes, setting a `throttle` of `10m` or `1h` will prevent it from sending 90 notifications during this period.
|
||||
|
||||
`notify_when`::
|
||||
(Required, string) The condition for throttling the notification: `onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval`.
|
||||
|
||||
`params`::
|
||||
(Required, object) The parameters to pass to the rule type executor `params` value. This will also validate against the rule type params validator, if defined.
|
||||
|
||||
`actions`::
|
||||
(Optional, object array) An array of the following action objects.
|
||||
+
|
||||
.Properties of the action objects:
|
||||
[%collapsible%open]
|
||||
=====
|
||||
`group`:::
|
||||
(Required, string) Grouping actions is recommended for escalations for different types of alerts. If you don't need this, set the value to `default`.
|
||||
|
||||
`id`:::
|
||||
(Required, string) The ID of the action that saved object executes.
|
||||
|
||||
`params`:::
|
||||
(Required, object) The map to the `params` that the <<action-types,connector type>> will receive. `params` are handled as Mustache templates and passed a default set of context.
|
||||
=====
|
||||
|
||||
|
||||
[[update-rule-api-response-codes]]
|
||||
==== Response code
|
||||
|
||||
`200`::
|
||||
Indicates a successful call.
|
||||
|
||||
[[update-rule-api-example]]
|
||||
==== Example
|
||||
|
||||
Update a rule with ID `ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74` with a different name:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
$ curl -X PUT api/alerting/rule/ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
|
||||
|
||||
{
|
||||
"notify_when": "onActionGroupChange",
|
||||
"params": {
|
||||
"aggType": "avg",
|
||||
},
|
||||
"schedule": {
|
||||
"interval": "1m"
|
||||
},
|
||||
"actions": [],
|
||||
"tags": [],
|
||||
"name": "new name",
|
||||
"throttle": null,
|
||||
}
|
||||
--------------------------------------------------
|
||||
// KIBANA
|
||||
|
||||
The API returns the following:
|
||||
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"id": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74",
|
||||
"notify_when": "onActionGroupChange",
|
||||
"params": {
|
||||
"aggType": "avg",
|
||||
},
|
||||
"consumer": "alerts",
|
||||
"rule_type_id": "test.rule.type",
|
||||
"schedule": {
|
||||
"interval": "1m"
|
||||
},
|
||||
"actions": [],
|
||||
"tags": [],
|
||||
"name": "new name",
|
||||
"enabled": true,
|
||||
"throttle": null,
|
||||
"api_key_owner": "elastic",
|
||||
"created_by": "elastic",
|
||||
"updated_by": "elastic",
|
||||
"mute_all": false,
|
||||
"muted_alert_ids": [],
|
||||
"updated_at": "2021-02-10T05:37:19.086Z",
|
||||
"created_at": "2021-02-10T05:37:19.086Z",
|
||||
"scheduled_task_id": "0b092d90-6b62-11eb-9e0d-85d233e3ee35",
|
||||
"execution_status": {
|
||||
"last_execution_date": "2021-02-10T17:55:14.262Z",
|
||||
"status": "ok"
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
|
@ -1,42 +0,0 @@
|
|||
[[alerts-api]]
|
||||
== Alerts APIs
|
||||
|
||||
The following APIs are available for managing {kib} alerts.
|
||||
|
||||
* <<alerts-api-create, Create alert API>> to create an alert
|
||||
|
||||
* <<alerts-api-update, Update alert API>> to update the attributes for existing alerts
|
||||
|
||||
* <<alerts-api-get, Get object API>> to retrieve a single alert by ID
|
||||
|
||||
* <<alerts-api-delete, Delete alert API>> to permanently remove an alert
|
||||
|
||||
* <<alerts-api-find, Find alerts API>> to retrieve a paginated set of alerts by condition
|
||||
|
||||
* <<alerts-api-list, List all alert types API>> to retrieve a list of all alert types
|
||||
|
||||
* <<alerts-api-enable, Enable alert API>> to enable a single alert by ID
|
||||
|
||||
* <<alerts-api-disable, Disable alert API>> to disable a single alert by ID
|
||||
|
||||
* <<alerts-api-mute, Mute alert instance API>> to mute alert instances for a single alert by ID
|
||||
|
||||
* <<alerts-api-unmute, Unmute alert instance API>> to unmute alert instances for a single alert by ID
|
||||
|
||||
* <<alerts-api-unmute-all, Unmute all alert instances API>> to unmute all alert instances for a single alert by ID
|
||||
|
||||
* <<alerts-api-health, Get framework health API>> to retrieve the health of the alerts framework
|
||||
|
||||
include::alerts/create.asciidoc[]
|
||||
include::alerts/update.asciidoc[]
|
||||
include::alerts/get.asciidoc[]
|
||||
include::alerts/delete.asciidoc[]
|
||||
include::alerts/find.asciidoc[]
|
||||
include::alerts/list.asciidoc[]
|
||||
include::alerts/enable.asciidoc[]
|
||||
include::alerts/disable.asciidoc[]
|
||||
include::alerts/mute_all.asciidoc[]
|
||||
include::alerts/mute.asciidoc[]
|
||||
include::alerts/unmute_all.asciidoc[]
|
||||
include::alerts/unmute.asciidoc[]
|
||||
include::alerts/health.asciidoc[]
|
|
@ -99,7 +99,7 @@ include::{kib-repo-dir}/api/spaces-management.asciidoc[]
|
|||
include::{kib-repo-dir}/api/role-management.asciidoc[]
|
||||
include::{kib-repo-dir}/api/session-management.asciidoc[]
|
||||
include::{kib-repo-dir}/api/saved-objects.asciidoc[]
|
||||
include::{kib-repo-dir}/api/alerts.asciidoc[]
|
||||
include::{kib-repo-dir}/api/alerting.asciidoc[]
|
||||
include::{kib-repo-dir}/api/actions-and-connectors.asciidoc[]
|
||||
include::{kib-repo-dir}/api/dashboard-api.asciidoc[]
|
||||
include::{kib-repo-dir}/api/logstash-configuration-management.asciidoc[]
|
||||
|
|
|
@ -21,8 +21,12 @@ import {
|
|||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||
import { CoreStart } from 'kibana/public';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { Alert, AlertTaskState, BASE_ALERT_API_PATH } from '../../../../plugins/alerting/common';
|
||||
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';
|
||||
import {
|
||||
Alert,
|
||||
AlertTaskState,
|
||||
LEGACY_BASE_ALERT_API_PATH,
|
||||
} from '../../../../plugins/alerting/common';
|
||||
|
||||
type Props = RouteComponentProps & {
|
||||
http: CoreStart['http'];
|
||||
|
@ -34,10 +38,10 @@ export const ViewAlertPage = withRouter(({ http, id }: Props) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (!alert) {
|
||||
http.get(`${BASE_ALERT_API_PATH}/alert/${id}`).then(setAlert);
|
||||
http.get(`${LEGACY_BASE_ALERT_API_PATH}/alert/${id}`).then(setAlert);
|
||||
}
|
||||
if (!alertState) {
|
||||
http.get(`${BASE_ALERT_API_PATH}/alert/${id}/state`).then(setAlertState);
|
||||
http.get(`${LEGACY_BASE_ALERT_API_PATH}/alert/${id}/state`).then(setAlertState);
|
||||
}
|
||||
}, [alert, alertState, http, id]);
|
||||
|
||||
|
|
|
@ -23,8 +23,12 @@ import {
|
|||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||
import { CoreStart } from 'kibana/public';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { Alert, AlertTaskState, BASE_ALERT_API_PATH } from '../../../../plugins/alerting/common';
|
||||
import { ALERTING_EXAMPLE_APP_ID, AlwaysFiringParams } from '../../common/constants';
|
||||
import {
|
||||
Alert,
|
||||
AlertTaskState,
|
||||
LEGACY_BASE_ALERT_API_PATH,
|
||||
} from '../../../../plugins/alerting/common';
|
||||
|
||||
type Props = RouteComponentProps & {
|
||||
http: CoreStart['http'];
|
||||
|
@ -40,10 +44,10 @@ export const ViewPeopleInSpaceAlertPage = withRouter(({ http, id }: Props) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (!alert) {
|
||||
http.get(`${BASE_ALERT_API_PATH}/alert/${id}`).then(setAlert);
|
||||
http.get(`${LEGACY_BASE_ALERT_API_PATH}/alert/${id}`).then(setAlert);
|
||||
}
|
||||
if (!alertState) {
|
||||
http.get(`${BASE_ALERT_API_PATH}/alert/${id}/state`).then(setAlertState);
|
||||
http.get(`${LEGACY_BASE_ALERT_API_PATH}/alert/${id}/state`).then(setAlertState);
|
||||
}
|
||||
}, [alert, alertState, http, id]);
|
||||
|
||||
|
|
|
@ -453,20 +453,20 @@ The only case in which this handler will not be used to evaluate the navigation
|
|||
|
||||
You can use the `registerNavigation` api to specify as many AlertType specific handlers as you like, but you can only use it once per AlertType as we wouldn't know which handler to use if you specified two for the same AlertType. For the same reason, you can only use `registerDefaultNavigation` once per plugin, as it covers all cases for your specific plugin.
|
||||
|
||||
## Experimental RESTful API
|
||||
## Internal HTTP APIs
|
||||
|
||||
Using of the alert type requires you to create an alert that will contain parameters and actions for a given alert type. API description for CRUD operations is a part of the [user documentation](https://www.elastic.co/guide/en/kibana/master/alerts-api-update.html).
|
||||
API listed below is experimental and could be changed or removed in the future.
|
||||
Using of the rule type requires you to create a rule that will contain parameters and actions for a given rule type. API description for CRUD operations is a part of the [user documentation](https://www.elastic.co/guide/en/kibana/master/alerting-apis.html).
|
||||
API listed below are internal and should not be consumed by plugin outside the alerting plugins.
|
||||
|
||||
### `GET /api/alerts/alert/{id}/state`: Get alert state
|
||||
### `GET /internal/alerting/rule/{id}/state`: Get rule state
|
||||
|
||||
Params:
|
||||
|
||||
|Property|Description|Type|
|
||||
|---|---|---|
|
||||
|id|The id of the alert whose state you're trying to get.|string|
|
||||
|id|The id of the rule whose state you're trying to get.|string|
|
||||
|
||||
### `GET /api/alerts/alert/{id}/_instance_summary`: Get alert instance summary
|
||||
### `GET /internal/alerting/rule/{id}/_alert_summary`: Get rule alert summary
|
||||
|
||||
Similar to the `GET state` call, but collects additional information from
|
||||
the event log.
|
||||
|
@ -475,7 +475,7 @@ Params:
|
|||
|
||||
|Property|Description|Type|
|
||||
|---|---|---|
|
||||
|id|The id of the alert whose instance summary you're trying to get.|string|
|
||||
|id|The id of the rule whose alert summary you're trying to get.|string|
|
||||
|
||||
Query:
|
||||
|
||||
|
@ -483,11 +483,11 @@ Query:
|
|||
|---|---|---|
|
||||
|dateStart|The date to start looking for alert events in the event log. Either an ISO date string, or a duration string indicating time since now.|string|
|
||||
|
||||
### `POST /api/alerts/alert/{id}/_update_api_key`: Update alert API key
|
||||
### `POST /internal/alerting/rule/{id}/_update_api_key`: Update rule API key
|
||||
|
||||
|Property|Description|Type|
|
||||
|---|---|---|
|
||||
|id|The id of the alert you're trying to update the API key for. System will use user in request context to generate an API key for.|string|
|
||||
|id|The id of the rule you're trying to update the API key for. System will use user in request context to generate an API key for.|string|
|
||||
|
||||
## Alert instance factory
|
||||
|
||||
|
|
|
@ -24,5 +24,7 @@ export interface AlertingFrameworkHealth {
|
|||
alertingFrameworkHeath: AlertsHealth;
|
||||
}
|
||||
|
||||
export const BASE_ALERT_API_PATH = '/api/alerts';
|
||||
export const LEGACY_BASE_ALERT_API_PATH = '/api/alerts';
|
||||
export const BASE_ALERTING_API_PATH = '/api/alerting';
|
||||
export const INTERNAL_BASE_ALERTING_API_PATH = '/internal/alerting';
|
||||
export const ALERTS_FEATURE_ID = 'alerts';
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
import { HttpSetup } from 'kibana/public';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { BASE_ALERT_API_PATH } from '../common';
|
||||
import { LEGACY_BASE_ALERT_API_PATH } from '../common';
|
||||
import type { Alert, AlertType } from '../common';
|
||||
|
||||
export async function loadAlertTypes({ http }: { http: HttpSetup }): Promise<AlertType[]> {
|
||||
return await http.get(`${BASE_ALERT_API_PATH}/list_alert_types`);
|
||||
return await http.get(`${LEGACY_BASE_ALERT_API_PATH}/list_alert_types`);
|
||||
}
|
||||
|
||||
export async function loadAlertType({
|
||||
|
@ -22,7 +22,7 @@ export async function loadAlertType({
|
|||
id: AlertType['id'];
|
||||
}): Promise<AlertType> {
|
||||
const maybeAlertType = ((await http.get(
|
||||
`${BASE_ALERT_API_PATH}/list_alert_types`
|
||||
`${LEGACY_BASE_ALERT_API_PATH}/list_alert_types`
|
||||
)) as AlertType[]).find((type) => type.id === id);
|
||||
if (!maybeAlertType) {
|
||||
throw new Error(
|
||||
|
@ -44,5 +44,5 @@ export async function loadAlert({
|
|||
http: HttpSetup;
|
||||
alertId: string;
|
||||
}): Promise<Alert> {
|
||||
return await http.get(`${BASE_ALERT_API_PATH}/alert/${alertId}`);
|
||||
return await http.get(`${LEGACY_BASE_ALERT_API_PATH}/alert/${alertId}`);
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ interface IndexType {
|
|||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
interface AggregateResult {
|
||||
export interface AggregateResult {
|
||||
alertExecutionStatus: { [status: string]: number };
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ export interface CreateOptions<Params extends AlertTypeParams> {
|
|||
};
|
||||
}
|
||||
|
||||
interface UpdateOptions<Params extends AlertTypeParams> {
|
||||
export interface UpdateOptions<Params extends AlertTypeParams> {
|
||||
id: string;
|
||||
data: {
|
||||
name: string;
|
||||
|
@ -170,7 +170,7 @@ interface UpdateOptions<Params extends AlertTypeParams> {
|
|||
};
|
||||
}
|
||||
|
||||
interface GetAlertInstanceSummaryParams {
|
||||
export interface GetAlertInstanceSummaryParams {
|
||||
id: string;
|
||||
dateStart?: string;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ export class AlertsClient {
|
|||
public async create<Params extends AlertTypeParams = never>({
|
||||
data,
|
||||
options,
|
||||
}: CreateOptions<Params>): Promise<Alert<Params>> {
|
||||
}: CreateOptions<Params>): Promise<SanitizedAlert<Params>> {
|
||||
const id = options?.id || SavedObjectsUtils.generateId();
|
||||
|
||||
try {
|
||||
|
|
17
x-pack/plugins/alerting/server/lib/errors/index.ts
Normal file
17
x-pack/plugins/alerting/server/lib/errors/index.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { ErrorThatHandlesItsOwnResponse } from './types';
|
||||
|
||||
export function isErrorThatHandlesItsOwnResponse(
|
||||
e: ErrorThatHandlesItsOwnResponse
|
||||
): e is ErrorThatHandlesItsOwnResponse {
|
||||
return typeof (e as ErrorThatHandlesItsOwnResponse).sendResponse === 'function';
|
||||
}
|
||||
|
||||
export { ErrorThatHandlesItsOwnResponse };
|
||||
export { AlertTypeDisabledError, AlertTypeDisabledReason } from './alert_type_disabled';
|
|
@ -6,10 +6,17 @@
|
|||
*/
|
||||
|
||||
export { parseDuration, validateDurationSchema } from '../../common/parse_duration';
|
||||
export { LicenseState } from './license_state';
|
||||
export { ILicenseState, LicenseState } from './license_state';
|
||||
export { validateAlertTypeParams } from './validate_alert_type_params';
|
||||
export { getAlertNotifyWhenType } from './get_alert_notify_when_type';
|
||||
export { verifyApiAccess } from './license_api_access';
|
||||
export { ErrorWithReason, getReasonFromError, isErrorWithReason } from './error_with_reason';
|
||||
export {
|
||||
AlertTypeDisabledError,
|
||||
AlertTypeDisabledReason,
|
||||
ErrorThatHandlesItsOwnResponse,
|
||||
isErrorThatHandlesItsOwnResponse,
|
||||
} from './errors';
|
||||
export {
|
||||
executionStatusFromState,
|
||||
executionStatusFromError,
|
||||
|
|
|
@ -37,25 +37,7 @@ import {
|
|||
} from '../../../../src/core/server';
|
||||
import type { AlertingRequestHandlerContext } from './types';
|
||||
|
||||
import {
|
||||
aggregateAlertRoute,
|
||||
createAlertRoute,
|
||||
deleteAlertRoute,
|
||||
findAlertRoute,
|
||||
getAlertRoute,
|
||||
getAlertStateRoute,
|
||||
getAlertInstanceSummaryRoute,
|
||||
listAlertTypesRoute,
|
||||
updateAlertRoute,
|
||||
enableAlertRoute,
|
||||
disableAlertRoute,
|
||||
updateApiKeyRoute,
|
||||
muteAllAlertRoute,
|
||||
unmuteAllAlertRoute,
|
||||
muteAlertInstanceRoute,
|
||||
unmuteAlertInstanceRoute,
|
||||
healthRoute,
|
||||
} from './routes';
|
||||
import { defineRoutes } from './routes';
|
||||
import { LICENSE_TYPE, LicensingPluginSetup, LicensingPluginStart } from '../../licensing/server';
|
||||
import {
|
||||
PluginSetupContract as ActionsPluginSetupContract,
|
||||
|
@ -266,23 +248,7 @@ export class AlertingPlugin {
|
|||
// Routes
|
||||
const router = core.http.createRouter<AlertingRequestHandlerContext>();
|
||||
// Register routes
|
||||
aggregateAlertRoute(router, this.licenseState);
|
||||
createAlertRoute(router, this.licenseState);
|
||||
deleteAlertRoute(router, this.licenseState);
|
||||
findAlertRoute(router, this.licenseState);
|
||||
getAlertRoute(router, this.licenseState);
|
||||
getAlertStateRoute(router, this.licenseState);
|
||||
getAlertInstanceSummaryRoute(router, this.licenseState);
|
||||
listAlertTypesRoute(router, this.licenseState);
|
||||
updateAlertRoute(router, this.licenseState);
|
||||
enableAlertRoute(router, this.licenseState);
|
||||
disableAlertRoute(router, this.licenseState);
|
||||
updateApiKeyRoute(router, this.licenseState);
|
||||
muteAllAlertRoute(router, this.licenseState);
|
||||
unmuteAllAlertRoute(router, this.licenseState);
|
||||
muteAlertInstanceRoute(router, this.licenseState);
|
||||
unmuteAlertInstanceRoute(router, this.licenseState);
|
||||
healthRoute(router, this.licenseState, plugins.encryptedSavedObjects);
|
||||
defineRoutes(router, this.licenseState, plugins.encryptedSavedObjects);
|
||||
|
||||
return {
|
||||
registerType<
|
||||
|
|
150
x-pack/plugins/alerting/server/routes/aggregate_rules.test.ts
Normal file
150
x-pack/plugins/alerting/server/routes/aggregate_rules.test.ts
Normal file
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { aggregateRulesRoute } from './aggregate_rules';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('aggregateRulesRoute', () => {
|
||||
it('aggregate rules with proper parameters', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
aggregateRulesRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rules/_aggregate"`);
|
||||
|
||||
const aggregateResult = {
|
||||
alertExecutionStatus: {
|
||||
ok: 15,
|
||||
error: 2,
|
||||
active: 23,
|
||||
pending: 1,
|
||||
unknown: 0,
|
||||
},
|
||||
};
|
||||
alertsClient.aggregate.mockResolvedValueOnce(aggregateResult);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
query: {
|
||||
default_search_operator: 'AND',
|
||||
},
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"body": Object {
|
||||
"rule_execution_status": Object {
|
||||
"active": 23,
|
||||
"error": 2,
|
||||
"ok": 15,
|
||||
"pending": 1,
|
||||
"unknown": 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
`);
|
||||
|
||||
expect(alertsClient.aggregate).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.aggregate.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"options": Object {
|
||||
"defaultSearchOperator": "AND",
|
||||
},
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.ok).toHaveBeenCalledWith({
|
||||
body: {
|
||||
rule_execution_status: {
|
||||
ok: 15,
|
||||
error: 2,
|
||||
active: 23,
|
||||
pending: 1,
|
||||
unknown: 0,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('ensures the license allows aggregating rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
aggregateRulesRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
alertsClient.aggregate.mockResolvedValueOnce({
|
||||
alertExecutionStatus: {
|
||||
ok: 15,
|
||||
error: 2,
|
||||
active: 23,
|
||||
pending: 1,
|
||||
unknown: 0,
|
||||
},
|
||||
});
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
query: {
|
||||
default_search_operator: 'OR',
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
|
||||
it('ensures the license check prevents aggregating rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
(verifyApiAccess as jest.Mock).mockImplementation(() => {
|
||||
throw new Error('OMG');
|
||||
});
|
||||
|
||||
aggregateRulesRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{},
|
||||
{
|
||||
query: {},
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
});
|
79
x-pack/plugins/alerting/server/routes/aggregate_rules.ts
Normal file
79
x-pack/plugins/alerting/server/routes/aggregate_rules.ts
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { AggregateResult, AggregateOptions } from '../alerts_client';
|
||||
import { RewriteResponseCase, RewriteRequestCase, verifyAccessAndContext } from './lib';
|
||||
import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types';
|
||||
|
||||
// config definition
|
||||
const querySchema = schema.object({
|
||||
search: schema.maybe(schema.string()),
|
||||
default_search_operator: schema.oneOf([schema.literal('OR'), schema.literal('AND')], {
|
||||
defaultValue: 'OR',
|
||||
}),
|
||||
search_fields: schema.maybe(schema.arrayOf(schema.string())),
|
||||
has_reference: schema.maybe(
|
||||
// use nullable as maybe is currently broken
|
||||
// in config-schema
|
||||
schema.nullable(
|
||||
schema.object({
|
||||
type: schema.string(),
|
||||
id: schema.string(),
|
||||
})
|
||||
)
|
||||
),
|
||||
filter: schema.maybe(schema.string()),
|
||||
});
|
||||
|
||||
const rewriteQueryReq: RewriteRequestCase<AggregateOptions> = ({
|
||||
default_search_operator: defaultSearchOperator,
|
||||
has_reference: hasReference,
|
||||
search_fields: searchFields,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
defaultSearchOperator,
|
||||
...(hasReference ? { hasReference } : {}),
|
||||
...(searchFields ? { searchFields } : {}),
|
||||
});
|
||||
const rewriteBodyRes: RewriteResponseCase<AggregateResult> = ({
|
||||
alertExecutionStatus,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
rule_execution_status: alertExecutionStatus,
|
||||
});
|
||||
|
||||
export const aggregateRulesRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.get(
|
||||
{
|
||||
path: `${INTERNAL_BASE_ALERTING_API_PATH}/rules/_aggregate`,
|
||||
validate: {
|
||||
query: querySchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const options = rewriteQueryReq({
|
||||
...req.query,
|
||||
has_reference: req.query.has_reference || undefined,
|
||||
});
|
||||
const aggregateResult = await alertsClient.aggregate({ options });
|
||||
return res.ok({
|
||||
body: rewriteBodyRes(aggregateResult),
|
||||
});
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
298
x-pack/plugins/alerting/server/routes/create_rule.test.ts
Normal file
298
x-pack/plugins/alerting/server/routes/create_rule.test.ts
Normal file
|
@ -0,0 +1,298 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { pick } from 'lodash';
|
||||
import { createRuleRoute } from './create_rule';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { CreateOptions } from '../alerts_client';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../lib';
|
||||
import { AsApiContract } from './lib';
|
||||
import { SanitizedAlert } from '../types';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('createRuleRoute', () => {
|
||||
const createdAt = new Date();
|
||||
const updatedAt = new Date();
|
||||
|
||||
const mockedAlert: SanitizedAlert<{ bar: boolean }> = {
|
||||
alertTypeId: '1',
|
||||
consumer: 'bar',
|
||||
name: 'abc',
|
||||
schedule: { interval: '10s' },
|
||||
tags: ['foo'],
|
||||
params: {
|
||||
bar: true,
|
||||
},
|
||||
throttle: '30s',
|
||||
actions: [
|
||||
{
|
||||
actionTypeId: 'test',
|
||||
group: 'default',
|
||||
id: '2',
|
||||
params: {
|
||||
foo: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
enabled: true,
|
||||
muteAll: false,
|
||||
createdBy: '',
|
||||
updatedBy: '',
|
||||
apiKeyOwner: '',
|
||||
mutedInstanceIds: [],
|
||||
notifyWhen: 'onActionGroupChange',
|
||||
createdAt,
|
||||
updatedAt,
|
||||
id: '123',
|
||||
executionStatus: {
|
||||
status: 'unknown',
|
||||
lastExecutionDate: new Date('2020-08-20T19:23:38Z'),
|
||||
},
|
||||
};
|
||||
|
||||
const ruleToCreate: AsApiContract<CreateOptions<{ bar: boolean }>['data']> = {
|
||||
...pick(mockedAlert, 'consumer', 'name', 'schedule', 'tags', 'params', 'throttle', 'enabled'),
|
||||
rule_type_id: mockedAlert.alertTypeId,
|
||||
notify_when: mockedAlert.notifyWhen,
|
||||
actions: [
|
||||
{
|
||||
group: mockedAlert.actions[0].group,
|
||||
id: mockedAlert.actions[0].id,
|
||||
params: mockedAlert.actions[0].params,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const createResult: AsApiContract<SanitizedAlert<{ bar: boolean }>> = {
|
||||
...ruleToCreate,
|
||||
mute_all: mockedAlert.muteAll,
|
||||
created_by: mockedAlert.createdBy,
|
||||
updated_by: mockedAlert.updatedBy,
|
||||
api_key_owner: mockedAlert.apiKeyOwner,
|
||||
muted_alert_ids: mockedAlert.mutedInstanceIds,
|
||||
created_at: mockedAlert.createdAt,
|
||||
updated_at: mockedAlert.updatedAt,
|
||||
id: mockedAlert.id,
|
||||
execution_status: {
|
||||
status: mockedAlert.executionStatus.status,
|
||||
last_execution_date: mockedAlert.executionStatus.lastExecutionDate,
|
||||
},
|
||||
actions: [
|
||||
{
|
||||
...ruleToCreate.actions[0],
|
||||
connector_type_id: 'test',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
it('creates a rule with proper parameters', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
createRuleRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.post.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rule/{id?}"`);
|
||||
|
||||
alertsClient.create.mockResolvedValueOnce(mockedAlert);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
body: ruleToCreate,
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual({ body: createResult });
|
||||
|
||||
expect(alertsClient.create).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.create.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"data": Object {
|
||||
"actions": Array [
|
||||
Object {
|
||||
"group": "default",
|
||||
"id": "2",
|
||||
"params": Object {
|
||||
"foo": true,
|
||||
},
|
||||
},
|
||||
],
|
||||
"alertTypeId": "1",
|
||||
"consumer": "bar",
|
||||
"enabled": true,
|
||||
"name": "abc",
|
||||
"notifyWhen": "onActionGroupChange",
|
||||
"params": Object {
|
||||
"bar": true,
|
||||
},
|
||||
"schedule": Object {
|
||||
"interval": "10s",
|
||||
},
|
||||
"tags": Array [
|
||||
"foo",
|
||||
],
|
||||
"throttle": "30s",
|
||||
},
|
||||
"options": Object {
|
||||
"id": undefined,
|
||||
},
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.ok).toHaveBeenCalledWith({
|
||||
body: createResult,
|
||||
});
|
||||
});
|
||||
|
||||
it('allows providing a custom id', async () => {
|
||||
const expectedResult = {
|
||||
...createResult,
|
||||
id: 'custom-id',
|
||||
};
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
createRuleRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.post.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rule/{id?}"`);
|
||||
|
||||
alertsClient.create.mockResolvedValueOnce({
|
||||
...mockedAlert,
|
||||
id: 'custom-id',
|
||||
});
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: { id: 'custom-id' },
|
||||
body: ruleToCreate,
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual({ body: expectedResult });
|
||||
|
||||
expect(alertsClient.create).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.create.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"data": Object {
|
||||
"actions": Array [
|
||||
Object {
|
||||
"group": "default",
|
||||
"id": "2",
|
||||
"params": Object {
|
||||
"foo": true,
|
||||
},
|
||||
},
|
||||
],
|
||||
"alertTypeId": "1",
|
||||
"consumer": "bar",
|
||||
"enabled": true,
|
||||
"name": "abc",
|
||||
"notifyWhen": "onActionGroupChange",
|
||||
"params": Object {
|
||||
"bar": true,
|
||||
},
|
||||
"schedule": Object {
|
||||
"interval": "10s",
|
||||
},
|
||||
"tags": Array [
|
||||
"foo",
|
||||
],
|
||||
"throttle": "30s",
|
||||
},
|
||||
"options": Object {
|
||||
"id": "custom-id",
|
||||
},
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.ok).toHaveBeenCalledWith({
|
||||
body: expectedResult,
|
||||
});
|
||||
});
|
||||
|
||||
it('ensures the license allows creating rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
createRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.post.mock.calls[0];
|
||||
|
||||
alertsClient.create.mockResolvedValueOnce(mockedAlert);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments({ alertsClient }, { body: ruleToCreate });
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
|
||||
it('ensures the license check prevents creating rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
(verifyApiAccess as jest.Mock).mockImplementation(() => {
|
||||
throw new Error('OMG');
|
||||
});
|
||||
|
||||
createRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.post.mock.calls[0];
|
||||
|
||||
alertsClient.create.mockResolvedValueOnce(mockedAlert);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments({ alertsClient }, {});
|
||||
|
||||
expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
|
||||
it('ensures the rule type gets validated for the license', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
createRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.post.mock.calls[0];
|
||||
|
||||
alertsClient.create.mockRejectedValue(new AlertTypeDisabledError('Fail', 'license_invalid'));
|
||||
|
||||
const [context, req, res] = mockHandlerArguments({ alertsClient }, { body: ruleToCreate }, [
|
||||
'ok',
|
||||
'forbidden',
|
||||
]);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } });
|
||||
});
|
||||
});
|
141
x-pack/plugins/alerting/server/routes/create_rule.ts
Normal file
141
x-pack/plugins/alerting/server/routes/create_rule.ts
Normal file
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { validateDurationSchema, ILicenseState, AlertTypeDisabledError } from '../lib';
|
||||
import { CreateOptions } from '../alerts_client';
|
||||
import {
|
||||
RewriteRequestCase,
|
||||
RewriteResponseCase,
|
||||
handleDisabledApiKeysError,
|
||||
verifyAccessAndContext,
|
||||
} from './lib';
|
||||
import {
|
||||
SanitizedAlert,
|
||||
validateNotifyWhenType,
|
||||
AlertTypeParams,
|
||||
AlertingRequestHandlerContext,
|
||||
BASE_ALERTING_API_PATH,
|
||||
AlertNotifyWhenType,
|
||||
} from '../types';
|
||||
|
||||
export const bodySchema = schema.object({
|
||||
name: schema.string(),
|
||||
rule_type_id: schema.string(),
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
consumer: schema.string(),
|
||||
tags: schema.arrayOf(schema.string(), { defaultValue: [] }),
|
||||
throttle: schema.nullable(schema.string({ validate: validateDurationSchema })),
|
||||
params: schema.recordOf(schema.string(), schema.any(), { defaultValue: {} }),
|
||||
schedule: schema.object({
|
||||
interval: schema.string({ validate: validateDurationSchema }),
|
||||
}),
|
||||
actions: schema.arrayOf(
|
||||
schema.object({
|
||||
group: schema.string(),
|
||||
id: schema.string(),
|
||||
params: schema.recordOf(schema.string(), schema.any(), { defaultValue: {} }),
|
||||
}),
|
||||
{ defaultValue: [] }
|
||||
),
|
||||
notify_when: schema.string({ validate: validateNotifyWhenType }),
|
||||
});
|
||||
|
||||
const rewriteBodyReq: RewriteRequestCase<CreateOptions<AlertTypeParams>['data']> = ({
|
||||
rule_type_id: alertTypeId,
|
||||
notify_when: notifyWhen,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
alertTypeId,
|
||||
notifyWhen,
|
||||
});
|
||||
const rewriteBodyRes: RewriteResponseCase<SanitizedAlert<AlertTypeParams>> = ({
|
||||
actions,
|
||||
alertTypeId,
|
||||
scheduledTaskId,
|
||||
createdBy,
|
||||
updatedBy,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
apiKeyOwner,
|
||||
notifyWhen,
|
||||
muteAll,
|
||||
mutedInstanceIds,
|
||||
executionStatus: { lastExecutionDate, ...executionStatus },
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
rule_type_id: alertTypeId,
|
||||
scheduled_task_id: scheduledTaskId,
|
||||
created_by: createdBy,
|
||||
updated_by: updatedBy,
|
||||
created_at: createdAt,
|
||||
updated_at: updatedAt,
|
||||
api_key_owner: apiKeyOwner,
|
||||
notify_when: notifyWhen,
|
||||
mute_all: muteAll,
|
||||
muted_alert_ids: mutedInstanceIds,
|
||||
execution_status: {
|
||||
...executionStatus,
|
||||
last_execution_date: lastExecutionDate,
|
||||
},
|
||||
actions: actions.map(({ group, id, actionTypeId, params }) => ({
|
||||
group,
|
||||
id,
|
||||
params,
|
||||
connector_type_id: actionTypeId,
|
||||
})),
|
||||
});
|
||||
|
||||
export const createRuleRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.post(
|
||||
{
|
||||
path: `${BASE_ALERTING_API_PATH}/rule/{id?}`,
|
||||
validate: {
|
||||
params: schema.maybe(
|
||||
schema.object({
|
||||
id: schema.maybe(schema.string()),
|
||||
})
|
||||
),
|
||||
body: bodySchema,
|
||||
},
|
||||
},
|
||||
handleDisabledApiKeysError(
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const rule = req.body;
|
||||
const params = req.params;
|
||||
try {
|
||||
const createdRule: SanitizedAlert<AlertTypeParams> = await alertsClient.create<AlertTypeParams>(
|
||||
{
|
||||
data: rewriteBodyReq({
|
||||
...rule,
|
||||
notify_when: rule.notify_when as AlertNotifyWhenType,
|
||||
}),
|
||||
options: { id: params?.id },
|
||||
}
|
||||
);
|
||||
return res.ok({
|
||||
body: rewriteBodyRes(createdRule),
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof AlertTypeDisabledError) {
|
||||
return e.sendResponse(res);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
109
x-pack/plugins/alerting/server/routes/delete_rule.test.ts
Normal file
109
x-pack/plugins/alerting/server/routes/delete_rule.test.ts
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { deleteRuleRoute } from './delete_rule';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('deleteRuleRoute', () => {
|
||||
it('deletes an alert with proper parameters', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
deleteRuleRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.delete.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rule/{id}"`);
|
||||
|
||||
alertsClient.delete.mockResolvedValueOnce({});
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
},
|
||||
['noContent']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual(undefined);
|
||||
|
||||
expect(alertsClient.delete).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.delete.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.noContent).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('ensures the license allows deleting rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
deleteRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.delete.mock.calls[0];
|
||||
|
||||
alertsClient.delete.mockResolvedValueOnce({});
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: { id: '1' },
|
||||
}
|
||||
);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
|
||||
it('ensures the license check prevents deleting rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
(verifyApiAccess as jest.Mock).mockImplementation(() => {
|
||||
throw new Error('OMG');
|
||||
});
|
||||
|
||||
deleteRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.delete.mock.calls[0];
|
||||
|
||||
alertsClient.delete.mockResolvedValueOnce({});
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
id: '1',
|
||||
}
|
||||
);
|
||||
|
||||
expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
});
|
38
x-pack/plugins/alerting/server/routes/delete_rule.ts
Normal file
38
x-pack/plugins/alerting/server/routes/delete_rule.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { verifyAccessAndContext } from './lib';
|
||||
import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../types';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
});
|
||||
|
||||
export const deleteRuleRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.delete(
|
||||
{
|
||||
path: `${BASE_ALERTING_API_PATH}/rule/{id}`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const { id } = req.params;
|
||||
await alertsClient.delete({ id });
|
||||
return res.noContent();
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
81
x-pack/plugins/alerting/server/routes/disable_rule.test.ts
Normal file
81
x-pack/plugins/alerting/server/routes/disable_rule.test.ts
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { disableRuleRoute } from './disable_rule';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('disableRuleRoute', () => {
|
||||
it('disables a rule', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
disableRuleRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.post.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rule/{id}/_disable"`);
|
||||
|
||||
alertsClient.disable.mockResolvedValueOnce();
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
},
|
||||
['noContent']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual(undefined);
|
||||
|
||||
expect(alertsClient.disable).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.disable.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.noContent).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('ensures the rule type gets validated for the license', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
disableRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.post.mock.calls[0];
|
||||
|
||||
alertsClient.disable.mockRejectedValue(new AlertTypeDisabledError('Fail', 'license_invalid'));
|
||||
|
||||
const [context, req, res] = mockHandlerArguments({ alertsClient }, { params: {}, body: {} }, [
|
||||
'ok',
|
||||
'forbidden',
|
||||
]);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } });
|
||||
});
|
||||
});
|
45
x-pack/plugins/alerting/server/routes/disable_rule.ts
Normal file
45
x-pack/plugins/alerting/server/routes/disable_rule.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState, AlertTypeDisabledError } from '../lib';
|
||||
import { verifyAccessAndContext } from './lib';
|
||||
import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../types';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
});
|
||||
|
||||
export const disableRuleRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.post(
|
||||
{
|
||||
path: `${BASE_ALERTING_API_PATH}/rule/{id}/_disable`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const { id } = req.params;
|
||||
try {
|
||||
await alertsClient.disable({ id });
|
||||
return res.noContent();
|
||||
} catch (e) {
|
||||
if (e instanceof AlertTypeDisabledError) {
|
||||
return e.sendResponse(res);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
81
x-pack/plugins/alerting/server/routes/enable_rule.test.ts
Normal file
81
x-pack/plugins/alerting/server/routes/enable_rule.test.ts
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { enableRuleRoute } from './enable_rule';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('enableRuleRoute', () => {
|
||||
it('enables a rule', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
enableRuleRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.post.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rule/{id}/_enable"`);
|
||||
|
||||
alertsClient.enable.mockResolvedValueOnce();
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
},
|
||||
['noContent']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual(undefined);
|
||||
|
||||
expect(alertsClient.enable).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.enable.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.noContent).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('ensures the rule type gets validated for the license', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
enableRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.post.mock.calls[0];
|
||||
|
||||
alertsClient.enable.mockRejectedValue(new AlertTypeDisabledError('Fail', 'license_invalid'));
|
||||
|
||||
const [context, req, res] = mockHandlerArguments({ alertsClient }, { params: {}, body: {} }, [
|
||||
'ok',
|
||||
'forbidden',
|
||||
]);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } });
|
||||
});
|
||||
});
|
45
x-pack/plugins/alerting/server/routes/enable_rule.ts
Normal file
45
x-pack/plugins/alerting/server/routes/enable_rule.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState, AlertTypeDisabledError } from '../lib';
|
||||
import { verifyAccessAndContext } from './lib';
|
||||
import { AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../types';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
});
|
||||
|
||||
export const enableRuleRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.post(
|
||||
{
|
||||
path: `${BASE_ALERTING_API_PATH}/rule/{id}/_enable`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const { id } = req.params;
|
||||
try {
|
||||
await alertsClient.enable({ id });
|
||||
return res.noContent();
|
||||
} catch (e) {
|
||||
if (e instanceof AlertTypeDisabledError) {
|
||||
return e.sendResponse(res);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
148
x-pack/plugins/alerting/server/routes/find_rules.test.ts
Normal file
148
x-pack/plugins/alerting/server/routes/find_rules.test.ts
Normal file
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { findRulesRoute } from './find_rules';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('findRulesRoute', () => {
|
||||
it('finds rules with proper parameters', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
findRulesRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rules/_find"`);
|
||||
|
||||
const findResult = {
|
||||
page: 1,
|
||||
perPage: 1,
|
||||
total: 0,
|
||||
data: [],
|
||||
};
|
||||
alertsClient.find.mockResolvedValueOnce(findResult);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
query: {
|
||||
per_page: 1,
|
||||
page: 1,
|
||||
default_search_operator: 'OR',
|
||||
},
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"body": Object {
|
||||
"data": Array [],
|
||||
"page": 1,
|
||||
"per_page": 1,
|
||||
"total": 0,
|
||||
},
|
||||
}
|
||||
`);
|
||||
|
||||
expect(alertsClient.find).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.find.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"options": Object {
|
||||
"defaultSearchOperator": "OR",
|
||||
"page": 1,
|
||||
"perPage": 1,
|
||||
},
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.ok).toHaveBeenCalledWith({
|
||||
body: {
|
||||
page: 1,
|
||||
per_page: 1,
|
||||
total: 0,
|
||||
data: [],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('ensures the license allows finding rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
findRulesRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
alertsClient.find.mockResolvedValueOnce({
|
||||
page: 1,
|
||||
perPage: 1,
|
||||
total: 0,
|
||||
data: [],
|
||||
});
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
query: {
|
||||
per_page: 1,
|
||||
page: 1,
|
||||
default_search_operator: 'OR',
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
|
||||
it('ensures the license check prevents finding rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
(verifyApiAccess as jest.Mock).mockImplementation(() => {
|
||||
throw new Error('OMG');
|
||||
});
|
||||
|
||||
findRulesRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{},
|
||||
{
|
||||
query: {
|
||||
per_page: 1,
|
||||
page: 1,
|
||||
default_search_operator: 'OR',
|
||||
},
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
});
|
143
x-pack/plugins/alerting/server/routes/find_rules.ts
Normal file
143
x-pack/plugins/alerting/server/routes/find_rules.ts
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { omit } from 'lodash';
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { FindOptions, FindResult } from '../alerts_client';
|
||||
import { RewriteRequestCase, RewriteResponseCase, verifyAccessAndContext } from './lib';
|
||||
import { AlertTypeParams, AlertingRequestHandlerContext, BASE_ALERTING_API_PATH } from '../types';
|
||||
|
||||
// query definition
|
||||
const querySchema = schema.object({
|
||||
per_page: schema.number({ defaultValue: 10, min: 0 }),
|
||||
page: schema.number({ defaultValue: 1, min: 1 }),
|
||||
search: schema.maybe(schema.string()),
|
||||
default_search_operator: schema.oneOf([schema.literal('OR'), schema.literal('AND')], {
|
||||
defaultValue: 'OR',
|
||||
}),
|
||||
search_fields: schema.maybe(schema.oneOf([schema.arrayOf(schema.string()), schema.string()])),
|
||||
sort_field: schema.maybe(schema.string()),
|
||||
sort_order: schema.maybe(schema.oneOf([schema.literal('asc'), schema.literal('desc')])),
|
||||
has_reference: schema.maybe(
|
||||
// use nullable as maybe is currently broken
|
||||
// in config-schema
|
||||
schema.nullable(
|
||||
schema.object({
|
||||
type: schema.string(),
|
||||
id: schema.string(),
|
||||
})
|
||||
)
|
||||
),
|
||||
fields: schema.maybe(schema.arrayOf(schema.string())),
|
||||
filter: schema.maybe(schema.string()),
|
||||
});
|
||||
|
||||
const rewriteQueryReq: RewriteRequestCase<FindOptions> = ({
|
||||
default_search_operator: defaultSearchOperator,
|
||||
has_reference: hasReference,
|
||||
search_fields: searchFields,
|
||||
per_page: perPage,
|
||||
sort_field: sortField,
|
||||
sort_order: sortOrder,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
defaultSearchOperator,
|
||||
perPage,
|
||||
...(sortField ? { sortField } : {}),
|
||||
...(sortOrder ? { sortOrder } : {}),
|
||||
...(hasReference ? { hasReference } : {}),
|
||||
...(searchFields ? { searchFields } : {}),
|
||||
});
|
||||
const rewriteBodyRes: RewriteResponseCase<FindResult<AlertTypeParams>> = ({
|
||||
perPage,
|
||||
data,
|
||||
...restOfResult
|
||||
}) => {
|
||||
return {
|
||||
...restOfResult,
|
||||
per_page: perPage,
|
||||
data: data.map(
|
||||
({
|
||||
alertTypeId,
|
||||
createdBy,
|
||||
updatedBy,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
apiKeyOwner,
|
||||
notifyWhen,
|
||||
muteAll,
|
||||
mutedInstanceIds,
|
||||
executionStatus,
|
||||
actions,
|
||||
scheduledTaskId,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
rule_type_id: alertTypeId,
|
||||
created_by: createdBy,
|
||||
updated_by: updatedBy,
|
||||
created_at: createdAt,
|
||||
updated_at: updatedAt,
|
||||
api_key_owner: apiKeyOwner,
|
||||
notify_when: notifyWhen,
|
||||
mute_all: muteAll,
|
||||
muted_alert_ids: mutedInstanceIds,
|
||||
scheduled_task_id: scheduledTaskId,
|
||||
execution_status: executionStatus && {
|
||||
...omit(executionStatus, 'lastExecutionDate'),
|
||||
last_execution_date: executionStatus.lastExecutionDate,
|
||||
},
|
||||
actions: actions.map(({ group, id, actionTypeId, params }) => ({
|
||||
group,
|
||||
id,
|
||||
params,
|
||||
connector_type_id: actionTypeId,
|
||||
})),
|
||||
})
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
export const findRulesRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.get(
|
||||
{
|
||||
path: `${BASE_ALERTING_API_PATH}/rules/_find`,
|
||||
validate: {
|
||||
query: querySchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
|
||||
const options = rewriteQueryReq({
|
||||
...req.query,
|
||||
has_reference: req.query.has_reference || undefined,
|
||||
search_fields: searchFieldsAsArray(req.query.search_fields),
|
||||
});
|
||||
|
||||
const findResult = await alertsClient.find({ options });
|
||||
return res.ok({
|
||||
body: rewriteBodyRes(findResult),
|
||||
});
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
function searchFieldsAsArray(searchFields: string | string[] | undefined): string[] | undefined {
|
||||
if (!searchFields) {
|
||||
return;
|
||||
}
|
||||
return Array.isArray(searchFields) ? searchFields : [searchFields];
|
||||
}
|
169
x-pack/plugins/alerting/server/routes/get_rule.test.ts
Normal file
169
x-pack/plugins/alerting/server/routes/get_rule.test.ts
Normal file
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { pick } from 'lodash';
|
||||
import { getRuleRoute } from './get_rule';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { SanitizedAlert } from '../types';
|
||||
import { AsApiContract } from './lib';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('getRuleRoute', () => {
|
||||
const mockedAlert: SanitizedAlert<{
|
||||
bar: boolean;
|
||||
}> = {
|
||||
id: '1',
|
||||
alertTypeId: '1',
|
||||
schedule: { interval: '10s' },
|
||||
params: {
|
||||
bar: true,
|
||||
},
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
actions: [
|
||||
{
|
||||
group: 'default',
|
||||
id: '2',
|
||||
actionTypeId: 'test',
|
||||
params: {
|
||||
foo: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
consumer: 'bar',
|
||||
name: 'abc',
|
||||
tags: ['foo'],
|
||||
enabled: true,
|
||||
muteAll: false,
|
||||
notifyWhen: 'onActionGroupChange',
|
||||
createdBy: '',
|
||||
updatedBy: '',
|
||||
apiKeyOwner: '',
|
||||
throttle: '30s',
|
||||
mutedInstanceIds: [],
|
||||
executionStatus: {
|
||||
status: 'unknown',
|
||||
lastExecutionDate: new Date('2020-08-20T19:23:38Z'),
|
||||
},
|
||||
};
|
||||
|
||||
const getResult: AsApiContract<SanitizedAlert<{ bar: boolean }>> = {
|
||||
...pick(mockedAlert, 'consumer', 'name', 'schedule', 'tags', 'params', 'throttle', 'enabled'),
|
||||
rule_type_id: mockedAlert.alertTypeId,
|
||||
notify_when: mockedAlert.notifyWhen,
|
||||
mute_all: mockedAlert.muteAll,
|
||||
created_by: mockedAlert.createdBy,
|
||||
updated_by: mockedAlert.updatedBy,
|
||||
api_key_owner: mockedAlert.apiKeyOwner,
|
||||
muted_alert_ids: mockedAlert.mutedInstanceIds,
|
||||
created_at: mockedAlert.createdAt,
|
||||
updated_at: mockedAlert.updatedAt,
|
||||
id: mockedAlert.id,
|
||||
execution_status: {
|
||||
status: mockedAlert.executionStatus.status,
|
||||
last_execution_date: mockedAlert.executionStatus.lastExecutionDate,
|
||||
},
|
||||
actions: [
|
||||
{
|
||||
group: mockedAlert.actions[0].group,
|
||||
id: mockedAlert.actions[0].id,
|
||||
params: mockedAlert.actions[0].params,
|
||||
connector_type_id: mockedAlert.actions[0].actionTypeId,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
it('gets a rule with proper parameters', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleRoute(router, licenseState);
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/rule/{id}"`);
|
||||
|
||||
alertsClient.get.mockResolvedValueOnce(mockedAlert);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: { id: '1' },
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(alertsClient.get).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.get.mock.calls[0][0].id).toEqual('1');
|
||||
|
||||
expect(res.ok).toHaveBeenCalledWith({
|
||||
body: getResult,
|
||||
});
|
||||
});
|
||||
|
||||
it('ensures the license allows getting rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
alertsClient.get.mockResolvedValueOnce(mockedAlert);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: { id: '1' },
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
|
||||
it('ensures the license check prevents getting rules', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
(verifyApiAccess as jest.Mock).mockImplementation(() => {
|
||||
throw new Error('OMG');
|
||||
});
|
||||
|
||||
getRuleRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
alertsClient.get.mockResolvedValueOnce(mockedAlert);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: { id: '1' },
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`);
|
||||
|
||||
expect(verifyApiAccess).toHaveBeenCalledWith(licenseState);
|
||||
});
|
||||
});
|
84
x-pack/plugins/alerting/server/routes/get_rule.ts
Normal file
84
x-pack/plugins/alerting/server/routes/get_rule.ts
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { omit } from 'lodash';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { verifyAccessAndContext, RewriteResponseCase } from './lib';
|
||||
import {
|
||||
AlertTypeParams,
|
||||
AlertingRequestHandlerContext,
|
||||
BASE_ALERTING_API_PATH,
|
||||
SanitizedAlert,
|
||||
} from '../types';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
});
|
||||
|
||||
const rewriteBodyRes: RewriteResponseCase<SanitizedAlert<AlertTypeParams>> = ({
|
||||
alertTypeId,
|
||||
createdBy,
|
||||
updatedBy,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
apiKeyOwner,
|
||||
notifyWhen,
|
||||
muteAll,
|
||||
mutedInstanceIds,
|
||||
executionStatus,
|
||||
actions,
|
||||
scheduledTaskId,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
rule_type_id: alertTypeId,
|
||||
created_by: createdBy,
|
||||
updated_by: updatedBy,
|
||||
created_at: createdAt,
|
||||
updated_at: updatedAt,
|
||||
api_key_owner: apiKeyOwner,
|
||||
notify_when: notifyWhen,
|
||||
mute_all: muteAll,
|
||||
muted_alert_ids: mutedInstanceIds,
|
||||
scheduled_task_id: scheduledTaskId,
|
||||
execution_status: executionStatus && {
|
||||
...omit(executionStatus, 'lastExecutionDate'),
|
||||
last_execution_date: executionStatus.lastExecutionDate,
|
||||
},
|
||||
actions: actions.map(({ group, id, actionTypeId, params }) => ({
|
||||
group,
|
||||
id,
|
||||
params,
|
||||
connector_type_id: actionTypeId,
|
||||
})),
|
||||
});
|
||||
|
||||
export const getRuleRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.get(
|
||||
{
|
||||
path: `${BASE_ALERTING_API_PATH}/rule/{id}`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const { id } = req.params;
|
||||
const rule = await alertsClient.get({ id });
|
||||
return res.ok({
|
||||
body: rewriteBodyRes(rule),
|
||||
});
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { getRuleAlertSummaryRoute } from './get_rule_alert_summary';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { SavedObjectsErrorHelpers } from 'src/core/server';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { AlertInstanceSummary } from '../types';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('getRuleAlertSummaryRoute', () => {
|
||||
const dateString = new Date().toISOString();
|
||||
const mockedAlertInstanceSummary: AlertInstanceSummary = {
|
||||
id: '',
|
||||
name: '',
|
||||
tags: [],
|
||||
alertTypeId: '',
|
||||
consumer: '',
|
||||
muteAll: false,
|
||||
throttle: null,
|
||||
enabled: false,
|
||||
statusStartDate: dateString,
|
||||
statusEndDate: dateString,
|
||||
status: 'OK',
|
||||
errorMessages: [],
|
||||
instances: {},
|
||||
};
|
||||
|
||||
it('gets rule alert summary', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleAlertSummaryRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rule/{id}/_alert_summary"`);
|
||||
|
||||
alertsClient.getAlertInstanceSummary.mockResolvedValueOnce(mockedAlertInstanceSummary);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
query: {},
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(alertsClient.getAlertInstanceSummary).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.getAlertInstanceSummary.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"dateStart": undefined,
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.ok).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('returns NOT-FOUND when rule is not found', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleAlertSummaryRoute(router, licenseState);
|
||||
|
||||
const [, handler] = router.get.mock.calls[0];
|
||||
|
||||
alertsClient.getAlertInstanceSummary = jest
|
||||
.fn()
|
||||
.mockResolvedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1'));
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
query: {},
|
||||
},
|
||||
['notFound']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual(undefined);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { GetAlertInstanceSummaryParams } from '../alerts_client';
|
||||
import { RewriteRequestCase, RewriteResponseCase, verifyAccessAndContext } from './lib';
|
||||
import {
|
||||
AlertingRequestHandlerContext,
|
||||
INTERNAL_BASE_ALERTING_API_PATH,
|
||||
AlertInstanceSummary,
|
||||
} from '../types';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
});
|
||||
|
||||
const querySchema = schema.object({
|
||||
date_start: schema.maybe(schema.string()),
|
||||
});
|
||||
|
||||
const rewriteReq: RewriteRequestCase<GetAlertInstanceSummaryParams> = ({
|
||||
date_start: dateStart,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
dateStart,
|
||||
});
|
||||
const rewriteBodyRes: RewriteResponseCase<AlertInstanceSummary> = ({
|
||||
alertTypeId,
|
||||
muteAll,
|
||||
statusStartDate,
|
||||
statusEndDate,
|
||||
errorMessages,
|
||||
lastRun,
|
||||
instances: alerts,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
alerts,
|
||||
rule_type_id: alertTypeId,
|
||||
mute_all: muteAll,
|
||||
status_start_date: statusStartDate,
|
||||
status_end_date: statusEndDate,
|
||||
error_messages: errorMessages,
|
||||
last_run: lastRun,
|
||||
});
|
||||
|
||||
export const getRuleAlertSummaryRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.get(
|
||||
{
|
||||
path: `${INTERNAL_BASE_ALERTING_API_PATH}/rule/{id}/_alert_summary`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
query: querySchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const { id } = req.params;
|
||||
const summary = await alertsClient.getAlertInstanceSummary(
|
||||
rewriteReq({ id, ...req.query })
|
||||
);
|
||||
return res.ok({ body: rewriteBodyRes(summary) });
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
150
x-pack/plugins/alerting/server/routes/get_rule_state.test.ts
Normal file
150
x-pack/plugins/alerting/server/routes/get_rule_state.test.ts
Normal file
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { getRuleStateRoute } from './get_rule_state';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { SavedObjectsErrorHelpers } from 'src/core/server';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('getRuleStateRoute', () => {
|
||||
const mockedAlertState = {
|
||||
alertTypeState: {
|
||||
some: 'value',
|
||||
},
|
||||
alertInstances: {
|
||||
first_instance: {
|
||||
state: {},
|
||||
meta: {
|
||||
lastScheduledActions: {
|
||||
group: 'first_group',
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
},
|
||||
second_instance: {},
|
||||
},
|
||||
};
|
||||
|
||||
it('gets rule state', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleStateRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rule/{id}/state"`);
|
||||
|
||||
alertsClient.getAlertState.mockResolvedValueOnce(mockedAlertState);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
},
|
||||
['ok']
|
||||
);
|
||||
|
||||
await handler(context, req, res);
|
||||
|
||||
expect(alertsClient.getAlertState).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.getAlertState.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.ok).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('returns NO-CONTENT when rule exists but has no task state yet', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleStateRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rule/{id}/state"`);
|
||||
|
||||
alertsClient.getAlertState.mockResolvedValueOnce(undefined);
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
},
|
||||
['noContent']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual(undefined);
|
||||
|
||||
expect(alertsClient.getAlertState).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.getAlertState.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
|
||||
expect(res.noContent).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('returns NOT-FOUND when rule is not found', async () => {
|
||||
const licenseState = licenseStateMock.create();
|
||||
const router = httpServiceMock.createRouter();
|
||||
|
||||
getRuleStateRoute(router, licenseState);
|
||||
|
||||
const [config, handler] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rule/{id}/state"`);
|
||||
|
||||
alertsClient.getAlertState = jest
|
||||
.fn()
|
||||
.mockResolvedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1'));
|
||||
|
||||
const [context, req, res] = mockHandlerArguments(
|
||||
{ alertsClient },
|
||||
{
|
||||
params: {
|
||||
id: '1',
|
||||
},
|
||||
},
|
||||
['notFound']
|
||||
);
|
||||
|
||||
expect(await handler(context, req, res)).toEqual(undefined);
|
||||
|
||||
expect(alertsClient.getAlertState).toHaveBeenCalledTimes(1);
|
||||
expect(alertsClient.getAlertState.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"id": "1",
|
||||
},
|
||||
]
|
||||
`);
|
||||
});
|
||||
});
|
54
x-pack/plugins/alerting/server/routes/get_rule_state.ts
Normal file
54
x-pack/plugins/alerting/server/routes/get_rule_state.ts
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { RewriteResponseCase, verifyAccessAndContext } from './lib';
|
||||
import {
|
||||
AlertingRequestHandlerContext,
|
||||
INTERNAL_BASE_ALERTING_API_PATH,
|
||||
AlertTaskState,
|
||||
} from '../types';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
});
|
||||
|
||||
const rewriteBodyRes: RewriteResponseCase<AlertTaskState> = ({
|
||||
alertTypeState,
|
||||
alertInstances,
|
||||
previousStartedAt,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
rule_type_state: alertTypeState,
|
||||
alerts: alertInstances,
|
||||
previous_started_at: previousStartedAt,
|
||||
});
|
||||
|
||||
export const getRuleStateRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState
|
||||
) => {
|
||||
router.get(
|
||||
{
|
||||
path: `${INTERNAL_BASE_ALERTING_API_PATH}/rule/{id}/state`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
||||
},
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
const alertsClient = context.alerting.getAlertsClient();
|
||||
const { id } = req.params;
|
||||
const state = await alertsClient.getAlertState({ id });
|
||||
return state ? res.ok({ body: rewriteBodyRes(state) }) : res.noContent();
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
|
@ -54,7 +54,7 @@ describe('healthRoute', () => {
|
|||
|
||||
const [config] = router.get.mock.calls[0];
|
||||
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerts/_health"`);
|
||||
expect(config.path).toMatchInlineSnapshot(`"/api/alerting/_health"`);
|
||||
});
|
||||
|
||||
it('queries the usage api', async () => {
|
||||
|
@ -107,22 +107,22 @@ describe('healthRoute', () => {
|
|||
|
||||
expect(await handler(context, req, res)).toStrictEqual({
|
||||
body: {
|
||||
alertingFrameworkHeath: {
|
||||
decryptionHealth: {
|
||||
alerting_framework_heath: {
|
||||
decryption_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
executionHealth: {
|
||||
execution_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
readHealth: {
|
||||
read_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
},
|
||||
hasPermanentEncryptionKey: false,
|
||||
isSufficientlySecure: true,
|
||||
has_permanent_encryption_key: false,
|
||||
is_sufficiently_secure: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -148,22 +148,22 @@ describe('healthRoute', () => {
|
|||
|
||||
expect(await handler(context, req, res)).toStrictEqual({
|
||||
body: {
|
||||
alertingFrameworkHeath: {
|
||||
decryptionHealth: {
|
||||
alerting_framework_heath: {
|
||||
decryption_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
executionHealth: {
|
||||
execution_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
readHealth: {
|
||||
read_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
},
|
||||
hasPermanentEncryptionKey: true,
|
||||
isSufficientlySecure: true,
|
||||
has_permanent_encryption_key: true,
|
||||
is_sufficiently_secure: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -189,22 +189,22 @@ describe('healthRoute', () => {
|
|||
|
||||
expect(await handler(context, req, res)).toStrictEqual({
|
||||
body: {
|
||||
alertingFrameworkHeath: {
|
||||
decryptionHealth: {
|
||||
alerting_framework_heath: {
|
||||
decryption_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
executionHealth: {
|
||||
execution_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
readHealth: {
|
||||
read_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
},
|
||||
hasPermanentEncryptionKey: true,
|
||||
isSufficientlySecure: true,
|
||||
has_permanent_encryption_key: true,
|
||||
is_sufficiently_secure: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -230,22 +230,22 @@ describe('healthRoute', () => {
|
|||
|
||||
expect(await handler(context, req, res)).toStrictEqual({
|
||||
body: {
|
||||
alertingFrameworkHeath: {
|
||||
decryptionHealth: {
|
||||
alerting_framework_heath: {
|
||||
decryption_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
executionHealth: {
|
||||
execution_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
readHealth: {
|
||||
read_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
},
|
||||
hasPermanentEncryptionKey: true,
|
||||
isSufficientlySecure: false,
|
||||
has_permanent_encryption_key: true,
|
||||
is_sufficiently_secure: false,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -273,22 +273,22 @@ describe('healthRoute', () => {
|
|||
|
||||
expect(await handler(context, req, res)).toStrictEqual({
|
||||
body: {
|
||||
alertingFrameworkHeath: {
|
||||
decryptionHealth: {
|
||||
alerting_framework_heath: {
|
||||
decryption_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
executionHealth: {
|
||||
execution_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
readHealth: {
|
||||
read_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
},
|
||||
hasPermanentEncryptionKey: true,
|
||||
isSufficientlySecure: false,
|
||||
has_permanent_encryption_key: true,
|
||||
is_sufficiently_secure: false,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -316,22 +316,22 @@ describe('healthRoute', () => {
|
|||
|
||||
expect(await handler(context, req, res)).toStrictEqual({
|
||||
body: {
|
||||
alertingFrameworkHeath: {
|
||||
decryptionHealth: {
|
||||
alerting_framework_heath: {
|
||||
decryption_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
executionHealth: {
|
||||
execution_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
readHealth: {
|
||||
read_health: {
|
||||
status: HealthStatus.OK,
|
||||
timestamp: currentDate,
|
||||
},
|
||||
},
|
||||
hasPermanentEncryptionKey: true,
|
||||
isSufficientlySecure: true,
|
||||
has_permanent_encryption_key: true,
|
||||
is_sufficiently_secure: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
@ -6,11 +6,15 @@
|
|||
*/
|
||||
|
||||
import { ApiResponse } from '@elastic/elasticsearch';
|
||||
import type { AlertingRouter } from '../types';
|
||||
import { ILicenseState } from '../lib/license_state';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { AlertingFrameworkHealth } from '../types';
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { EncryptedSavedObjectsPluginSetup } from '../../../encrypted_saved_objects/server';
|
||||
import { RewriteResponseCase, verifyAccessAndContext } from './lib';
|
||||
import {
|
||||
AlertingRequestHandlerContext,
|
||||
BASE_ALERTING_API_PATH,
|
||||
AlertingFrameworkHealth,
|
||||
} from '../types';
|
||||
|
||||
interface XPackUsageSecurity {
|
||||
security?: {
|
||||
|
@ -23,49 +27,63 @@ interface XPackUsageSecurity {
|
|||
};
|
||||
}
|
||||
|
||||
export function healthRoute(
|
||||
router: AlertingRouter,
|
||||
const rewriteBodyRes: RewriteResponseCase<AlertingFrameworkHealth> = ({
|
||||
isSufficientlySecure,
|
||||
hasPermanentEncryptionKey,
|
||||
alertingFrameworkHeath,
|
||||
...rest
|
||||
}) => ({
|
||||
...rest,
|
||||
is_sufficiently_secure: isSufficientlySecure,
|
||||
has_permanent_encryption_key: hasPermanentEncryptionKey,
|
||||
alerting_framework_heath: {
|
||||
decryption_health: alertingFrameworkHeath.decryptionHealth,
|
||||
execution_health: alertingFrameworkHeath.executionHealth,
|
||||
read_health: alertingFrameworkHeath.readHealth,
|
||||
},
|
||||
});
|
||||
|
||||
export const healthRoute = (
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState,
|
||||
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup
|
||||
) {
|
||||
) => {
|
||||
router.get(
|
||||
{
|
||||
path: '/api/alerts/_health',
|
||||
path: `${BASE_ALERTING_API_PATH}/_health`,
|
||||
validate: false,
|
||||
},
|
||||
router.handleLegacyErrors(async function (context, req, res) {
|
||||
verifyApiAccess(licenseState);
|
||||
if (!context.alerting) {
|
||||
return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' });
|
||||
}
|
||||
try {
|
||||
const {
|
||||
body: {
|
||||
security: {
|
||||
enabled: isSecurityEnabled = false,
|
||||
ssl: { http: { enabled: isTLSEnabled = false } = {} } = {},
|
||||
} = {},
|
||||
},
|
||||
}: ApiResponse<XPackUsageSecurity> = await context.core.elasticsearch.client.asInternalUser.transport // Do not augment with such input. // `transport.request` is potentially unsafe when combined with untrusted user input.
|
||||
.request({
|
||||
method: 'GET',
|
||||
path: '/_xpack/usage',
|
||||
router.handleLegacyErrors(
|
||||
verifyAccessAndContext(licenseState, async function (context, req, res) {
|
||||
try {
|
||||
const {
|
||||
body: {
|
||||
security: {
|
||||
enabled: isSecurityEnabled = false,
|
||||
ssl: { http: { enabled: isTLSEnabled = false } = {} } = {},
|
||||
} = {},
|
||||
},
|
||||
}: ApiResponse<XPackUsageSecurity> = await context.core.elasticsearch.client.asInternalUser.transport // Do not augment with such input. // `transport.request` is potentially unsafe when combined with untrusted user input.
|
||||
.request({
|
||||
method: 'GET',
|
||||
path: '/_xpack/usage',
|
||||
});
|
||||
|
||||
const alertingFrameworkHeath = await context.alerting.getFrameworkHealth();
|
||||
|
||||
const frameworkHealth: AlertingFrameworkHealth = {
|
||||
isSufficientlySecure: !isSecurityEnabled || (isSecurityEnabled && isTLSEnabled),
|
||||
hasPermanentEncryptionKey: encryptedSavedObjects.canEncrypt,
|
||||
alertingFrameworkHeath,
|
||||
};
|
||||
|
||||
return res.ok({
|
||||
body: rewriteBodyRes(frameworkHealth),
|
||||
});
|
||||
|
||||
const alertingFrameworkHeath = await context.alerting.getFrameworkHealth();
|
||||
|
||||
const frameworkHealth: AlertingFrameworkHealth = {
|
||||
isSufficientlySecure: !isSecurityEnabled || (isSecurityEnabled && isTLSEnabled),
|
||||
hasPermanentEncryptionKey: encryptedSavedObjects.canEncrypt,
|
||||
alertingFrameworkHeath,
|
||||
};
|
||||
|
||||
return res.ok({
|
||||
body: frameworkHealth,
|
||||
});
|
||||
} catch (error) {
|
||||
return res.badRequest({ body: error });
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
return res.badRequest({ body: error });
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5,20 +5,50 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
export { aggregateAlertRoute } from './aggregate';
|
||||
export { createAlertRoute } from './create';
|
||||
export { deleteAlertRoute } from './delete';
|
||||
export { findAlertRoute } from './find';
|
||||
export { getAlertRoute } from './get';
|
||||
export { getAlertStateRoute } from './get_alert_state';
|
||||
export { getAlertInstanceSummaryRoute } from './get_alert_instance_summary';
|
||||
export { listAlertTypesRoute } from './list_alert_types';
|
||||
export { updateAlertRoute } from './update';
|
||||
export { enableAlertRoute } from './enable';
|
||||
export { disableAlertRoute } from './disable';
|
||||
export { updateApiKeyRoute } from './update_api_key';
|
||||
export { muteAlertInstanceRoute } from './mute_instance';
|
||||
export { unmuteAlertInstanceRoute } from './unmute_instance';
|
||||
export { muteAllAlertRoute } from './mute_all';
|
||||
export { unmuteAllAlertRoute } from './unmute_all';
|
||||
export { healthRoute } from './health';
|
||||
import { IRouter } from 'kibana/server';
|
||||
import { ILicenseState } from '../lib';
|
||||
import { defineLegacyRoutes } from './legacy';
|
||||
import { AlertingRequestHandlerContext } from '../types';
|
||||
import { EncryptedSavedObjectsPluginSetup } from '../../../encrypted_saved_objects/server';
|
||||
import { createRuleRoute } from './create_rule';
|
||||
import { getRuleRoute } from './get_rule';
|
||||
import { updateRuleRoute } from './update_rule';
|
||||
import { deleteRuleRoute } from './delete_rule';
|
||||
import { aggregateRulesRoute } from './aggregate_rules';
|
||||
import { disableRuleRoute } from './disable_rule';
|
||||
import { enableRuleRoute } from './enable_rule';
|
||||
import { findRulesRoute } from './find_rules';
|
||||
import { getRuleAlertSummaryRoute } from './get_rule_alert_summary';
|
||||
import { getRuleStateRoute } from './get_rule_state';
|
||||
import { healthRoute } from './health';
|
||||
import { ruleTypesRoute } from './rule_types';
|
||||
import { muteAllRuleRoute } from './mute_all_rule';
|
||||
import { muteAlertRoute } from './mute_alert';
|
||||
import { unmuteAllRuleRoute } from './unmute_all_rule';
|
||||
import { unmuteAlertRoute } from './unmute_alert';
|
||||
import { updateRuleApiKeyRoute } from './update_rule_api_key';
|
||||
|
||||
export function defineRoutes(
|
||||
router: IRouter<AlertingRequestHandlerContext>,
|
||||
licenseState: ILicenseState,
|
||||
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup
|
||||
) {
|
||||
defineLegacyRoutes(router, licenseState, encryptedSavedObjects);
|
||||
createRuleRoute(router, licenseState);
|
||||
getRuleRoute(router, licenseState);
|
||||
updateRuleRoute(router, licenseState);
|
||||
deleteRuleRoute(router, licenseState);
|
||||
aggregateRulesRoute(router, licenseState);
|
||||
disableRuleRoute(router, licenseState);
|
||||
enableRuleRoute(router, licenseState);
|
||||
findRulesRoute(router, licenseState);
|
||||
getRuleAlertSummaryRoute(router, licenseState);
|
||||
getRuleStateRoute(router, licenseState);
|
||||
healthRoute(router, licenseState, encryptedSavedObjects);
|
||||
ruleTypesRoute(router, licenseState);
|
||||
muteAllRuleRoute(router, licenseState);
|
||||
muteAlertRoute(router, licenseState);
|
||||
unmuteAllRuleRoute(router, licenseState);
|
||||
unmuteAlertRoute(router, licenseState);
|
||||
updateRuleApiKeyRoute(router, licenseState);
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
import { aggregateAlertRoute } from './aggregate';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { licenseStateMock } from '../../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './../_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../../alerts_client.mock';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
jest.mock('../../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type { AlertingRouter } from '../types';
|
||||
import { ILicenseState } from '../lib/license_state';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { BASE_ALERT_API_PATH } from '../../common';
|
||||
import { renameKeys } from './lib/rename_keys';
|
||||
import { FindOptions } from '../alerts_client';
|
||||
import type { AlertingRouter } from '../../types';
|
||||
import { ILicenseState } from '../../lib/license_state';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { LEGACY_BASE_ALERT_API_PATH } from '../../../common';
|
||||
import { renameKeys } from './../lib/rename_keys';
|
||||
import { FindOptions } from '../../alerts_client';
|
||||
|
||||
// config definition
|
||||
const querySchema = schema.object({
|
||||
|
@ -36,7 +36,7 @@ const querySchema = schema.object({
|
|||
export const aggregateAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => {
|
||||
router.get(
|
||||
{
|
||||
path: `${BASE_ALERT_API_PATH}/_aggregate`,
|
||||
path: `${LEGACY_BASE_ALERT_API_PATH}/_aggregate`,
|
||||
validate: {
|
||||
query: querySchema,
|
||||
},
|
|
@ -7,16 +7,16 @@
|
|||
|
||||
import { createAlertRoute } from './create';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { Alert } from '../../common/alert';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
import { licenseStateMock } from '../../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './../_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../../alerts_client.mock';
|
||||
import { Alert } from '../../../common/alert';
|
||||
import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
jest.mock('../../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
|
@ -6,19 +6,19 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type { AlertingRouter } from '../types';
|
||||
import { ILicenseState } from '../lib/license_state';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { validateDurationSchema } from '../lib';
|
||||
import { handleDisabledApiKeysError } from './lib/error_handler';
|
||||
import type { AlertingRouter } from '../../types';
|
||||
import { ILicenseState } from '../../lib/license_state';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { validateDurationSchema } from '../../lib';
|
||||
import { handleDisabledApiKeysError } from './../lib/error_handler';
|
||||
import {
|
||||
Alert,
|
||||
SanitizedAlert,
|
||||
AlertNotifyWhenType,
|
||||
AlertTypeParams,
|
||||
BASE_ALERT_API_PATH,
|
||||
LEGACY_BASE_ALERT_API_PATH,
|
||||
validateNotifyWhenType,
|
||||
} from '../types';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
} from '../../types';
|
||||
import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled';
|
||||
|
||||
export const bodySchema = schema.object({
|
||||
name: schema.string(),
|
||||
|
@ -46,7 +46,7 @@ export const bodySchema = schema.object({
|
|||
export const createAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => {
|
||||
router.post(
|
||||
{
|
||||
path: `${BASE_ALERT_API_PATH}/alert/{id?}`,
|
||||
path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id?}`,
|
||||
validate: {
|
||||
params: schema.maybe(
|
||||
schema.object({
|
||||
|
@ -68,10 +68,12 @@ export const createAlertRoute = (router: AlertingRouter, licenseState: ILicenseS
|
|||
const params = req.params;
|
||||
const notifyWhen = alert?.notifyWhen ? (alert.notifyWhen as AlertNotifyWhenType) : null;
|
||||
try {
|
||||
const alertRes: Alert<AlertTypeParams> = await alertsClient.create<AlertTypeParams>({
|
||||
data: { ...alert, notifyWhen },
|
||||
options: { id: params?.id },
|
||||
});
|
||||
const alertRes: SanitizedAlert<AlertTypeParams> = await alertsClient.create<AlertTypeParams>(
|
||||
{
|
||||
data: { ...alert, notifyWhen },
|
||||
options: { id: params?.id },
|
||||
}
|
||||
);
|
||||
return res.ok({
|
||||
body: alertRes,
|
||||
});
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
import { deleteAlertRoute } from './delete';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { licenseStateMock } from '../../lib/license_state.mock';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { mockHandlerArguments } from './../_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../../alerts_client.mock';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
jest.mock('../../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
|
@ -6,10 +6,10 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type { AlertingRouter } from '../types';
|
||||
import { ILicenseState } from '../lib/license_state';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { BASE_ALERT_API_PATH } from '../../common';
|
||||
import type { AlertingRouter } from '../../types';
|
||||
import { ILicenseState } from '../../lib/license_state';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { LEGACY_BASE_ALERT_API_PATH } from '../../../common';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
|
@ -18,7 +18,7 @@ const paramSchema = schema.object({
|
|||
export const deleteAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => {
|
||||
router.delete(
|
||||
{
|
||||
path: `${BASE_ALERT_API_PATH}/alert/{id}`,
|
||||
path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
import { disableAlertRoute } from './disable';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
import { licenseStateMock } from '../../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './../_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
jest.mock('../../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
|
@ -6,11 +6,11 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type { AlertingRouter } from '../types';
|
||||
import { ILicenseState } from '../lib/license_state';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { BASE_ALERT_API_PATH } from '../../common';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
import type { AlertingRouter } from '../../types';
|
||||
import { ILicenseState } from '../../lib/license_state';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { LEGACY_BASE_ALERT_API_PATH } from '../../../common';
|
||||
import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
|
@ -19,7 +19,7 @@ const paramSchema = schema.object({
|
|||
export const disableAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => {
|
||||
router.post(
|
||||
{
|
||||
path: `${BASE_ALERT_API_PATH}/alert/{id}/_disable`,
|
||||
path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_disable`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
import { enableAlertRoute } from './enable';
|
||||
import { httpServiceMock } from 'src/core/server/mocks';
|
||||
import { licenseStateMock } from '../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
import { licenseStateMock } from '../../lib/license_state.mock';
|
||||
import { mockHandlerArguments } from './../_mock_handler_arguments';
|
||||
import { alertsClientMock } from '../../alerts_client.mock';
|
||||
import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled';
|
||||
|
||||
const alertsClient = alertsClientMock.create();
|
||||
|
||||
jest.mock('../lib/license_api_access.ts', () => ({
|
||||
jest.mock('../../lib/license_api_access.ts', () => ({
|
||||
verifyApiAccess: jest.fn(),
|
||||
}));
|
||||
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type { AlertingRouter } from '../types';
|
||||
import { ILicenseState } from '../lib/license_state';
|
||||
import { verifyApiAccess } from '../lib/license_api_access';
|
||||
import { BASE_ALERT_API_PATH } from '../../common';
|
||||
import { handleDisabledApiKeysError } from './lib/error_handler';
|
||||
import { AlertTypeDisabledError } from '../lib/errors/alert_type_disabled';
|
||||
import type { AlertingRouter } from '../../types';
|
||||
import { ILicenseState } from '../../lib/license_state';
|
||||
import { verifyApiAccess } from '../../lib/license_api_access';
|
||||
import { LEGACY_BASE_ALERT_API_PATH } from '../../../common';
|
||||
import { handleDisabledApiKeysError } from './../lib/error_handler';
|
||||
import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled';
|
||||
|
||||
const paramSchema = schema.object({
|
||||
id: schema.string(),
|
||||
|
@ -20,7 +20,7 @@ const paramSchema = schema.object({
|
|||
export const enableAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => {
|
||||
router.post(
|
||||
{
|
||||
path: `${BASE_ALERT_API_PATH}/alert/{id}/_enable`,
|
||||
path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_enable`,
|
||||
validate: {
|
||||
params: paramSchema,
|
||||
},
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue