forked from kyma-project/kyma
/
schema.graphql
711 lines (584 loc) · 17.5 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
# Scalars
scalar JSON
scalar Labels
scalar Timestamp
# Directives
directive @HasAccess(attributes: ResourceAttributes!) on FIELD_DEFINITION
input ResourceAttributes {
verb: String!
apiGroup: String!
apiVersion: String!
resource: String!
subresource: String! = ""
nameArg: String
namespaceArg: String
isChildResolver: Boolean! = false
}
# Content
type Title {
name: String!
anchor: String!
titles: [Title!]
}
type Section {
name: String!
anchor: String!
titles: [Title!]!
topicType: String!
}
type TopicEntry {
contentType: String!
id: String!
sections: [Section!]!
}
# Service Catalog
type ServiceInstance {
name: String!
namespace: String!
planSpec: JSON
creationTimestamp: Timestamp!
labels: [String!]!
status: ServiceInstanceStatus!
classReference: ServiceInstanceResourceRef
planReference: ServiceInstanceResourceRef
serviceClass: ServiceClass
clusterServiceClass: ClusterServiceClass
servicePlan: ServicePlan
clusterServicePlan: ClusterServicePlan
bindable: Boolean!
serviceBindings: ServiceBindings @HasAccess(attributes: {resource: "servicebindings", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "Namespace", isChildResolver: true})
# Depends on servicecatalogaddons domain
serviceBindingUsages: [ServiceBindingUsage!]
}
type ServiceInstanceResourceRef {
name: String!
displayName: String!
clusterWide: Boolean!
}
type ServiceInstanceStatus {
type: InstanceStatusType!
reason: String!
message: String!
}
enum InstanceStatusType {
RUNNING
PROVISIONING
DEPROVISIONING
PENDING
FAILED
}
type ServiceInstanceEvent {
type: SubscriptionEventType!
serviceInstance: ServiceInstance!
}
type ServiceBrokerEvent {
type: SubscriptionEventType!
serviceBroker: ServiceBroker!
}
type ClusterServiceBrokerEvent {
type: SubscriptionEventType!
clusterServiceBroker: ClusterServiceBroker!
}
enum SubscriptionEventType {
ADD
UPDATE
DELETE
}
input ServiceInstanceCreateInput {
name: String!
namespace: String!
classRef: ServiceInstanceCreateInputResourceRef!
planRef: ServiceInstanceCreateInputResourceRef!
labels: [String!]!
parameterSchema: JSON
}
input ServiceInstanceCreateInputResourceRef {
externalName: String!
clusterWide: Boolean!
}
type ServiceClass {
name: String!
namespace: String!
externalName: String!
displayName: String
creationTimestamp: Timestamp!
description: String!
longDescription: String
imageUrl: String
documentationUrl: String
supportUrl: String
providerDisplayName: String
tags: [String!]!
labels: Labels!
plans: [ServicePlan!]!
activated: Boolean! @HasAccess(attributes: {resource: "serviceinstances", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "Namespace", isChildResolver: true})
instances: [ServiceInstance!]! @HasAccess(attributes: {resource: "serviceinstances", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "Namespace", isChildResolver: true})
apiSpec: JSON
asyncApiSpec: JSON
content: JSON
}
type ClusterServiceClass {
name: String!
externalName: String!
displayName: String
creationTimestamp: Timestamp!
description: String!
longDescription: String
imageUrl: String
documentationUrl: String
supportUrl: String
providerDisplayName: String
tags: [String!]!
labels: Labels!
plans: [ClusterServicePlan!]!
activated(namespace: String): Boolean! @HasAccess(attributes: {resource: "serviceinstances", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", isChildResolver: true})
instances(namespace: String): [ServiceInstance!]! @HasAccess(attributes: {resource: "serviceinstances", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", isChildResolver: true})
apiSpec: JSON
asyncApiSpec: JSON
content: JSON
}
type ServicePlan {
name: String!
namespace: String!
displayName: String
externalName: String!
description: String!
relatedServiceClassName: String!
instanceCreateParameterSchema: JSON
bindingCreateParameterSchema: JSON
}
type ClusterServicePlan {
name: String!
displayName: String
externalName: String!
description: String!
relatedClusterServiceClassName: String!
instanceCreateParameterSchema: JSON
bindingCreateParameterSchema: JSON
}
type ServiceBroker {
name: String!
namespace: String!
status: ServiceBrokerStatus!
creationTimestamp: Timestamp!
url: String!
labels: Labels!
}
type ClusterServiceBroker {
name: String!
status: ServiceBrokerStatus!
creationTimestamp: Timestamp!
url: String!
labels: Labels!
}
type ServiceBrokerStatus {
ready: Boolean!
reason: String!
message: String!
}
type ServiceBindings {
items: [ServiceBinding!]!
stats: ServiceBindingsStats!
}
type ServiceBindingsStats {
ready: Int!
failed: Int!
pending: Int!
unknown: Int!
}
type ServiceBinding {
name: String!
serviceInstanceName: String!
namespace: String!
secret: Secret
status: ServiceBindingStatus!
parameters: JSON
}
type ServiceBindingStatus {
type: ServiceBindingStatusType!
reason: String!
message: String!
}
enum ServiceBindingStatusType {
READY
PENDING
FAILED
UNKNOWN
}
type ServiceBindingEvent {
type: SubscriptionEventType!
serviceBinding: ServiceBinding!
}
# We cannot use ServiceBinding as a result of create action
# because secret at the moment of mutation execution is not available.
type CreateServiceBindingOutput {
name: String!
serviceInstanceName: String!
namespace: String!
}
type Secret {
name: String!
namespace: String!
data: JSON!
}
type DeleteServiceBindingOutput {
name: String!
namespace: String!
}
type DeleteServiceBindingUsageOutput {
name: String!
namespace: String!
}
type ServiceBindingUsage {
name: String!
namespace: String!
serviceBinding: ServiceBinding
usedBy: LocalObjectReference!
parameters: ServiceBindingUsageParameters
status: ServiceBindingUsageStatus!
}
type ServiceBindingUsageEvent {
type: SubscriptionEventType!
serviceBindingUsage: ServiceBindingUsage!
}
type ServiceBindingUsageStatus {
type: ServiceBindingUsageStatusType!
reason: String!
message: String!
}
enum ServiceBindingUsageStatusType {
READY
PENDING
FAILED
UNKNOWN
}
type LocalObjectReference {
kind: String!
name: String!
}
type ServiceBindingUsageParameters {
envPrefix: EnvPrefix
}
type EnvPrefix {
name: String!
}
type LimitRange {
name: String!
limits: [LimitRangeItem!]!
}
type LimitRangeItem {
limitType: LimitType!
max: ResourceType!
default: ResourceType!
defaultRequest: ResourceType!
}
enum LimitType {
Container
Pod
}
type ResourceType {
memory: String
cpu: String
}
input CreateServiceBindingUsageInput {
name: String
namespace: String!
serviceBindingRef: ServiceBindingRefInput!
usedBy: LocalObjectReferenceInput!
parameters: ServiceBindingUsageParametersInput
}
input ServiceBindingRefInput {
name: String!
}
input LocalObjectReferenceInput {
kind: String!
name: String!
}
input ServiceBindingUsageParametersInput {
envPrefix: EnvPrefixInput
}
input EnvPrefixInput {
name: String!
}
type Container {
name: String!
image: String!
}
type DeploymentStatus {
replicas: Int!
updatedReplicas: Int!
readyReplicas: Int!
availableReplicas: Int!
conditions: [DeploymentCondition!]!
}
type DeploymentCondition {
status: String!
type: String!
lastTransitionTimestamp: Timestamp!
lastUpdateTimestamp: Timestamp!
message: String!
reason: String!
}
type Deployment {
name: String!
namespace: String!
creationTimestamp: Timestamp!
status: DeploymentStatus!
labels: Labels!
containers: [Container!]!
# Depends on servicecatalog and servicecatalogaddons modules
boundServiceInstanceNames: [String!]
}
type Pod {
name: String!
nodeName: String!
namespace: String!
restartCount: Int!
creationTimestamp: Timestamp!
labels: Labels!
status: PodStatusType!
containerStates: [ContainerState!]!
json: JSON!
}
type ReplicaSet {
name: String!
pods: String!
namespace: String!
images: [String!]!
creationTimestamp: Timestamp!
labels: Labels!
json: JSON!
}
enum PodStatusType {
PENDING
RUNNING
SUCCEEDED
FAILED
UNKNOWN
}
type PodEvent {
type: SubscriptionEventType!
pod: Pod!
}
type ContainerState {
state: ContainerStateType!
reason: String!
message: String!
}
enum ContainerStateType {
WAITING
RUNNING
TERMINATED
}
type ResourceValues {
memory: String
cpu: String
}
type ResourceQuota {
name: String!
pods: String
limits: ResourceValues!
requests: ResourceValues!
}
type ResourceQuotasStatus {
exceeded: Boolean!
exceededQuotas: [ExceededQuota!]!
}
type ExceededQuota {
quotaName: String!
resourceName: String!
affectedResources: [String!]!
}
# Applications
type Namespace {
name: String!
# Depends on application module
applications: [String!]
}
type Application {
name: String!
description: String!
labels: Labels!
services: [ApplicationService!]!
enabledInNamespaces: [String!]!
status: ApplicationStatus!
}
type ConnectorService {
url: String!
}
type ApplicationMapping {
namespace: String!
application: String!
}
type ApplicationService {
id: String!
displayName: String!
longDescription: String!
providerDisplayName: String!
tags: [String!]!
entries: [ApplicationEntry!]!
}
type ApplicationEntry {
type: String!
gatewayUrl: String
accessLabel: String
}
enum ApplicationStatus {
SERVING
NOT_SERVING
GATEWAY_NOT_CONFIGURED
}
type ApplicationEvent {
type: SubscriptionEventType!
application: Application!
}
type ApplicationMutationOutput {
name: String!
description: String!
labels: Labels!
}
type DeleteApplicationOutput {
name: String!
}
type EventActivationEvent {
eventType: String!
version: String!
description: String!
}
type EventActivation {
name: String!
displayName: String!
sourceId: String!
events: [EventActivationEvent!] # content module
}
type UsageKind {
name: String!
group: String!
kind: String!
version: String!
displayName: String!
}
type UsageKindResource {
name: String!
namespace: String!
}
type BindableResourcesOutputItem {
kind: String!
displayName: String!
resources: [UsageKindResource!]!
}
# IDP PRESETS
type IDPPreset {
name: String!
issuer: String!
jwksUri: String!
}
# Kubeless
type Function {
name: String!
trigger: String!
creationTimestamp: Timestamp!
labels: Labels!
namespace: String!
}
input InputTopic {
id: String!
type: String!
}
# API controller
type Service {
name: String!
port: Int!
}
enum AuthenticationPolicyType {
JWT
}
type AuthenticationPolicy {
type: AuthenticationPolicyType!
issuer: String!
jwksURI: String!
}
type API {
name: String!
hostname: String!
service: Service!
authenticationPolicies: [AuthenticationPolicy!]!
}
# Backend Module
type BackendModule {
name: String!
}
# Queries
type Query {
serviceInstance(name: String!, namespace: String!): ServiceInstance @HasAccess(attributes: {resource: "serviceinstances", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "namespace", nameArg: "name"})
serviceInstances(namespace: String!, first: Int, offset: Int, status: InstanceStatusType): [ServiceInstance!]! @HasAccess(attributes: {resource: "serviceinstances", verb: "list", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "namespace"})
clusterServiceClasses(first: Int, offset: Int): [ClusterServiceClass!]!
clusterServiceClass(name: String!): ClusterServiceClass
serviceClasses(namespace: String!, first: Int, offset: Int): [ServiceClass!]!
serviceClass(namespace: String!, name: String!): ServiceClass
clusterServiceBrokers(first: Int, offset: Int): [ClusterServiceBroker!]!
clusterServiceBroker(name: String!): ClusterServiceBroker
serviceBrokers(namespace: String!, first: Int, offset: Int): [ServiceBroker!]!
serviceBroker(name: String!, namespace: String!): ServiceBroker
serviceBindingUsage(name: String!, namespace: String!): ServiceBindingUsage
serviceBinding(name: String!, namespace: String!): ServiceBinding @HasAccess(attributes: {resource: "servicebindings", verb: "get", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "namespace", nameArg: "name"})
usageKinds(first: Int, offset: Int): [UsageKind!]!
# The query returns all instance of the resources which could be bound (proper UsageKind exists).
bindableResources(namespace: String!): [BindableResourcesOutputItem!]!
apis(namespace: String!, serviceName: String, hostname: String): [API!]!
application(name: String!): Application
applications(namespace: String, first: Int, offset: Int): [Application!]!
connectorService(application: String!): ConnectorService!
# Depends on 'application'
namespaces(application: String): [Namespace!]!
deployments(namespace: String!, excludeFunctions: Boolean): [Deployment!]!
pod(name: String!, namespace: String!): Pod
pods(namespace: String!, first: Int, offset: Int): [Pod!]!
replicaSet(name: String!, namespace: String!): ReplicaSet @HasAccess(attributes: {resource: "replicasets", verb: "get", apiGroup: "apps", apiVersion: "v1", namespaceArg: "namespace"})
replicaSets(namespace: String!, first: Int, offset: Int): [ReplicaSet!]! @HasAccess(attributes: {resource: "replicasets", verb: "list", apiGroup: "apps", apiVersion: "v1", namespaceArg: "namespace"})
resourceQuotas(namespace: String!): [ResourceQuota!]!
resourceQuotasStatus(namespace: String!): ResourceQuotasStatus!
functions(namespace: String!, first: Int, offset: Int): [Function!]!
content(contentType: String!, id: String!): JSON
topics(input: [InputTopic!]!, internal: Boolean): [TopicEntry!]
eventActivations(namespace: String!): [EventActivation!]!
limitRanges(namespace: String!): [LimitRange!]! @HasAccess(attributes: {resource: "limitranges", verb: "list", apiGroup: "", apiVersion: "v1", namespaceArg: "namespace"})
backendModules: [BackendModule!]!
IDPPreset(name: String!): IDPPreset @HasAccess(attributes: {resource: "idppresets", verb: "get", apiGroup: "authentication.kyma-project.io", apiVersion: "v1alpha1"})
IDPPresets(first: Int, offset: Int): [IDPPreset!]! @HasAccess(attributes: {resource: "idppresets", verb: "list", apiGroup: "authentication.kyma-project.io", apiVersion: "v1alpha1"})
}
# Mutations
type Mutation {
createServiceInstance(params: ServiceInstanceCreateInput!): ServiceInstance
deleteServiceInstance(name: String!, namespace: String!): ServiceInstance
createServiceBinding(serviceBindingName: String, serviceInstanceName: String!, namespace: String!, parameters: JSON): CreateServiceBindingOutput
deleteServiceBinding(serviceBindingName: String!, namespace: String!): DeleteServiceBindingOutput
createServiceBindingUsage(createServiceBindingUsageInput: CreateServiceBindingUsageInput): ServiceBindingUsage
deleteServiceBindingUsage(serviceBindingUsageName: String!, namespace: String!): DeleteServiceBindingUsageOutput
createApplication(name: String!, description: String, labels: Labels): ApplicationMutationOutput!
updateApplication(name: String!, description: String, labels: Labels): ApplicationMutationOutput!
deleteApplication(name: String!): DeleteApplicationOutput!
enableApplication(application: String!, namespace: String!): ApplicationMapping
disableApplication(application: String!, namespace: String!): ApplicationMapping
updatePod(name: String!, namespace: String!, pod: JSON!): Pod
deletePod(name: String!, namespace: String!): Pod
updateReplicaSet(name: String!, namespace: String!, replicaSet: JSON!): ReplicaSet @HasAccess(attributes: {resource: "replicasets", verb: "update", apiGroup: "apps", apiVersion: "v1", namespaceArg: "namespace"})
deleteReplicaSet(name: String!, namespace: String!): ReplicaSet @HasAccess(attributes: {resource: "replicasets", verb: "delete", apiGroup: "apps", apiVersion: "v1", namespaceArg: "namespace"})
createIDPPreset(name: String!, issuer: String!, jwksUri: String!): IDPPreset @HasAccess(attributes: {resource: "idppresets", verb: "create", apiGroup: "authentication.kyma-project.io", apiVersion: "v1alpha1"})
deleteIDPPreset(name: String!): IDPPreset @HasAccess(attributes: {resource: "idppresets", verb: "delete", apiGroup: "authentication.kyma-project.io", apiVersion: "v1alpha1", nameArg: "name"})
}
# Subscriptions
type Subscription {
serviceInstanceEvent(namespace: String!): ServiceInstanceEvent!
serviceBindingEvent(namespace: String!): ServiceBindingEvent! @HasAccess(attributes: {resource: "servicebindings", verb: "watch", apiGroup: "servicecatalog.k8s.io", apiVersion: "v1beta1", namespaceArg: "namespace"})
serviceBindingUsageEvent(namespace: String!): ServiceBindingUsageEvent!
serviceBrokerEvent(namespace: String!): ServiceBrokerEvent!
clusterServiceBrokerEvent: ClusterServiceBrokerEvent!,
applicationEvent: ApplicationEvent!,
podEvent(namespace: String!): PodEvent!
}
# Schema
schema {
query: Query
mutation: Mutation
}