Skip to content

Instantly share code, notes, and snippets.

@justinkambic
Created June 11, 2019 13:33
Show Gist options
  • Save justinkambic/d0956654c8a0d228200aaffef3317596 to your computer and use it in GitHub Desktop.
Save justinkambic/d0956654c8a0d228200aaffef3317596 to your computer and use it in GitHub Desktop.
A WIP GQL schema for heartbeat-states index
/*
* 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 gql from 'graphql-tag';
export const monitorStatesSchema = gql`
type Agent {
id: String!
}
type Check {
agent: Agent
monitor: CheckMonitor
observer: Observer
timestamp: String!
}
type CheckMonitor {
ip: String
status: String!
}
type Geo {
name: [String]!
location: String
}
type Observer {
geo: Geo
}
type MonitorState {
status: String!
name: String
id: String!
type: String
}
type Summary {
up: Int!
down: Int!
geo: Geo!
}
type State {
agent: Agent!
down: Int!
geo: Geo!
observer: Observer
monitor: MonitorState!
summary: Summary!
timestamp: String!
up: Int!
}
type MonitorSummaryUrl {
domain: String
fragment: string
full: String
original: String
password: String
path: String
port: Int
query: String
scheme: String
username: String
}
type MonitorSummary {
monitor_id: String!
state: State
}
extend type Query {
getMonitorStates(): MonitorState
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment