/
allocation.swagger.json
217 lines (217 loc) · 6.67 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
{
"swagger": "2.0",
"info": {
"title": "proto/allocation/allocation.proto",
"version": "version not set"
},
"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"
},
"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"
},
"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": {
"$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": {
"$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."
}
}
},
"allocationAllocationResponse": {
"type": "object",
"properties": {
"gameServerName": {
"type": "string"
},
"ports": {
"type": "array",
"items": {
"$ref": "#/definitions/AllocationResponseGameServerStatusPort"
}
},
"address": {
"type": "string"
},
"nodeName": {
"type": "string"
}
}
},
"allocationGameServerSelector": {
"type": "object",
"properties": {
"matchLabels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Labels to match."
},
"gameServerState": {
"$ref": "#/definitions/GameServerSelectorGameServerState"
},
"players": {
"$ref": "#/definitions/allocationPlayerSelector"
}
},
"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."
},
"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."
}
}
}