feat(joyent-cp-gql-schema): add nested queries to more fields
- also, fix identation - remove redundant query type
This commit is contained in:
parent
6ab74d4216
commit
ebec51b965
@ -6,7 +6,7 @@
|
|||||||
id: ID!
|
id: ID!
|
||||||
user: User!
|
user: User!
|
||||||
datacenter: Datacenter!
|
datacenter: Datacenter!
|
||||||
deploymentGroups: [DeploymentGroup]
|
deploymentGroups(name: String, slug: String): [DeploymentGroup]
|
||||||
}
|
}
|
||||||
|
|
||||||
type User {
|
type User {
|
||||||
@ -21,7 +21,7 @@
|
|||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
slug: String
|
slug: String
|
||||||
services(slug: String): [Service]
|
services(name: String, slug: String, parentId: ID): [Service]
|
||||||
version: Version
|
version: Version
|
||||||
history: [Version]
|
history: [Version]
|
||||||
}
|
}
|
||||||
@ -40,23 +40,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ConvergenceAction {
|
type ConvergenceAction {
|
||||||
id: String!
|
id: ID!
|
||||||
type: ConvergenceActionType!
|
type: ConvergenceActionType!
|
||||||
service: String! # service name
|
service: String! # service name
|
||||||
machines: [String]! # instance machine ids
|
machines: [String]! # instance machine ids
|
||||||
}
|
}
|
||||||
|
|
||||||
type StateConvergencePlan {
|
type StateConvergencePlan {
|
||||||
id: String!
|
id: ID!
|
||||||
running: Boolean!
|
running: Boolean!
|
||||||
actions: [ConvergenceAction]!
|
actions(type: ConvergenceActionType, service: String): [ConvergenceAction]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Version {
|
type Version {
|
||||||
created: Date! # Either Int or define scalar
|
created: Date! # Either Int or define scalar
|
||||||
manifest: Manifest!
|
manifest: Manifest!
|
||||||
scale: [ServiceScale]!
|
scale(serviceName: String): [ServiceScale]!
|
||||||
plan: StateConvergencePlan
|
plan(running: Boolean): StateConvergencePlan
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ManifestType {
|
enum ManifestType {
|
||||||
@ -70,7 +70,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Manifest {
|
type Manifest {
|
||||||
id: String!
|
id: ID!
|
||||||
created: Date!
|
created: Date!
|
||||||
type: ManifestType!
|
type: ManifestType!
|
||||||
format: ManifestFormat!
|
format: ManifestFormat!
|
||||||
@ -80,11 +80,11 @@
|
|||||||
|
|
||||||
# immutable
|
# immutable
|
||||||
type Service {
|
type Service {
|
||||||
id: String! # unique id for db row
|
id: ID! # unique id for db row
|
||||||
hash: String! # unique id for version of service
|
hash: String! # unique id for version of service
|
||||||
name: String! # human readable name
|
name: String! # human readable name
|
||||||
slug: String!
|
slug: String!
|
||||||
instances: [Instance]!
|
instances(name: String, machineId: ID, status: InstanceStatus): [Instance]!
|
||||||
# metrics: [MetricType]!
|
# metrics: [MetricType]!
|
||||||
currentMetrics: [CurrentMetric]!
|
currentMetrics: [CurrentMetric]!
|
||||||
connections: [String!] # list of serviceIds
|
connections: [String!] # list of serviceIds
|
||||||
@ -123,15 +123,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Instance {
|
type Instance {
|
||||||
id: String!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
machineId: String!
|
machineId: ID!
|
||||||
status: InstanceStatus!
|
status: InstanceStatus!
|
||||||
# metrics: [InstanceMetric]!
|
# metrics: [InstanceMetric]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Datacenter {
|
type Datacenter {
|
||||||
id: String!
|
id: ID!
|
||||||
url: String!
|
url: String!
|
||||||
name: String!
|
name: String!
|
||||||
region: String!
|
region: String!
|
||||||
@ -149,9 +149,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MetricType {
|
type MetricType {
|
||||||
id: String!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
id: String!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetricData {
|
type MetricData {
|
||||||
@ -159,23 +159,6 @@
|
|||||||
value: Float!
|
value: Float!
|
||||||
}
|
}
|
||||||
|
|
||||||
# Need to review queries
|
|
||||||
type Query {
|
|
||||||
portal: Portal
|
|
||||||
deploymentGroups: [DeploymentGroup]
|
|
||||||
deploymentGroup(id: String, slug: String): DeploymentGroup
|
|
||||||
services(deploymentGroupId: String, deploymentGroupSlug: String): [Service]
|
|
||||||
service(id: String, slug: String): Service
|
|
||||||
instances(serviceId: String, serviceSlug: String): [Instance]
|
|
||||||
instance(id: String, machineId: String): Instance
|
|
||||||
metricTypes: [MetricType]
|
|
||||||
metricData(instanceId: String!, metricType: String!, from: Date!, to: Date!): [InstanceMetric]!
|
|
||||||
package: Package
|
|
||||||
datacenters: [Datacenter]
|
|
||||||
# tmp test
|
|
||||||
instanceMetric: InstanceMetric!
|
|
||||||
}
|
|
||||||
|
|
||||||
# we probably wont use some of these queries or arguments
|
# we probably wont use some of these queries or arguments
|
||||||
# but this way we expose the entire db through gql
|
# but this way we expose the entire db through gql
|
||||||
type Query {
|
type Query {
|
||||||
|
Loading…
Reference in New Issue
Block a user