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

[Uptime] Remove pings graphql #59392

Merged
merged 60 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
53a351e
WIP replacing GQL with redux/rest.
justinkambic Feb 24, 2020
e26f6fb
Finish implementing migration.
justinkambic Mar 5, 2020
0f9caf6
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 5, 2020
ecbe20a
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 10, 2020
48a9990
Introduce new connected component for ping list.
justinkambic Mar 11, 2020
0bae48a
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 11, 2020
76a0158
Replace GraphQL type with io-ts.
justinkambic Mar 13, 2020
b7fbc2b
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 16, 2020
aee6023
Update some broken tests.
justinkambic Mar 17, 2020
451c5a1
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 23, 2020
0370e86
Add test for new helper function.
justinkambic Mar 23, 2020
1a23bac
Write test snapshots.
justinkambic Mar 23, 2020
5e86c9f
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 24, 2020
999cc07
Migrate api tests from graphql to rest.
justinkambic Mar 24, 2020
69190d1
Update fixtures that rely on pings.
justinkambic Mar 25, 2020
4635af5
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 25, 2020
2cd661c
Move ping types to runtime_types folder with rest of io-ts files.
justinkambic Mar 25, 2020
db88cd1
Update Ping type location and imports, type checking.
justinkambic Mar 25, 2020
4937eef
Remove reliance on fixtures for ping functional API tests.
justinkambic Mar 25, 2020
d4b53c6
Fix broken unit tests.
justinkambic Mar 25, 2020
8df46a8
Fix broken types.
justinkambic Mar 25, 2020
d913fd1
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 25, 2020
6443af0
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 26, 2020
507dcf7
Remove local state storage from parent components.
justinkambic Mar 27, 2020
8083fb8
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 28, 2020
213e1c2
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 30, 2020
3ff868c
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Mar 31, 2020
c164fbd
Add functional test to cover Ping List functionality.
justinkambic Mar 31, 2020
69e9d49
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 1, 2020
46cc1e5
Fix monitor page functional test that was broken by merge conflicts.
justinkambic Apr 1, 2020
58b95f8
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 2, 2020
18bd154
Fix broken tests.
justinkambic Apr 2, 2020
ad0ffb6
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 2, 2020
b3b5b34
Fix broken API test.
justinkambic Apr 2, 2020
fae606d
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 3, 2020
f2126a7
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 6, 2020
f88bfaf
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 6, 2020
f407eb7
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 7, 2020
496aa53
Replace a test with a describe block that will pre-navigate all tests.
justinkambic Apr 8, 2020
4f23230
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 8, 2020
51e93cc
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 8, 2020
9f4423d
Delete unused reducer keys.
justinkambic Apr 8, 2020
bf8d347
Re-introduce loading to ping list reducer.
justinkambic Apr 8, 2020
9b7c6b0
Inroduce code that will cause PingList to re-fetch when refresh butto…
justinkambic Apr 8, 2020
6bb88e1
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 9, 2020
433bb74
Update expanded rows to support multiple concurrent expanded rows.
justinkambic Apr 9, 2020
0995904
Modify pingList reducer to have singular optional error field.
justinkambic Apr 9, 2020
adf02e3
Delete unnecessary helper code.
justinkambic Apr 10, 2020
b0ca803
Delete unused interface.
justinkambic Apr 10, 2020
1df28d6
Add runtime_type to parse getPings params, fix pagination index.
justinkambic Apr 10, 2020
55ac2aa
Add dedicated monitor type to runtime_types.
justinkambic Apr 10, 2020
a641bcf
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 10, 2020
7426fc7
Fix broken tests.
justinkambic Apr 10, 2020
59bc38f
Fix broken tests.
justinkambic Apr 10, 2020
1062e41
Rename '@timestamp' property to 'timestamp' on Ping type.
justinkambic Apr 10, 2020
70ecdfa
Fix broken type and key pings list table on document ID instead of ti…
justinkambic Apr 13, 2020
e7904dc
Fix broken unit tests.
justinkambic Apr 13, 2020
1418a6d
Merge branch 'master' into uptime_remove-pings-graphql
justinkambic Apr 13, 2020
c1aea4a
Fix broken tests and types.
justinkambic Apr 13, 2020
46f856e
Fix broken functional test.
justinkambic Apr 13, 2020
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
340 changes: 0 additions & 340 deletions x-pack/legacy/plugins/uptime/common/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,294 +15,15 @@ export type UnsignedInteger = any;
// ====================================================

export interface Query {
/** Get a list of all recorded pings for all monitors */
allPings: PingResults;

/** Fetches the current state of Uptime monitors for the given parameters. */
getMonitorStates?: MonitorSummaryResult | null;
}

export interface PingResults {
/** Total number of matching pings */
total: UnsignedInteger;
/** Unique list of all locations the query matched */
locations: string[];
/** List of pings */
pings: Ping[];
}
/** A request sent from a monitor to a host */
export interface Ping {
/** unique ID for this ping */
id: string;
/** The timestamp of the ping's creation */
timestamp: string;
/** The agent that recorded the ping */
beat?: Beat | null;

container?: Container | null;

docker?: Docker | null;

ecs?: Ecs | null;

error?: Error | null;

host?: Host | null;

http?: Http | null;

icmp?: Icmp | null;

kubernetes?: Kubernetes | null;

meta?: Meta | null;

monitor?: Monitor | null;

observer?: Observer | null;

resolve?: Resolve | null;

socks5?: Socks5 | null;

summary?: Summary | null;

tags?: string | null;

tcp?: Tcp | null;

tls?: PingTls | null;

url?: Url | null;
}
/** An agent for recording a beat */
export interface Beat {
hostname?: string | null;

name?: string | null;

timezone?: string | null;

type?: string | null;
}

export interface Container {
id?: string | null;

image?: ContainerImage | null;

name?: string | null;

runtime?: string | null;
}

export interface ContainerImage {
name?: string | null;

tag?: string | null;
}

export interface Docker {
id?: string | null;

image?: string | null;

name?: string | null;
}

export interface Ecs {
version?: string | null;
}

export interface Error {
code?: number | null;

message?: string | null;

type?: string | null;
}

export interface Host {
architecture?: string | null;

id?: string | null;

hostname?: string | null;

ip?: string | null;

mac?: string | null;

name?: string | null;

os?: Os | null;
}

export interface Os {
family?: string | null;

kernel?: string | null;

platform?: string | null;

version?: string | null;

name?: string | null;

build?: string | null;
}

export interface Http {
response?: HttpResponse | null;

rtt?: HttpRtt | null;

url?: string | null;
}

export interface HttpResponse {
status_code?: UnsignedInteger | null;

body?: HttpBody | null;
}

export interface HttpBody {
/** Size of HTTP response body in bytes */
bytes?: UnsignedInteger | null;
/** Hash of the HTTP response body */
hash?: string | null;
/** Response body of the HTTP Response. May be truncated based on client settings. */
content?: string | null;
/** Byte length of the content string, taking into account multibyte chars. */
content_bytes?: UnsignedInteger | null;
}

export interface HttpRtt {
content?: Duration | null;

response_header?: Duration | null;

total?: Duration | null;

validate?: Duration | null;

validate_body?: Duration | null;

write_request?: Duration | null;
}
/** The monitor's status for a ping */
export interface Duration {
us?: UnsignedInteger | null;
}

export interface Icmp {
requests?: number | null;

rtt?: number | null;
}

export interface Kubernetes {
container?: KubernetesContainer | null;

namespace?: string | null;

node?: KubernetesNode | null;

pod?: KubernetesPod | null;
}

export interface KubernetesContainer {
image?: string | null;

name?: string | null;
}

export interface KubernetesNode {
name?: string | null;
}

export interface KubernetesPod {
name?: string | null;

uid?: string | null;
}

export interface Meta {
cloud?: MetaCloud | null;
}

export interface MetaCloud {
availability_zone?: string | null;

instance_id?: string | null;

instance_name?: string | null;

machine_type?: string | null;

project_id?: string | null;

provider?: string | null;

region?: string | null;
}

export interface Monitor {
duration?: Duration | null;

host?: string | null;
/** The id of the monitor */
id?: string | null;
/** The IP pinged by the monitor */
ip?: string | null;
/** The name of the protocol being monitored */
name?: string | null;
/** The protocol scheme of the monitored host */
scheme?: string | null;
/** The status of the monitored host */
status?: string | null;
/** The type of host being monitored */
type?: string | null;

check_group?: string | null;
}
/** Metadata added by a proccessor, which is specified in its configuration. */
export interface Observer {
/** Geolocation data for the agent. */
geo?: Geo | null;
}
/** Geolocation data added via processors to enrich events. */
export interface Geo {
/** Name of the city in which the agent is running. */
city_name?: string | null;
/** The name of the continent on which the agent is running. */
continent_name?: string | null;
/** ISO designation for the agent's country. */
country_iso_code?: string | null;
/** The name of the agent's country. */
country_name?: string | null;
/** The lat/long of the agent. */
location?: string | null;
/** A name for the host's location, e.g. 'us-east-1' or 'LAX'. */
name?: string | null;
/** ISO designation of the agent's region. */
region_iso_code?: string | null;
/** Name of the region hosting the agent. */
region_name?: string | null;
}

export interface Resolve {
host?: string | null;

ip?: string | null;

rtt?: Duration | null;
}

export interface Socks5 {
rtt?: Rtt | null;
}

export interface Rtt {
connect?: Duration | null;

Expand Down Expand Up @@ -331,53 +52,10 @@ export interface Location {
lon?: number | null;
}

export interface Tcp {
port?: number | null;

rtt?: Rtt | null;
}
/** Contains monitor transmission encryption information. */
export interface PingTls {
/** The date and time after which the certificate is invalid. */
certificate_not_valid_after?: string | null;

certificate_not_valid_before?: string | null;

certificates?: string | null;

rtt?: Rtt | null;
}

export interface Url {
full?: string | null;

scheme?: string | null;

domain?: string | null;

port?: number | null;

path?: string | null;

query?: string | null;
}

export interface DocCount {
count: UnsignedInteger;
}

export interface Snapshot {
counts: SnapshotCount;
}

export interface SnapshotCount {
up: number;

down: number;

total: number;
}

/** The primary object returned for monitor states. */
export interface MonitorSummaryResult {
/** Used to go to the next page of results */
Expand Down Expand Up @@ -521,24 +199,6 @@ export interface SummaryHistogramPoint {
down: number;
}

export interface AllPingsQueryArgs {
/** Optional: the direction to sort by. Accepts 'asc' and 'desc'. Defaults to 'desc'. */
sort?: string | null;
/** Optional: the number of results to return. */
size?: number | null;
/** Optional: the monitor ID filter. */
monitorId?: string | null;
/** Optional: the check status to filter by. */
status?: string | null;
/** The lower limit of the date range. */
dateRangeStart: string;
/** The upper limit of the date range. */
dateRangeEnd: string;
/** Optional: agent location to filter by. */
location?: string | null;
page?: number;
}

export interface GetMonitorStatesQueryArgs {
dateRangeStart: string;

Expand Down
6 changes: 6 additions & 0 deletions x-pack/legacy/plugins/uptime/common/runtime_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export const StatesIndexStatusType = t.type({
docCount: t.number,
});

export const DateRangeType = t.type({
from: t.string,
to: t.string,
});

export type Summary = t.TypeOf<typeof SummaryType>;
export type CheckGeo = t.TypeOf<typeof CheckGeoType>;
export type Location = t.TypeOf<typeof LocationType>;
export type StatesIndexStatus = t.TypeOf<typeof StatesIndexStatusType>;
export type DateRange = t.TypeOf<typeof DateRangeType>;
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/uptime/common/runtime_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export * from './alerts';
export * from './common';
export * from './monitor';
export * from './overview_filters';
export * from './ping';
export * from './snapshot';
export * from './dynamic_settings';
Loading