-
Notifications
You must be signed in to change notification settings - Fork 775
/
allocation.swagger.json
405 lines (405 loc) · 12.9 KB
/
allocation.swagger.json
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
{
"swagger": "2.0",
"info": {
"title": "proto/allocation/allocation.proto",
"version": "version not set"
},
"tags": [
{
"name": "AllocationService"
}
],
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/gameserverallocation": {
"post": {
"operationId": "Allocate",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/allocationAllocationResponse"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/allocationAllocationRequest"
}
}
],
"tags": [
"AllocationService"
]
}
}
},
"definitions": {
"AllocationRequestSchedulingStrategy": {
"type": "string",
"enum": [
"Packed",
"Distributed"
],
"default": "Packed"
},
"AllocationResponseGameServerMetadata": {
"type": "object",
"properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"AllocationResponseGameServerStatusAddress": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"address": {
"type": "string"
}
},
"title": "A single address; identical to corev1.NodeAddress"
},
"AllocationResponseGameServerStatusPort": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"port": {
"type": "integer",
"format": "int32"
}
},
"description": "The gameserver port info that is allocated."
},
"GameServerSelectorGameServerState": {
"type": "string",
"enum": [
"READY",
"ALLOCATED"
],
"default": "READY"
},
"PriorityOrder": {
"type": "string",
"enum": [
"Ascending",
"Descending"
],
"default": "Ascending"
},
"allocationAllocationRequest": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"title": "The k8s namespace that is hosting the targeted fleet of gameservers to be allocated"
},
"multiClusterSetting": {
"$ref": "#/definitions/allocationMultiClusterSetting",
"description": "If specified, multi-cluster policies are applied. Otherwise, allocation will happen locally."
},
"requiredGameServerSelector": {
"$ref": "#/definitions/allocationGameServerSelector",
"description": "Deprecated: Please use gameServerSelectors instead. This field is ignored if the\ngameServerSelectors field is set\nThe required allocation. Defaults to all GameServers."
},
"preferredGameServerSelectors": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/allocationGameServerSelector"
},
"description": "Deprecated: Please use gameServerSelectors instead. This field is ignored if the\ngameServerSelectors field is set\nThe ordered list of preferred allocations out of the `required` set.\nIf the first selector is not matched, the selection attempts the second selector, and so on."
},
"scheduling": {
"$ref": "#/definitions/AllocationRequestSchedulingStrategy",
"description": "Scheduling strategy. Defaults to \"Packed\"."
},
"metaPatch": {
"$ref": "#/definitions/allocationMetaPatch",
"title": "Deprecated: Please use metadata instead. This field is ignored if the\nmetadata field is set"
},
"metadata": {
"$ref": "#/definitions/allocationMetaPatch",
"title": "Metadata is optional custom metadata that is added to the game server at\nallocation. You can use this to tell the server necessary session data"
},
"gameServerSelectors": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/allocationGameServerSelector"
},
"description": "Ordered list of GameServer label selectors.\nIf the first selector is not matched, the selection attempts the second selector, and so on.\nThis is useful for things like smoke testing of new game servers.\nNote: This field can only be set if neither Required or Preferred is set."
},
"priorities": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/allocationPriority"
},
"description": "(Alpha, CountsAndLists feature flag) The first Priority on the array of Priorities is the most\nimportant for sorting. The allocator will use the first priority for sorting GameServers in the\nSelector set, and will only use any following priority for tie-breaking during sort.\nImpacts which GameServer is checked first."
},
"counters": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/allocationCounterAction"
},
"description": "(Alpha, CountsAndLists feature flag) Counters and Lists provide a set of actions to perform\non Counters and Lists during allocation."
},
"lists": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/allocationListAction"
}
}
}
},
"allocationAllocationResponse": {
"type": "object",
"properties": {
"gameServerName": {
"type": "string"
},
"ports": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/AllocationResponseGameServerStatusPort"
}
},
"address": {
"type": "string",
"title": "Primary address at which game server can be reached"
},
"addresses": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/AllocationResponseGameServerStatusAddress"
},
"title": "All addresses at which game server can be reached; copy of Node.Status.addresses"
},
"nodeName": {
"type": "string"
},
"source": {
"type": "string"
},
"metadata": {
"$ref": "#/definitions/AllocationResponseGameServerMetadata"
}
}
},
"allocationCounterAction": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"amount": {
"type": "string",
"format": "int64"
},
"capacity": {
"type": "string",
"format": "int64"
}
},
"description": "CounterAction is an optional action that can be performed on a Counter at allocation.\nAction: \"Increment\" or \"Decrement\" the Counter's Count (optional). Must also define the Amount.\nAmount: The amount to increment or decrement the Count (optional). Must be a positive integer.\nCapacity: Update the maximum capacity of the Counter to this number (optional). Min 0, Max int64."
},
"allocationCounterSelector": {
"type": "object",
"properties": {
"minCount": {
"type": "string",
"format": "int64"
},
"maxCount": {
"type": "string",
"format": "int64"
},
"minAvailable": {
"type": "string",
"format": "int64"
},
"maxAvailable": {
"type": "string",
"format": "int64"
}
},
"title": "CounterSelector is the filter options for a GameServer based on the count and/or available capacity.\n0 for MaxCount or MaxAvailable means unlimited maximum. Default for all fields: 0"
},
"allocationGameServerSelector": {
"type": "object",
"properties": {
"matchLabels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Labels to match."
},
"gameServerState": {
"$ref": "#/definitions/GameServerSelectorGameServerState"
},
"players": {
"$ref": "#/definitions/allocationPlayerSelector"
},
"counters": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/allocationCounterSelector"
}
},
"lists": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/allocationListSelector"
}
}
},
"description": "GameServerSelector used for finding a GameServer with matching filters."
},
"allocationLabelSelector": {
"type": "object",
"properties": {
"matchLabels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Labels to match."
}
},
"description": "LabelSelector used for finding a GameServer with matching labels."
},
"allocationListAction": {
"type": "object",
"properties": {
"addValues": {
"type": "array",
"items": {
"type": "string"
}
},
"capacity": {
"type": "string",
"format": "int64"
}
},
"description": "ListAction is an optional action that can be performed on a List at allocation.\nAddValues: Append values to a List's Values array (optional). Any duplicate values will be ignored.\nCapacity: Update the maximum capacity of the Counter to this number (optional). Min 0, Max 1000."
},
"allocationListSelector": {
"type": "object",
"properties": {
"containsValue": {
"type": "string"
},
"minAvailable": {
"type": "string",
"format": "int64"
},
"maxAvailable": {
"type": "string",
"format": "int64"
}
},
"title": "ListSelector is the filter options for a GameServer based on List available capacity and/or the\nexistence of a value in a List.\n0 for MaxAvailable means unlimited maximum. Default for integer fields: 0\n\"\" for ContainsValue means ignore field. Default for string field: \"\""
},
"allocationMetaPatch": {
"type": "object",
"properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"title": "MetaPatch is the metadata used to patch the GameServer metadata on allocation"
},
"allocationMultiClusterSetting": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"format": "boolean",
"description": "If set to true, multi-cluster allocation is enabled."
},
"policySelector": {
"$ref": "#/definitions/allocationLabelSelector",
"description": "Selects multi-cluster allocation policies to apply. If not specified, all multi-cluster allocation policies are to be applied."
}
},
"description": "Specifies settings for multi-cluster allocation."
},
"allocationPlayerSelector": {
"type": "object",
"properties": {
"minAvailable": {
"type": "string",
"format": "uint64"
},
"maxAvailable": {
"type": "string",
"format": "uint64"
}
},
"description": "PlayerSelector is filter for player capacity values.\nminAvailable should always be less or equal to maxAvailable."
},
"allocationPriority": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/allocationPriorityType"
},
"key": {
"type": "string"
},
"order": {
"$ref": "#/definitions/PriorityOrder"
}
},
"description": "Priority is a sorting option for GameServers with Counters or Lists based on the Capacity.\nType: Sort by a \"Counter\" or a \"List\".\nKey: The name of the Counter or List. If not found on the GameServer, has no impact.\nOrder: Sort by \"Ascending\" or \"Descending\". \"Descending\" a bigger Capacity is preferred.\n\"Ascending\" would be smaller Capacity is preferred."
},
"allocationPriorityType": {
"type": "string",
"enum": [
"Counter",
"List"
],
"default": "Counter"
}
}
}