mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Stack Monitoring] Convert standalone_clusters directory to typescript (#112696)
* [Stack Monitoring] Convert standalone_clusters directory to typescript * Fix types Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
dc024442ec
commit
add8f130cf
3 changed files with 10 additions and 8 deletions
|
@ -156,7 +156,7 @@ export interface ElasticsearchLegacySource {
|
|||
heap_max_in_bytes?: number;
|
||||
};
|
||||
};
|
||||
fs: {
|
||||
fs?: {
|
||||
available_in_bytes?: number;
|
||||
total_in_bytes?: number;
|
||||
};
|
||||
|
@ -497,7 +497,7 @@ export interface ElasticsearchMetricbeatSource {
|
|||
};
|
||||
nodes?: {
|
||||
versions?: string[];
|
||||
count?: number;
|
||||
count?: number | {};
|
||||
jvm?: {
|
||||
max_uptime?: {
|
||||
ms?: number;
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
*/
|
||||
|
||||
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../common/constants';
|
||||
import { Cluster } from '../../types';
|
||||
|
||||
export const getStandaloneClusterDefinition = () => {
|
||||
export const getStandaloneClusterDefinition: () => Cluster = () => {
|
||||
return {
|
||||
cluster_uuid: STANDALONE_CLUSTER_CLUSTER_UUID,
|
||||
license: {},
|
||||
|
@ -28,5 +29,5 @@ export const getStandaloneClusterDefinition = () => {
|
|||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
} as Cluster;
|
||||
};
|
|
@ -7,15 +7,16 @@
|
|||
|
||||
import moment from 'moment';
|
||||
import { get } from 'lodash';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { standaloneClusterFilter } from './';
|
||||
|
||||
export async function hasStandaloneClusters(req, indexPatterns) {
|
||||
export async function hasStandaloneClusters(req: LegacyRequest, indexPatterns: string[]) {
|
||||
const indexPatternList = indexPatterns.reduce((list, patterns) => {
|
||||
list.push(...patterns.split(','));
|
||||
return list;
|
||||
}, []);
|
||||
}, [] as string[]);
|
||||
|
||||
const filters = [
|
||||
const filters: any[] = [
|
||||
standaloneClusterFilter,
|
||||
{
|
||||
bool: {
|
||||
|
@ -39,7 +40,7 @@ export async function hasStandaloneClusters(req, indexPatterns) {
|
|||
const start = req.payload.timeRange.min;
|
||||
const end = req.payload.timeRange.max;
|
||||
|
||||
const timeRangeFilter = {
|
||||
const timeRangeFilter: { range: { timestamp: Record<string, any> } } = {
|
||||
range: {
|
||||
timestamp: {
|
||||
format: 'epoch_millis',
|
Loading…
Add table
Add a link
Reference in a new issue