game_server_clusters.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.gaming.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/gaming/v1/common.proto";
  19. import "google/protobuf/field_mask.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming";
  22. option java_multiple_files = true;
  23. option java_package = "com.google.cloud.gaming.v1";
  24. // A view for GameServerCluster objects.
  25. enum GameServerClusterView {
  26. // The default / unset value.
  27. // The API will default to the BASIC view.
  28. GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED = 0;
  29. // Include basic information of a GameServerCluster resource and omit
  30. // `cluster_state`. This is the default value (for ListGameServerClusters,
  31. // GetGameServerCluster and PreviewCreateGameServerCluster).
  32. BASIC = 1;
  33. // Include everything.
  34. FULL = 2;
  35. }
  36. // Request message for GameServerClustersService.ListGameServerClusters.
  37. message ListGameServerClustersRequest {
  38. // Required. The parent resource name, in the following form:
  39. // "projects/{project}/locations/{location}/realms/{realm}".
  40. string parent = 1 [
  41. (google.api.field_behavior) = REQUIRED,
  42. (google.api.resource_reference) = {
  43. child_type: "gameservices.googleapis.com/GameServerCluster"
  44. }
  45. ];
  46. // Optional. The maximum number of items to return. If unspecified, the server
  47. // will pick an appropriate default. The server may return fewer items than
  48. // requested. A caller should only rely on response's
  49. // [next_page_token][google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token] to
  50. // determine if there are more GameServerClusters left to be queried.
  51. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  52. // Optional. The next_page_token value returned from a previous List request, if any.
  53. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  54. // Optional. The filter to apply to list results.
  55. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  56. // Optional. Specifies the ordering of results following syntax at
  57. // https://cloud.google.com/apis/design/design_patterns#sorting_order.
  58. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  59. // Optional. View for the returned GameServerCluster objects. When `FULL` is
  60. // specified, the `cluster_state` field is also returned in the
  61. // GameServerCluster object, which includes the state of the referenced
  62. // Kubernetes cluster such as versions and provider info. The default/unset
  63. // value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
  64. // not return the `cluster_state` field.
  65. GameServerClusterView view = 6 [(google.api.field_behavior) = OPTIONAL];
  66. }
  67. // Response message for GameServerClustersService.ListGameServerClusters.
  68. message ListGameServerClustersResponse {
  69. // The list of game server clusters.
  70. repeated GameServerCluster game_server_clusters = 1;
  71. // Token to retrieve the next page of results, or empty if there are no more
  72. // results in the list.
  73. string next_page_token = 2;
  74. // List of locations that could not be reached.
  75. repeated string unreachable = 4;
  76. }
  77. // Request message for GameServerClustersService.GetGameServerCluster.
  78. message GetGameServerClusterRequest {
  79. // Required. The name of the game server cluster to retrieve, in the following form:
  80. // `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
  81. string name = 1 [
  82. (google.api.field_behavior) = REQUIRED,
  83. (google.api.resource_reference) = {
  84. type: "gameservices.googleapis.com/GameServerCluster"
  85. }
  86. ];
  87. // Optional. View for the returned GameServerCluster objects. When `FULL` is
  88. // specified, the `cluster_state` field is also returned in the
  89. // GameServerCluster object, which includes the state of the referenced
  90. // Kubernetes cluster such as versions and provider info. The default/unset
  91. // value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
  92. // not return the `cluster_state` field.
  93. GameServerClusterView view = 6 [(google.api.field_behavior) = OPTIONAL];
  94. }
  95. // Request message for GameServerClustersService.CreateGameServerCluster.
  96. message CreateGameServerClusterRequest {
  97. // Required. The parent resource name, in the following form:
  98. // `projects/{project}/locations/{location}/realms/{realm-id}`.
  99. string parent = 1 [
  100. (google.api.field_behavior) = REQUIRED,
  101. (google.api.resource_reference) = {
  102. child_type: "gameservices.googleapis.com/GameServerCluster"
  103. }
  104. ];
  105. // Required. The ID of the game server cluster resource to be created.
  106. string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];
  107. // Required. The game server cluster resource to be created.
  108. GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED];
  109. }
  110. // Request message for GameServerClustersService.PreviewCreateGameServerCluster.
  111. message PreviewCreateGameServerClusterRequest {
  112. // Required. The parent resource name, in the following form:
  113. // `projects/{project}/locations/{location}/realms/{realm}`.
  114. string parent = 1 [
  115. (google.api.field_behavior) = REQUIRED,
  116. (google.api.resource_reference) = {
  117. child_type: "gameservices.googleapis.com/GameServerCluster"
  118. }
  119. ];
  120. // Required. The ID of the game server cluster resource to be created.
  121. string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];
  122. // Required. The game server cluster resource to be created.
  123. GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED];
  124. // Optional. The target timestamp to compute the preview.
  125. google.protobuf.Timestamp preview_time = 4 [(google.api.field_behavior) = OPTIONAL];
  126. // Optional. This field is deprecated, preview will always return
  127. // KubernetesClusterState.
  128. GameServerClusterView view = 6 [
  129. deprecated = true,
  130. (google.api.field_behavior) = OPTIONAL
  131. ];
  132. }
  133. // Response message for
  134. // GameServerClustersService.PreviewCreateGameServerCluster.
  135. message PreviewCreateGameServerClusterResponse {
  136. // The ETag of the game server cluster.
  137. string etag = 2;
  138. // The target state.
  139. TargetState target_state = 3;
  140. // Output only. The state of the Kubernetes cluster in preview, this will be available if
  141. // 'view' is set to `FULL` in the relevant List/Get/Preview request.
  142. KubernetesClusterState cluster_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  143. }
  144. // Request message for GameServerClustersService.DeleteGameServerCluster.
  145. message DeleteGameServerClusterRequest {
  146. // Required. The name of the game server cluster to delete, in the following form:
  147. // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
  148. string name = 1 [
  149. (google.api.field_behavior) = REQUIRED,
  150. (google.api.resource_reference) = {
  151. type: "gameservices.googleapis.com/GameServerCluster"
  152. }
  153. ];
  154. }
  155. // Request message for GameServerClustersService.PreviewDeleteGameServerCluster.
  156. message PreviewDeleteGameServerClusterRequest {
  157. // Required. The name of the game server cluster to delete, in the following form:
  158. // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
  159. string name = 1 [
  160. (google.api.field_behavior) = REQUIRED,
  161. (google.api.resource_reference) = {
  162. type: "gameservices.googleapis.com/GameServerCluster"
  163. }
  164. ];
  165. // Optional. The target timestamp to compute the preview.
  166. google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL];
  167. }
  168. // Response message for
  169. // GameServerClustersService.PreviewDeleteGameServerCluster.
  170. message PreviewDeleteGameServerClusterResponse {
  171. // The ETag of the game server cluster.
  172. string etag = 2;
  173. // The target state.
  174. TargetState target_state = 3;
  175. }
  176. // Request message for GameServerClustersService.UpdateGameServerCluster.
  177. message UpdateGameServerClusterRequest {
  178. // Required. The game server cluster to be updated.
  179. // Only fields specified in update_mask are updated.
  180. GameServerCluster game_server_cluster = 1 [(google.api.field_behavior) = REQUIRED];
  181. // Required. Mask of fields to update. At least one path must be supplied in
  182. // this field. For the `FieldMask` definition, see
  183. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  184. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  185. }
  186. // Request message for GameServerClustersService.UpdateGameServerCluster.
  187. message PreviewUpdateGameServerClusterRequest {
  188. // Required. The game server cluster to be updated.
  189. // Only fields specified in update_mask are updated.
  190. GameServerCluster game_server_cluster = 1 [(google.api.field_behavior) = REQUIRED];
  191. // Required. Mask of fields to update. At least one path must be supplied in
  192. // this field. For the `FieldMask` definition, see
  193. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  194. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  195. // Optional. The target timestamp to compute the preview.
  196. google.protobuf.Timestamp preview_time = 3 [(google.api.field_behavior) = OPTIONAL];
  197. }
  198. // Response message for GameServerClustersService.PreviewUpdateGameServerCluster
  199. message PreviewUpdateGameServerClusterResponse {
  200. // The ETag of the game server cluster.
  201. string etag = 2;
  202. // The target state.
  203. TargetState target_state = 3;
  204. }
  205. // The game server cluster connection information.
  206. message GameServerClusterConnectionInfo {
  207. // The location of the Kubernetes cluster.
  208. oneof cluster_reference {
  209. // Reference to the GKE cluster where the game servers are installed.
  210. GkeClusterReference gke_cluster_reference = 7;
  211. }
  212. // Namespace designated on the game server cluster where the Agones game
  213. // server instances will be created. Existence of the namespace will be
  214. // validated during creation.
  215. string namespace = 5;
  216. }
  217. // A reference to a GKE cluster.
  218. message GkeClusterReference {
  219. // The full or partial name of a GKE cluster, using one of the following
  220. // forms:
  221. // * `projects/{project}/locations/{location}/clusters/{cluster}`
  222. // * `locations/{location}/clusters/{cluster}`
  223. // * `{cluster}`
  224. // If project and location are not specified, the project and location of the
  225. // GameServerCluster resource are used to generate the full name of the
  226. // GKE cluster.
  227. string cluster = 1;
  228. }
  229. // A game server cluster resource.
  230. message GameServerCluster {
  231. option (google.api.resource) = {
  232. type: "gameservices.googleapis.com/GameServerCluster"
  233. pattern: "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}"
  234. };
  235. // Required. The resource name of the game server cluster, in the following form:
  236. // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`.
  237. // For example,
  238. // `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
  239. string name = 1 [(google.api.field_behavior) = REQUIRED];
  240. // Output only. The creation time.
  241. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  242. // Output only. The last-modified time.
  243. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  244. // The labels associated with this game server cluster. Each label is a
  245. // key-value pair.
  246. map<string, string> labels = 4;
  247. // The game server cluster connection information. This information is used to
  248. // manage game server clusters.
  249. GameServerClusterConnectionInfo connection_info = 5;
  250. // ETag of the resource.
  251. string etag = 6;
  252. // Human readable description of the cluster.
  253. string description = 7;
  254. // Output only. The state of the Kubernetes cluster, this will be available if
  255. // 'view' is set to `FULL` in the relevant List/Get/Preview request.
  256. KubernetesClusterState cluster_state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  257. }
  258. // The state of the Kubernetes cluster.
  259. message KubernetesClusterState {
  260. // The state of the installed versions of Agones/Kubernetes. See also
  261. // https://cloud.google.com/game-servers/docs/versions-and-upgrades.
  262. enum InstallationState {
  263. // The default value. This value is used if the state is omitted.
  264. INSTALLATION_STATE_UNSPECIFIED = 0;
  265. // The combination of Agones and Kubernetes versions is supported by Google
  266. // Cloud Game Servers.
  267. AGONES_KUBERNETES_VERSION_SUPPORTED = 1;
  268. // The installed version of Agones is not supported by Google Cloud Game
  269. // Servers.
  270. AGONES_VERSION_UNSUPPORTED = 2;
  271. // The installed version of Agones is supported by Google Cloud Game
  272. // Servers, but the installed version of Kubernetes is not recommended or
  273. // supported by the version of Agones.
  274. AGONES_KUBERNETES_VERSION_UNSUPPORTED = 3;
  275. // The installed version of Agones is not recognized because the Agones
  276. // controller's image name does not have a version string reported as
  277. // {major}.{minor}(.{patch}).
  278. AGONES_VERSION_UNRECOGNIZED = 4;
  279. // The server version of Kubernetes cluster is not recognized because the
  280. // API server didn't return parsable version info on path/version.
  281. KUBERNETES_VERSION_UNRECOGNIZED = 5;
  282. // Failed to read or verify the version of Agones or Kubernetes. See
  283. // version_installed_error_message for details.
  284. VERSION_VERIFICATION_FAILED = 6;
  285. // Agones is not installed.
  286. AGONES_NOT_INSTALLED = 7;
  287. }
  288. // Output only. The version of Agones currently installed in the registered Kubernetes
  289. // cluster.
  290. string agones_version_installed = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  291. // Output only. The version of Kubernetes that is currently used in the registered
  292. // Kubernetes cluster (as detected by the Cloud Game Servers service).
  293. string kubernetes_version_installed = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  294. // Output only. The state for the installed versions of Agones/Kubernetes.
  295. InstallationState installation_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  296. // Output only. The detailed error message for the installed versions of Agones/Kubernetes.
  297. string version_installed_error_message = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  298. // Output only. The cloud provider type reported by the first node's providerID in the list
  299. // of nodes on the Kubernetes endpoint. On Kubernetes platforms that support
  300. // zero-node clusters (like GKE-on-GCP), the provider type will be empty.
  301. string provider = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  302. // Output only. The version of Agones that is targeted to be installed in the cluster.
  303. string agones_version_targeted = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  304. }