1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00

Update graphql schema

This commit is contained in:
JUDIT GRESKOVITS 2017-05-16 18:25:45 +01:00 committed by Sérgio Ramos
parent 7cad8228ee
commit b3463e7dab
4 changed files with 73 additions and 38 deletions

View File

@ -3,16 +3,28 @@ import { ApolloProvider } from 'react-apollo';
import { client, store } from '@state/store'; import { client, store } from '@state/store';
import Router from '@root/router'; import Router from '@root/router';
import { injectGlobal } from 'styled-components';
import Base, { global } from '@ui/components/base';
class App extends Component { class App extends Component {
componentWillMount() {
injectGlobal`
${global}
`;
}
render() { render() {
return ( return (
<ApolloProvider client={client} store={store} > <ApolloProvider client={client} store={store} >
<div> <article>
{Router} {Router}
</div> </article>
</ApolloProvider> </ApolloProvider>
); );
} }
} }
export default App; export default App;

View File

@ -1,5 +0,0 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import App from './app'; import App from './app';
import './index.css';
ReactDOM.render( ReactDOM.render(
<App />, <App />,

View File

@ -4,6 +4,7 @@ import resolvers from './resolvers';
const schema = ` const schema = `
scalar Date scalar Date
scalar Object
type Portal { type Portal {
username: String! username: String!
@ -15,25 +16,52 @@ type Portal {
type DeploymentGroup { type DeploymentGroup {
uuid: String! uuid: String!
name: String! name: String!
pathName: String! slug: String!
datacenter: Datacenter! datacenter: Datacenter!
services: [Service]! services: [Service]!
state: DeploymentState version: Version!
version: Manifest! history: [Version]!
history: [Manifest]!
} }
type DeploymentState { type ServiceScale {
current: String name: String!
replicas: Int!
}
enum ConvergenceActionType {
NOOP
CREATE
RECREATE
START
}
type ConvergenceAction {
uuid: String!
type: ConvergenceActionType!
service: String! # service name
machines: [String]! # instance machine ids
}
type StateConvergencePlan {
uuid: String!
running: Boolean!
actions: [ConvergenceAction]!
}
type Version {
created: Date!
manifest: Manifest!
scale: [ServiceScale]!
plan: StateConvergencePlan
} }
type Manifest { type Manifest {
uuid: String! uuid: String!
created: Date! created: Date!
created: Date!
type: String! type: String!
format: String! format: String!
raw: String! raw: String!
obj: Object!
} }
type CurrentMetric { type CurrentMetric {
@ -44,14 +72,12 @@ type CurrentMetric {
# immutable # immutable
type Service { type Service {
uuid: String! uuid: String! # unique id for db row
hash: String! hash: String! # unique id for version of service
deploymentGoup: String! name: String! # human readable name
version: Manifest! slug: String!
name: String!
pathName: String!
instances: [Instance]! instances: [Instance]!
metrics: [MetricType]! # metrics: [MetricType]!
currentMetrics: [CurrentMetric]! currentMetrics: [CurrentMetric]!
connections: [String!] # list of serviceUuids connections: [String!] # list of serviceUuids
parent: String # parent service uuid parent: String # parent service uuid
@ -64,12 +90,6 @@ type MetricType {
id: String! id: String!
} }
# This is ui / dashboard config data - to be stored separately
type ServiceMetric { # name?
metricType: MetricType!
pinned: Boolean!
}
# for metrics max / min (I guess) # for metrics max / min (I guess)
type Package { type Package {
type: String! type: String!
@ -78,13 +98,21 @@ type Package {
vCPUs: Float! # This should be a number / double, not an int vCPUs: Float! # This should be a number / double, not an int
} }
enum InstanceStatus {
CREATED
RESTARTING
RUNNING
PAUSED
EXITED
DELETED
}
type Instance { type Instance {
uuid: String! uuid: String!
name: String! name: String!
id: String! machineId: String!
deploymentGoup: String! status: InstanceStatus!
service: String! # metrics: [InstanceMetric]!
metrics: [InstanceMetric]!
} }
type InstanceMetric { type InstanceMetric {
@ -99,18 +127,19 @@ type MetricData {
type Datacenter { type Datacenter {
uuid: String! uuid: String!
id: String! slug: String!
location: String! location: String!
} }
# Need to review queries
type Query { type Query {
portal: Portal portal: Portal
deploymentGroups: [DeploymentGroup] deploymentGroups: [DeploymentGroup]
deploymentGroup(uuid: String, pathName: String): DeploymentGroup deploymentGroup(uuid: String, slug: String): DeploymentGroup
services(deploymentGroupUuid: String, deploymentGroupPathName: String): [Service] services(deploymentGroupUuid: String, deploymentGroupSlug: String): [Service]
service(uuid: String, pathName: String): Service service(uuid: String, slug: String): Service
instances(serviceUuid: String, servicePathName: String): [Instance] instances(serviceUuid: String, serviceSlug: String): [Instance]
instance(uuid: String, id: String): Instance instance(uuid: String, machineId: String): Instance
metricTypes: [MetricType] metricTypes: [MetricType]
metricData(instanceUuid: String!, metricType: String!, from: Date!, to: Date!): [InstanceMetric]! metricData(instanceUuid: String!, metricType: String!, from: Date!, to: Date!): [InstanceMetric]!
package: Package package: Package