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

[Infra UI] Add new graphql endpoint for snapshot data #34264

Merged
merged 14 commits into from
Apr 18, 2019
65 changes: 64 additions & 1 deletion x-pack/plugins/infra/common/graphql/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable */
/* tslint:disable */

// ====================================================
// START: Typescript template
Expand Down Expand Up @@ -38,6 +38,8 @@ export interface InfraSource {
logItem: InfraLogItem;
/** A hierarchy of hosts, pods, containers, services or arbitrary groups */
map?: InfraResponse | null;
/** A snapshot of nodes */
snapshot?: InfraSnapshotResponse | null;

metrics: InfraMetricData[];
}
Expand Down Expand Up @@ -223,6 +225,33 @@ export interface InfraNodeMetric {
max: number;
}

export interface InfraSnapshotResponse {
/** Nodes of type host, container or pod grouped by 0, 1 or 2 terms */
nodes: InfraSnapshotNode[];
}

export interface InfraSnapshotNode {
path: InfraSnapshotNodePath[];

metric: InfraSnapshotNodeMetric;
}

export interface InfraSnapshotNodePath {
value: string;

label: string;
}

export interface InfraSnapshotNodeMetric {
name: InfraSnapshotMetricType;

value?: number | null;

avg?: number | null;

max?: number | null;
}

export interface InfraMetricData {
id?: InfraMetric | null;

Expand Down Expand Up @@ -306,6 +335,18 @@ export interface InfraMetricInput {
/** The type of metric */
type: InfraMetricType;
}

export interface InfraSnapshotGroupbyInput {
/** The label to use in the results for the group by for the terms group by */
label?: string | null;
/** The field to group by from a terms aggregation, this is ignored by the filter type */
field?: string | null;
}

export interface InfraSnapshotMetricInput {
/** The type of metric */
type: InfraSnapshotMetricType;
}
/** The source to be created */
export interface CreateSourceInput {
/** The name of the data source */
Expand Down Expand Up @@ -427,6 +468,11 @@ export interface MapInfraSourceArgs {

filterQuery?: string | null;
}
export interface SnapshotInfraSourceArgs {
timerange: InfraTimerangeInput;

filterQuery?: string | null;
}
export interface MetricsInfraSourceArgs {
nodeId: string;

Expand All @@ -444,6 +490,13 @@ export interface NodesInfraResponseArgs {

metric: InfraMetricInput;
}
export interface NodesInfraSnapshotResponseArgs {
type: InfraNodeType;

groupby: InfraSnapshotGroupbyInput[];

metric: InfraSnapshotMetricInput;
}
export interface CreateSourceMutationArgs {
/** The id of the source */
id: string;
Expand Down Expand Up @@ -496,6 +549,16 @@ export enum InfraMetricType {
logRate = 'logRate',
}

export enum InfraSnapshotMetricType {
count = 'count',
cpu = 'cpu',
load = 'load',
memory = 'memory',
tx = 'tx',
rx = 'rx',
logRate = 'logRate',
}

export enum InfraMetric {
hostSystemOverview = 'hostSystemOverview',
hostCpuUsage = 'hostCpuUsage',
Expand Down
Loading