Skip to content

Commit 1f89b19

Browse files
committed
update API schema
1 parent 8aa3253 commit 1f89b19

File tree

5 files changed

+173
-105
lines changed

5 files changed

+173
-105
lines changed

modules/api/schema/swagger.json

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"produces": [
8484
"application/json"
8585
],
86-
"summary": "creates a non-namespaced resource",
86+
"summary": "creates or updates a non-namespaced resource",
8787
"operationId": "handlePutResource",
8888
"parameters": [
8989
{
@@ -304,7 +304,7 @@
304304
"produces": [
305305
"application/json"
306306
],
307-
"summary": "creates a resource in a namespace",
307+
"summary": "creates or updates a resource in a namespace",
308308
"operationId": "handlePutResource",
309309
"parameters": [
310310
{
@@ -9600,8 +9600,8 @@
96009600
},
96019601
"clusterrolebinding.ClusterRoleBindingDetail": {
96029602
"required": [
9603-
"objectMeta",
96049603
"typeMeta",
9604+
"objectMeta",
96059605
"roleRef",
96069606
"errors"
96079607
],
@@ -10034,13 +10034,13 @@
1003410034
},
1003510035
"cronjob.CronJobDetail": {
1003610036
"required": [
10037+
"active",
10038+
"lastSchedule",
1003710039
"containerImages",
1003810040
"objectMeta",
1003910041
"typeMeta",
1004010042
"schedule",
1004110043
"suspend",
10042-
"active",
10043-
"lastSchedule",
1004410044
"concurrencyPolicy",
1004510045
"startingDeadlineSeconds",
1004610046
"errors"
@@ -10089,18 +10089,11 @@
1008910089
"cronjob.CronJobList": {
1009010090
"required": [
1009110091
"listMeta",
10092-
"cumulativeMetrics",
1009310092
"items",
1009410093
"status",
1009510094
"errors"
1009610095
],
1009710096
"properties": {
10098-
"cumulativeMetrics": {
10099-
"type": "array",
10100-
"items": {
10101-
"$ref": "#/definitions/api.Metric"
10102-
}
10103-
},
1010410097
"errors": {
1010510098
"type": "array",
1010610099
"items": {
@@ -10165,11 +10158,11 @@
1016510158
},
1016610159
"daemonset.DaemonSetDetail": {
1016710160
"required": [
10168-
"objectMeta",
10169-
"typeMeta",
1017010161
"podInfo",
1017110162
"containerImages",
1017210163
"initContainerImages",
10164+
"objectMeta",
10165+
"typeMeta",
1017310166
"errors"
1017410167
],
1017510168
"properties": {
@@ -10709,13 +10702,13 @@
1070910702
},
1071010703
"horizontalpodautoscaler.HorizontalPodAutoscalerDetail": {
1071110704
"required": [
10712-
"typeMeta",
10713-
"scaleTargetRef",
1071410705
"minReplicas",
1071510706
"maxReplicas",
1071610707
"currentCPUUtilizationPercentage",
1071710708
"targetCPUUtilizationPercentage",
1071810709
"objectMeta",
10710+
"typeMeta",
10711+
"scaleTargetRef",
1071910712
"currentReplicas",
1072010713
"desiredReplicas",
1072110714
"lastScaleTime"
@@ -10842,10 +10835,10 @@
1084210835
},
1084310836
"ingress.IngressDetail": {
1084410837
"required": [
10845-
"hosts",
1084610838
"objectMeta",
1084710839
"typeMeta",
1084810840
"endpoints",
10841+
"hosts",
1084910842
"spec",
1085010843
"status",
1085110844
"errors"
@@ -11248,9 +11241,9 @@
1124811241
},
1124911242
"namespace.NamespaceDetail": {
1125011243
"required": [
11251-
"phase",
1125211244
"objectMeta",
1125311245
"typeMeta",
11246+
"phase",
1125411247
"resourceQuotaList",
1125511248
"resourceLimits",
1125611249
"errors"
@@ -11332,8 +11325,8 @@
1133211325
},
1133311326
"networkpolicy.NetworkPolicyDetail": {
1133411327
"required": [
11335-
"typeMeta",
1133611328
"objectMeta",
11329+
"typeMeta",
1133711330
"podSelector",
1133811331
"errors"
1133911332
],
@@ -11668,16 +11661,16 @@
1166811661
},
1166911662
"persistentvolume.PersistentVolumeDetail": {
1167011663
"required": [
11664+
"objectMeta",
11665+
"reclaimPolicy",
1167111666
"storageClass",
11667+
"status",
1167211668
"claim",
1167311669
"reason",
11674-
"accessModes",
11675-
"reclaimPolicy",
11670+
"typeMeta",
1167611671
"capacity",
11672+
"accessModes",
1167711673
"mountOptions",
11678-
"status",
11679-
"objectMeta",
11680-
"typeMeta",
1168111674
"message",
1168211675
"persistentVolumeSource"
1168311676
],
@@ -11795,13 +11788,13 @@
1179511788
},
1179611789
"persistentvolumeclaim.PersistentVolumeClaimDetail": {
1179711790
"required": [
11791+
"capacity",
11792+
"accessModes",
1179811793
"storageClass",
1179911794
"objectMeta",
1180011795
"typeMeta",
1180111796
"status",
11802-
"volume",
11803-
"capacity",
11804-
"accessModes"
11797+
"volume"
1180511798
],
1180611799
"properties": {
1180711800
"accessModes": {
@@ -12344,11 +12337,11 @@
1234412337
},
1234512338
"replicationcontroller.ReplicationControllerDetail": {
1234612339
"required": [
12340+
"initContainerImages",
12341+
"objectMeta",
1234712342
"typeMeta",
1234812343
"podInfo",
1234912344
"containerImages",
12350-
"initContainerImages",
12351-
"objectMeta",
1235212345
"labelSelector",
1235312346
"errors"
1235412347
],
@@ -12551,8 +12544,8 @@
1255112544
},
1255212545
"role.RoleDetail": {
1255312546
"required": [
12554-
"objectMeta",
1255512547
"typeMeta",
12548+
"objectMeta",
1255612549
"rules",
1255712550
"errors"
1255812551
],
@@ -12813,13 +12806,13 @@
1281312806
},
1281412807
"service.ServiceDetail": {
1281512808
"required": [
12809+
"internalEndpoint",
1281612810
"externalEndpoints",
1281712811
"selector",
1281812812
"type",
1281912813
"clusterIP",
1282012814
"objectMeta",
1282112815
"typeMeta",
12822-
"internalEndpoint",
1282312816
"endpointList",
1282412817
"sessionAffinity",
1282512818
"errors"
@@ -12983,11 +12976,11 @@
1298312976
},
1298412977
"statefulset.StatefulSetDetail": {
1298512978
"required": [
12979+
"objectMeta",
1298612980
"typeMeta",
1298712981
"podInfo",
1298812982
"containerImages",
1298912983
"initContainerImages",
12990-
"objectMeta",
1299112984
"errors"
1299212985
],
1299312986
"properties": {
@@ -13139,12 +13132,12 @@
1313913132
},
1314013133
"types.CustomResourceDefinitionDetail": {
1314113134
"required": [
13142-
"established",
1314313135
"objectMeta",
1314413136
"typeMeta",
1314513137
"group",
1314613138
"scope",
1314713139
"names",
13140+
"established",
1314813141
"conditions",
1314913142
"objects",
1315013143
"subresources",
@@ -13291,8 +13284,8 @@
1329113284
},
1329213285
"types.CustomResourceObjectDetail": {
1329313286
"required": [
13294-
"typeMeta",
1329513287
"objectMeta",
13288+
"typeMeta",
1329613289
"errors"
1329713290
],
1329813291
"properties": {

modules/web/.meshrc.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,70 @@ sources:
1717
handler:
1818
openapi:
1919
source: ../api/schema/swagger.json
20+
transforms:
21+
- replaceField:
22+
typeDefs: |
23+
type Map {
24+
map: ObjMap!
25+
}
26+
replacements:
27+
- from:
28+
type: persistentvolume_PersistentVolume
29+
field: capacity
30+
to:
31+
type: Map
32+
field: map
33+
- from:
34+
type: persistentvolume_PersistentVolumeDetail
35+
field: capacity
36+
to:
37+
type: Map
38+
field: map
39+
- from:
40+
type: persistentvolumeclaim_PersistentVolumeClaim
41+
field: capacity
42+
to:
43+
type: Map
44+
field: map
45+
- from:
46+
type: persistentvolumeclaim_PersistentVolumeClaimDetail
47+
field: capacity
48+
to:
49+
type: Map
50+
field: map
51+
- from:
52+
type: v1_ResourceRequirements
53+
field: limits
54+
to:
55+
type: Map
56+
field: map
57+
- from:
58+
type: v1_ResourceRequirements
59+
field: requests
60+
to:
61+
type: Map
62+
field: map
63+
- from:
64+
type: v1_VolumeResourceRequirements
65+
field: limits
66+
to:
67+
type: Map
68+
field: map
69+
- from:
70+
type: v1_VolumeResourceRequirements
71+
field: requests
72+
to:
73+
type: Map
74+
field: map
75+
- from:
76+
type: resourcequota_ResourceQuotaDetail
77+
field: statusList
78+
to:
79+
type: Map
80+
field: map
81+
- from:
82+
type: v1_ContainerStatus
83+
field: allocatedResources
84+
to:
85+
type: Map
86+
field: map

modules/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"@graphql-mesh/cli": "0.89.9",
9797
"@graphql-mesh/openapi": "0.99.6",
9898
"@graphql-mesh/runtime": "0.98.8",
99+
"@graphql-mesh/transform-replace-field": "0.97.5",
99100
"@types/d3": "7.4.3",
100101
"@types/d3-scale": "4.0.8",
101102
"@types/file-saver": "2.0.7",

0 commit comments

Comments
 (0)