Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[7.x] [Stack Monitoring] Convert standalone_clusters directory to typescript (#112696) #113150

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x-pack/plugins/monitoring/common/types/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export interface ElasticsearchLegacySource {
heap_max_in_bytes?: number;
};
};
fs: {
fs?: {
available_in_bytes?: number;
total_in_bytes?: number;
};
Expand Down Expand Up @@ -497,7 +497,7 @@ export interface ElasticsearchMetricbeatSource {
};
nodes?: {
versions?: string[];
count?: number;
count?: number | {};
jvm?: {
max_uptime?: {
ms?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand All @@ -28,5 +29,5 @@ export const getStandaloneClusterDefinition = () => {
},
},
},
};
} as Cluster;
};
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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',
Expand Down