Skip to content

Commit

Permalink
Adding make file to generate allocation go from proto
Browse files Browse the repository at this point in the history
  • Loading branch information
pooneh-m committed Sep 9, 2019
1 parent d2dc2b4 commit 58dac75
Show file tree
Hide file tree
Showing 8 changed files with 1,048 additions and 0 deletions.
541 changes: 541 additions & 0 deletions allocation/go/v1alpha1/allocation.pb.go

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions allocation/go/v1alpha1/allocation.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

208 changes: 208 additions & 0 deletions allocation/go/v1alpha1/allocation.swagger.json
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."
}
}
}
1 change: 1 addition & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ include ./includes/minikube.mk
include ./includes/kind.mk
include ./includes/website.mk
include ./includes/sdk.mk
include ./includes/allocation.mk

# _____ _
# |_ _|_ _ _ __ __ _ ___| |_ ___
Expand Down
4 changes: 4 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Table of Contents
* [make gen-install](#make-gen-install)
* [make gen-crd-client](#make-gen-crd-client)
* [make gen-sdk-grpc](#make-gen-sdk-grpc)
* [make gen-allocation-grpc](#make-gen-allocation-grpc)
* [Build Image Targets](#build-image-targets)
* [make clean-config](#make-clean-config)
* [make clean-build-image](#make-clean-build-image)
Expand Down Expand Up @@ -541,6 +542,9 @@ Generate the Custom Resource Definition client(s)
#### `make gen-sdk-grpc`
Generate the SDK gRPC server and client code

#### `make gen-allocation-grpc`
Generate the Allocation service gRPC server and client code

### Build Image Targets

Targets for building the build image
Expand Down
Loading

0 comments on commit 58dac75

Please sign in to comment.