-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:elastic/kibana into fix/explicit-…
…requirement-for-ngSanitize
- Loading branch information
Showing
86 changed files
with
2,929 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,10 @@ | |
}, | ||
"end": { | ||
"type": "date" | ||
}, | ||
"outcome": { | ||
"ignore_above": 1024, | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
x-pack/plugins/infra/common/http_api/log_sources/get_log_source_configuration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as rt from 'io-ts'; | ||
import { badRequestErrorRT, forbiddenErrorRT, routeTimingMetadataRT } from '../shared'; | ||
import { logSourceConfigurationRT } from './log_source_configuration'; | ||
|
||
/** | ||
* request | ||
*/ | ||
|
||
export const getLogSourceConfigurationRequestParamsRT = rt.type({ | ||
// the id of the source configuration | ||
sourceId: rt.string, | ||
}); | ||
|
||
export type GetLogSourceConfigurationRequestParams = rt.TypeOf< | ||
typeof getLogSourceConfigurationRequestParamsRT | ||
>; | ||
|
||
/** | ||
* response | ||
*/ | ||
|
||
export const getLogSourceConfigurationSuccessResponsePayloadRT = rt.intersection([ | ||
rt.type({ | ||
data: logSourceConfigurationRT, | ||
}), | ||
rt.partial({ | ||
timing: routeTimingMetadataRT, | ||
}), | ||
]); | ||
|
||
export type GetLogSourceConfigurationSuccessResponsePayload = rt.TypeOf< | ||
typeof getLogSourceConfigurationSuccessResponsePayloadRT | ||
>; | ||
|
||
export const getLogSourceConfigurationErrorResponsePayloadRT = rt.union([ | ||
badRequestErrorRT, | ||
forbiddenErrorRT, | ||
]); | ||
|
||
export type GetLogSourceConfigurationErrorReponsePayload = rt.TypeOf< | ||
typeof getLogSourceConfigurationErrorResponsePayloadRT | ||
>; | ||
|
||
export const getLogSourceConfigurationResponsePayloadRT = rt.union([ | ||
getLogSourceConfigurationSuccessResponsePayloadRT, | ||
getLogSourceConfigurationErrorResponsePayloadRT, | ||
]); | ||
|
||
export type GetLogSourceConfigurationReponsePayload = rt.TypeOf< | ||
typeof getLogSourceConfigurationResponsePayloadRT | ||
>; |
61 changes: 61 additions & 0 deletions
61
x-pack/plugins/infra/common/http_api/log_sources/get_log_source_status.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as rt from 'io-ts'; | ||
import { routeTimingMetadataRT } from '../shared'; | ||
import { | ||
getLogSourceConfigurationPath, | ||
LOG_SOURCE_CONFIGURATION_PATH, | ||
} from './log_source_configuration'; | ||
|
||
export const LOG_SOURCE_STATUS_PATH_SUFFIX = 'status'; | ||
export const LOG_SOURCE_STATUS_PATH = `${LOG_SOURCE_CONFIGURATION_PATH}/${LOG_SOURCE_STATUS_PATH_SUFFIX}`; | ||
export const getLogSourceStatusPath = (sourceId: string) => | ||
`${getLogSourceConfigurationPath(sourceId)}/${LOG_SOURCE_STATUS_PATH_SUFFIX}`; | ||
|
||
/** | ||
* request | ||
*/ | ||
|
||
export const getLogSourceStatusRequestParamsRT = rt.type({ | ||
// the id of the source configuration | ||
sourceId: rt.string, | ||
}); | ||
|
||
export type GetLogSourceStatusRequestParams = rt.TypeOf<typeof getLogSourceStatusRequestParamsRT>; | ||
|
||
/** | ||
* response | ||
*/ | ||
|
||
const logIndexFieldRT = rt.strict({ | ||
name: rt.string, | ||
type: rt.string, | ||
searchable: rt.boolean, | ||
aggregatable: rt.boolean, | ||
}); | ||
|
||
export type LogIndexField = rt.TypeOf<typeof logIndexFieldRT>; | ||
|
||
const logSourceStatusRT = rt.strict({ | ||
logIndexFields: rt.array(logIndexFieldRT), | ||
logIndexNames: rt.array(rt.string), | ||
}); | ||
|
||
export type LogSourceStatus = rt.TypeOf<typeof logSourceStatusRT>; | ||
|
||
export const getLogSourceStatusSuccessResponsePayloadRT = rt.intersection([ | ||
rt.type({ | ||
data: logSourceStatusRT, | ||
}), | ||
rt.partial({ | ||
timing: routeTimingMetadataRT, | ||
}), | ||
]); | ||
|
||
export type GetLogSourceStatusSuccessResponsePayload = rt.TypeOf< | ||
typeof getLogSourceStatusSuccessResponsePayloadRT | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './get_log_source_configuration'; | ||
export * from './get_log_source_status'; | ||
export * from './log_source_configuration'; | ||
export * from './patch_log_source_configuration'; |
78 changes: 78 additions & 0 deletions
78
x-pack/plugins/infra/common/http_api/log_sources/log_source_configuration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as rt from 'io-ts'; | ||
|
||
export const LOG_SOURCE_CONFIGURATION_PATH_PREFIX = '/api/infra/log_source_configurations'; | ||
export const LOG_SOURCE_CONFIGURATION_PATH = `${LOG_SOURCE_CONFIGURATION_PATH_PREFIX}/{sourceId}`; | ||
export const getLogSourceConfigurationPath = (sourceId: string) => | ||
`${LOG_SOURCE_CONFIGURATION_PATH_PREFIX}/${sourceId}`; | ||
|
||
export const logSourceConfigurationOriginRT = rt.keyof({ | ||
fallback: null, | ||
internal: null, | ||
stored: null, | ||
}); | ||
|
||
export type LogSourceConfigurationOrigin = rt.TypeOf<typeof logSourceConfigurationOriginRT>; | ||
|
||
const logSourceFieldsConfigurationRT = rt.strict({ | ||
timestamp: rt.string, | ||
tiebreaker: rt.string, | ||
}); | ||
|
||
const logSourceCommonColumnConfigurationRT = rt.strict({ | ||
id: rt.string, | ||
}); | ||
|
||
const logSourceTimestampColumnConfigurationRT = rt.strict({ | ||
timestampColumn: logSourceCommonColumnConfigurationRT, | ||
}); | ||
|
||
const logSourceMessageColumnConfigurationRT = rt.strict({ | ||
messageColumn: logSourceCommonColumnConfigurationRT, | ||
}); | ||
|
||
const logSourceFieldColumnConfigurationRT = rt.strict({ | ||
fieldColumn: rt.intersection([ | ||
logSourceCommonColumnConfigurationRT, | ||
rt.strict({ | ||
field: rt.string, | ||
}), | ||
]), | ||
}); | ||
|
||
const logSourceColumnConfigurationRT = rt.union([ | ||
logSourceTimestampColumnConfigurationRT, | ||
logSourceMessageColumnConfigurationRT, | ||
logSourceFieldColumnConfigurationRT, | ||
]); | ||
|
||
export const logSourceConfigurationPropertiesRT = rt.strict({ | ||
name: rt.string, | ||
description: rt.string, | ||
logAlias: rt.string, | ||
fields: logSourceFieldsConfigurationRT, | ||
logColumns: rt.array(logSourceColumnConfigurationRT), | ||
}); | ||
|
||
export type LogSourceConfigurationProperties = rt.TypeOf<typeof logSourceConfigurationPropertiesRT>; | ||
|
||
export const logSourceConfigurationRT = rt.exact( | ||
rt.intersection([ | ||
rt.type({ | ||
id: rt.string, | ||
origin: logSourceConfigurationOriginRT, | ||
configuration: logSourceConfigurationPropertiesRT, | ||
}), | ||
rt.partial({ | ||
updatedAt: rt.number, | ||
version: rt.string, | ||
}), | ||
]) | ||
); | ||
|
||
export type LogSourceConfiguration = rt.TypeOf<typeof logSourceConfigurationRT>; |
Oops, something went wrong.