-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding make file to generate allocation go from proto
- Loading branch information
Showing
8 changed files
with
1,048 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "cmd/allocator/v1alpha1/allocation.proto", | ||
"version": "version not set" | ||
}, | ||
"schemes": [ | ||
"https" | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": { | ||
"/v1alpha1/gameserverallocation": { | ||
"post": { | ||
"operationId": "PostAllocate", | ||
"responses": { | ||
"200": { | ||
"description": "", | ||
"schema": { | ||
"$ref": "#/definitions/v1alpha1AllocationResponse" | ||
} | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"name": "body", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/v1alpha1AllocationRequest" | ||
} | ||
} | ||
], | ||
"tags": [ | ||
"AllocationService" | ||
] | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"AllocationRequestSchedulingStrategy": { | ||
"type": "string", | ||
"enum": [ | ||
"Packed", | ||
"Distributed" | ||
], | ||
"default": "Packed" | ||
}, | ||
"AllocationResponseGameServerAllocationState": { | ||
"type": "string", | ||
"enum": [ | ||
"Unknown", | ||
"Allocated", | ||
"UnAllocated", | ||
"Contention" | ||
], | ||
"default": "Unknown", | ||
"description": "- Allocated: Allocated is for successful allocation\n - UnAllocated: UnAllocated is for unsuccessful allocation due to lack of gameserver resources\n - Contention: Contention is for unsuccessful allocation due to contention", | ||
"title": "The allocation state" | ||
}, | ||
"AllocationResponseGameServerStatusPort": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"port": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
}, | ||
"description": "The gameserver port info that is allocated." | ||
}, | ||
"v1LabelSelector": { | ||
"type": "object", | ||
"properties": { | ||
"matchLabels": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
}, | ||
"title": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.\n+optional" | ||
}, | ||
"matchExpressions": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/v1LabelSelectorRequirement" | ||
}, | ||
"title": "matchExpressions is a list of label selector requirements. The requirements are ANDed.\n+optional" | ||
} | ||
}, | ||
"description": "A label selector is a label query over a set of resources. The result of matchLabels and\nmatchExpressions are ANDed. An empty label selector matches all objects. A null\nlabel selector matches no objects." | ||
}, | ||
"v1LabelSelectorRequirement": { | ||
"type": "object", | ||
"properties": { | ||
"key": { | ||
"type": "string", | ||
"title": "key is the label key that the selector applies to.\n+patchMergeKey=key\n+patchStrategy=merge" | ||
}, | ||
"operator": { | ||
"type": "string", | ||
"description": "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist." | ||
}, | ||
"values": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"title": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.\n+optional" | ||
} | ||
}, | ||
"description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values." | ||
}, | ||
"v1alpha1AllocationRequest": { | ||
"type": "object", | ||
"properties": { | ||
"namespace": { | ||
"type": "string", | ||
"title": "The k8s namespace that is hosting the targetted fleet of gameservers to be allocated" | ||
}, | ||
"multiClusterSetting": { | ||
"$ref": "#/definitions/v1alpha1MultiClusterSetting", | ||
"description": "If specified, multi-cluster policies are applied. Otherwise, allocation will happen locally." | ||
}, | ||
"requiredGameServerSelector": { | ||
"$ref": "#/definitions/v1LabelSelector", | ||
"description": "The required allocation. Defaults to all GameServers." | ||
}, | ||
"preferredGameServerSelectors": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/v1LabelSelector" | ||
}, | ||
"description": "The 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/v1alpha1MetaPatch", | ||
"title": "MetaPatch is optional custom metadata that is added to the game server at\nallocation You can use this to tell the server necessary session data" | ||
} | ||
} | ||
}, | ||
"v1alpha1AllocationResponse": { | ||
"type": "object", | ||
"properties": { | ||
"state": { | ||
"$ref": "#/definitions/AllocationResponseGameServerAllocationState" | ||
}, | ||
"gameServerName": { | ||
"type": "string" | ||
}, | ||
"ports": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/AllocationResponseGameServerStatusPort" | ||
} | ||
}, | ||
"address": { | ||
"type": "string" | ||
}, | ||
"nodeName": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"v1alpha1MetaPatch": { | ||
"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" | ||
}, | ||
"v1alpha1MultiClusterSetting": { | ||
"type": "object", | ||
"properties": { | ||
"enabled": { | ||
"type": "boolean", | ||
"format": "boolean", | ||
"description": "If set to true, multi-cluster allocation is enabled." | ||
}, | ||
"policySelector": { | ||
"$ref": "#/definitions/v1LabelSelector", | ||
"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." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.