2017-06-07 17:10:25 +03:00
|
|
|
type Portal {
|
|
|
|
id: ID!
|
|
|
|
user: User!
|
|
|
|
datacenter: Datacenter!
|
|
|
|
deploymentGroups(name: String, slug: String): [DeploymentGroup]
|
|
|
|
}
|
|
|
|
|
|
|
|
type User {
|
|
|
|
id: ID!
|
2017-09-13 22:32:32 +03:00
|
|
|
tritonId: ID!
|
2017-06-07 17:10:25 +03:00
|
|
|
firstName: String!
|
|
|
|
lastName: String!
|
|
|
|
email: String!
|
|
|
|
login: String!
|
|
|
|
}
|
|
|
|
|
2017-07-05 16:33:16 +03:00
|
|
|
enum DeploymentGroupStatus {
|
|
|
|
ACTIVE
|
|
|
|
PROVISIONING
|
|
|
|
DELETING
|
|
|
|
DELETED
|
|
|
|
UNKNOWN
|
|
|
|
}
|
|
|
|
|
2017-06-07 17:10:25 +03:00
|
|
|
type DeploymentGroup {
|
|
|
|
id: ID!
|
|
|
|
name: String!
|
2017-06-26 17:29:12 +03:00
|
|
|
slug: String!
|
2017-08-02 15:57:00 +03:00
|
|
|
services(name: String, slug: String): [Service]
|
2017-06-07 17:10:25 +03:00
|
|
|
version: Version
|
|
|
|
history: [Version]
|
2017-06-27 18:10:24 +03:00
|
|
|
imported: Boolean
|
2017-07-05 16:33:16 +03:00
|
|
|
status: DeploymentGroupStatus
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceScale {
|
2017-07-05 16:33:16 +03:00
|
|
|
id: ID!
|
2017-06-07 17:10:25 +03:00
|
|
|
serviceName: String!
|
|
|
|
replicas: Int!
|
|
|
|
}
|
|
|
|
|
|
|
|
enum ConvergenceActionType {
|
|
|
|
NOOP
|
|
|
|
CREATE
|
|
|
|
RECREATE
|
2017-07-05 16:33:16 +03:00
|
|
|
REMOVE
|
2017-06-07 17:10:25 +03:00
|
|
|
START
|
2017-07-05 16:33:16 +03:00
|
|
|
EXISTING # special status to mark existing ids in previous version
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type ConvergenceAction {
|
2017-07-05 16:33:16 +03:00
|
|
|
id: ID!
|
2017-06-07 17:10:25 +03:00
|
|
|
type: ConvergenceActionType!
|
|
|
|
service: String! # service name
|
2017-07-21 17:08:15 +03:00
|
|
|
toProcess: Int # merely used for book keeping
|
|
|
|
processed: [String] # merely used for book keeping
|
2017-07-05 16:33:16 +03:00
|
|
|
machines: [String]! # current instance machine ids
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type Version {
|
2017-07-05 16:33:16 +03:00
|
|
|
id: ID!
|
2017-07-27 19:18:19 +03:00
|
|
|
manifest: Manifest
|
|
|
|
scale(serviceName: String): [ServiceScale]
|
2017-07-05 16:33:16 +03:00
|
|
|
plan: [ConvergenceAction]
|
|
|
|
hasPlan: Boolean
|
|
|
|
error: String
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
enum ManifestType {
|
|
|
|
COMPOSE
|
|
|
|
MARIPOSA
|
|
|
|
}
|
|
|
|
|
|
|
|
enum ManifestFormat {
|
|
|
|
JSON
|
|
|
|
YAML
|
|
|
|
}
|
|
|
|
|
2017-07-15 06:36:24 +03:00
|
|
|
type KeyValue {
|
|
|
|
id: ID!
|
|
|
|
name: String!
|
|
|
|
value: String!
|
|
|
|
}
|
|
|
|
|
|
|
|
input KeyValueInput {
|
|
|
|
id: ID
|
|
|
|
name: String!
|
|
|
|
value: String!
|
|
|
|
}
|
|
|
|
|
2017-06-07 17:10:25 +03:00
|
|
|
type Manifest {
|
|
|
|
id: ID!
|
|
|
|
type: ManifestType!
|
|
|
|
format: ManifestFormat!
|
2017-07-05 16:33:16 +03:00
|
|
|
environment: String!
|
2017-07-15 06:36:24 +03:00
|
|
|
files: [KeyValue]
|
2017-06-07 17:10:25 +03:00
|
|
|
raw: String!
|
|
|
|
}
|
|
|
|
|
2017-07-05 16:33:16 +03:00
|
|
|
enum ServiceStatus {
|
|
|
|
ACTIVE # this doesn't mean that the instances are all running
|
|
|
|
PROVISIONING
|
|
|
|
SCALING
|
|
|
|
STOPPING
|
|
|
|
STOPPED
|
|
|
|
DELETING
|
|
|
|
DELETED
|
|
|
|
RESTARTING
|
|
|
|
UNKNOWN
|
|
|
|
}
|
|
|
|
|
2017-07-05 16:33:16 +03:00
|
|
|
type ServiceConfig {
|
|
|
|
id: ID!
|
|
|
|
package: Package # we don't have this in current mock data
|
|
|
|
environment: [KeyValue]
|
|
|
|
image: String # used only for config
|
|
|
|
labels: [KeyValue]
|
|
|
|
ports: [String]
|
|
|
|
}
|
|
|
|
|
2017-06-07 17:10:25 +03:00
|
|
|
# immutable
|
|
|
|
type Service {
|
|
|
|
id: ID! # unique id for db row
|
2017-07-13 18:22:43 +03:00
|
|
|
hash: String # unique id for version of service
|
2017-06-07 17:10:25 +03:00
|
|
|
name: String! # human readable name
|
2017-07-21 17:08:15 +03:00
|
|
|
slug: String!
|
2017-06-07 17:10:25 +03:00
|
|
|
instances(name: String, machineId: ID, status: InstanceStatus): [Instance]!
|
2017-07-05 16:33:16 +03:00
|
|
|
connections: [String] # list of serviceIds
|
2017-08-02 15:57:00 +03:00
|
|
|
branches(name: String, slug: String): [Service]
|
2017-07-05 16:33:16 +03:00
|
|
|
config: ServiceConfig
|
2017-07-05 16:33:16 +03:00
|
|
|
status: ServiceStatus
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# for metrics max / min (I guess)
|
|
|
|
type Package {
|
|
|
|
id: ID!
|
|
|
|
name: String!
|
|
|
|
type: String!
|
|
|
|
memory: Float!
|
|
|
|
disk: Float!
|
|
|
|
swap: Float!
|
|
|
|
lwps: Int!
|
|
|
|
vcpus: Int!
|
|
|
|
version: String!
|
|
|
|
group: String!
|
|
|
|
}
|
|
|
|
|
|
|
|
enum InstanceStatus {
|
2017-06-27 18:09:57 +03:00
|
|
|
PROVISIONING
|
2017-06-27 20:13:51 +03:00
|
|
|
READY
|
2017-06-27 20:44:14 +03:00
|
|
|
ACTIVE # vm only: When used in ListVms, denotes machines that are not 'destroyed' or 'failed'
|
2017-06-07 17:10:25 +03:00
|
|
|
RUNNING
|
2017-06-27 20:13:51 +03:00
|
|
|
STOPPING
|
2017-06-27 20:44:14 +03:00
|
|
|
STOPPED
|
|
|
|
OFFLINE
|
|
|
|
DELETED
|
|
|
|
DESTROYED # vm only
|
2017-06-26 13:29:24 +03:00
|
|
|
FAILED
|
2017-06-27 20:44:14 +03:00
|
|
|
INCOMPLETE # vm only
|
|
|
|
UNKNOWN
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
2017-07-11 19:59:25 +03:00
|
|
|
enum HealthyStatus {
|
|
|
|
HEALTHY
|
|
|
|
UNHEALTHY
|
|
|
|
MAINTENANCE
|
|
|
|
UNKNOWN
|
|
|
|
UNAVAILABLE
|
|
|
|
}
|
|
|
|
|
2017-08-22 18:17:33 +03:00
|
|
|
type Metric {
|
|
|
|
time: String!
|
|
|
|
value: Float!
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MetricName {
|
|
|
|
AVG_MEM_BYTES
|
|
|
|
AVG_LOAD_PERCENT
|
|
|
|
AGG_NETWORK_BYTES
|
|
|
|
}
|
|
|
|
|
|
|
|
type InstanceMetric {
|
|
|
|
instance: String!
|
|
|
|
name: MetricName!
|
2017-08-22 18:24:49 +03:00
|
|
|
start: String!
|
|
|
|
end: String!
|
2017-08-22 18:17:33 +03:00
|
|
|
metrics: [Metric]
|
|
|
|
}
|
|
|
|
|
2017-06-07 17:10:25 +03:00
|
|
|
type Instance {
|
|
|
|
id: ID!
|
|
|
|
name: String!
|
|
|
|
machineId: ID!
|
2017-09-01 02:17:04 +03:00
|
|
|
primaryIp: String
|
2017-07-21 17:08:15 +03:00
|
|
|
status: InstanceStatus
|
2017-07-11 19:59:25 +03:00
|
|
|
healthy: HealthyStatus
|
2017-07-19 18:55:39 +03:00
|
|
|
watches: [String]
|
2017-07-11 19:59:25 +03:00
|
|
|
jobs: [String]
|
2017-08-22 18:17:33 +03:00
|
|
|
metrics(names: [MetricName]!, start: String!, end: String!): [InstanceMetric]!
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type Datacenter {
|
|
|
|
id: ID!
|
|
|
|
name: String!
|
|
|
|
region: String!
|
|
|
|
}
|
|
|
|
|
|
|
|
# we probably wont use some of these queries or arguments
|
|
|
|
# but this way we expose the entire db through gql
|
|
|
|
type Query {
|
|
|
|
portal: Portal
|
|
|
|
user: User
|
|
|
|
deploymentGroups(name: String, slug: String): [DeploymentGroup]
|
|
|
|
deploymentGroup(id: ID, name: String, slug: String): DeploymentGroup
|
|
|
|
serviceScales(serviceName: String, versionId: ID): [ServiceScale]
|
|
|
|
serviceScale(id: ID!): ServiceScale
|
2017-07-21 17:08:15 +03:00
|
|
|
convergenceActions(
|
|
|
|
type: ConvergenceActionType
|
|
|
|
service: String
|
|
|
|
versionId: ID
|
|
|
|
): [ConvergenceAction]
|
2017-06-07 17:10:25 +03:00
|
|
|
convergenceAction(id: ID!): ConvergenceAction
|
|
|
|
versions(manifestId: ID, deploymentGroupId: ID): [Version]
|
|
|
|
version(id: ID, manifestId: ID): Version
|
|
|
|
manifests(type: String, deploymentGroupId: ID): [Manifest]
|
|
|
|
manifest(id: ID!): Manifest
|
2017-07-21 17:08:15 +03:00
|
|
|
services(
|
|
|
|
name: String
|
|
|
|
slug: String
|
|
|
|
parentId: ID
|
|
|
|
deploymentGroupId: ID
|
|
|
|
deploymentGroupSlug: String
|
|
|
|
): [Service]
|
2017-06-07 17:10:25 +03:00
|
|
|
service(id: ID, hash: ID): Service
|
2017-07-21 17:08:15 +03:00
|
|
|
packages(
|
|
|
|
name: String
|
|
|
|
type: String
|
|
|
|
memory: Int
|
|
|
|
disk: Int
|
|
|
|
swap: Int
|
|
|
|
lwps: Int
|
|
|
|
vcpus: Int
|
|
|
|
version: String
|
|
|
|
group: String
|
|
|
|
): [Package]
|
2017-06-07 17:10:25 +03:00
|
|
|
package(id: ID!): Package
|
2017-07-21 17:08:15 +03:00
|
|
|
instances(
|
|
|
|
name: String
|
|
|
|
machineId: ID
|
|
|
|
status: InstanceStatus
|
|
|
|
serviceId: ID
|
|
|
|
serviceSlug: String
|
|
|
|
deploymentGroupId: ID
|
|
|
|
deploymentGroupSlug: String
|
|
|
|
): [Instance]
|
2017-06-07 17:10:25 +03:00
|
|
|
instance(id: ID!): Instance
|
|
|
|
datacenter(id: ID, region: String): Datacenter
|
|
|
|
datacenters: [Datacenter]
|
2017-07-21 17:08:15 +03:00
|
|
|
config(
|
|
|
|
deploymentGroupName: String!
|
|
|
|
type: ManifestType!
|
|
|
|
format: ManifestFormat!
|
|
|
|
environment: String!
|
|
|
|
files: [KeyValueInput]!
|
|
|
|
raw: String!
|
|
|
|
): [Service]
|
2017-06-26 17:29:12 +03:00
|
|
|
importableDeploymentGroups: [DeploymentGroup]
|
2017-08-17 00:14:36 +03:00
|
|
|
# start and end should be .toISOString() date strings
|
2017-08-28 22:21:08 +03:00
|
|
|
metrics(
|
|
|
|
deploymentGroupId: ID!
|
|
|
|
names: [MetricName]!
|
|
|
|
instances: [ID]!
|
|
|
|
start: String!
|
|
|
|
end: String!
|
|
|
|
): [InstanceMetric]
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type Mutation {
|
2017-06-23 01:00:02 +03:00
|
|
|
createDeploymentGroup(name: String!): DeploymentGroup
|
|
|
|
updateDeploymentGroup(id: ID!, name: String!): DeploymentGroup
|
2017-07-17 17:27:34 +03:00
|
|
|
deleteDeploymentGroup(id: ID!): DeploymentGroup
|
2017-07-21 17:08:15 +03:00
|
|
|
provisionManifest(
|
|
|
|
deploymentGroupId: ID!
|
|
|
|
type: ManifestType!
|
|
|
|
format: ManifestFormat!
|
|
|
|
environment: String!
|
|
|
|
files: [KeyValueInput]!
|
|
|
|
raw: String!
|
|
|
|
): Version
|
2017-06-23 01:00:02 +03:00
|
|
|
scale(serviceId: ID!, replicas: Int!): Version
|
|
|
|
stopServices(ids: [ID]!): [Service]
|
|
|
|
startServices(ids: [ID]!): [Service]
|
|
|
|
restartServices(ids: [ID]!): [Service]
|
|
|
|
deleteServices(ids: [ID]!): [Service]
|
|
|
|
stopInstances(ids: [ID]!): [Instance]
|
|
|
|
startInstances(ids: [ID]!): [Instance]
|
|
|
|
restartInstances(ids: [ID]!): [Instance]
|
2017-06-26 17:29:12 +03:00
|
|
|
importDeploymentGroup(deploymentGroupSlug: String!): DeploymentGroup
|
2017-07-19 19:20:22 +03:00
|
|
|
deleteDeploymentGroup(id: ID!): DeploymentGroup
|
2017-06-07 17:10:25 +03:00
|
|
|
}
|