common.proto 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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/protobuf/duration.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming";
  20. option java_multiple_files = true;
  21. option java_package = "com.google.cloud.gaming.v1";
  22. // Represents the metadata of the long-running operation.
  23. message OperationMetadata {
  24. // Output only. The time the operation was created.
  25. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  26. // Output only. The time the operation finished running.
  27. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  28. // Output only. Server-defined resource path for the target of the operation.
  29. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  30. // Output only. Name of the verb executed by the operation.
  31. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  32. // Output only. Human-readable status of the operation, if any.
  33. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  34. // Output only. Identifies whether the user has requested cancellation
  35. // of the operation. Operations that have successfully been cancelled
  36. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  37. // corresponding to `Code.CANCELLED`.
  38. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  39. // Output only. API version used to start the operation.
  40. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  41. // Output only. List of Locations that could not be reached.
  42. repeated string unreachable = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  43. // Output only. Operation status for Game Services API operations. Operation status is in
  44. // the form of key-value pairs where keys are resource IDs and the values show
  45. // the status of the operation. In case of failures, the value includes an
  46. // error code and error message.
  47. map<string, OperationStatus> operation_status = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  48. }
  49. message OperationStatus {
  50. enum ErrorCode {
  51. ERROR_CODE_UNSPECIFIED = 0;
  52. INTERNAL_ERROR = 1;
  53. PERMISSION_DENIED = 2;
  54. CLUSTER_CONNECTION = 3;
  55. }
  56. // Output only. Whether the operation is done or still in progress.
  57. bool done = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  58. // The error code in case of failures.
  59. ErrorCode error_code = 2;
  60. // The human-readable error message.
  61. string error_message = 3;
  62. }
  63. // The label selector, used to group labels on the resources.
  64. message LabelSelector {
  65. // Resource labels for this selector.
  66. map<string, string> labels = 1;
  67. }
  68. // The realm selector, used to match realm resources.
  69. message RealmSelector {
  70. // List of realms to match.
  71. repeated string realms = 1;
  72. }
  73. // The schedule of a recurring or one time event. The event's time span is
  74. // specified by start_time and end_time. If the scheduled event's timespan is
  75. // larger than the cron_spec + cron_job_duration, the event will be recurring.
  76. // If only cron_spec + cron_job_duration are specified, the event is effective
  77. // starting at the local time specified by cron_spec, and is recurring.
  78. //
  79. // ```
  80. // start_time|-------[cron job]-------[cron job]-------[cron job]---|end_time
  81. // cron job: cron spec start time + duration
  82. // ```
  83. message Schedule {
  84. // The start time of the event.
  85. google.protobuf.Timestamp start_time = 1;
  86. // The end time of the event.
  87. google.protobuf.Timestamp end_time = 2;
  88. // The duration for the cron job event. The duration of the event is effective
  89. // after the cron job's start time.
  90. google.protobuf.Duration cron_job_duration = 3;
  91. // The cron definition of the scheduled event. See
  92. // https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
  93. // defined by the realm.
  94. string cron_spec = 4;
  95. }
  96. // Encapsulates Agones fleet spec and Agones autoscaler spec sources.
  97. message SpecSource {
  98. // The game server config resource. Uses the form:
  99. // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}`.
  100. string game_server_config_name = 1;
  101. // The name of the Agones leet config or Agones scaling config used to derive
  102. // the Agones fleet or Agones autoscaler spec.
  103. string name = 2;
  104. }
  105. // Details about the Agones resources.
  106. message TargetDetails {
  107. // Details of the target Agones fleet.
  108. message TargetFleetDetails {
  109. // Target Agones fleet specification.
  110. message TargetFleet {
  111. // The name of the Agones fleet.
  112. string name = 1;
  113. // Encapsulates the source of the Agones fleet spec.
  114. // The Agones fleet spec source.
  115. SpecSource spec_source = 2;
  116. }
  117. // Target Agones autoscaler policy reference.
  118. message TargetFleetAutoscaler {
  119. // The name of the Agones autoscaler.
  120. string name = 1;
  121. // Encapsulates the source of the Agones fleet spec.
  122. // Details about the Agones autoscaler spec.
  123. SpecSource spec_source = 2;
  124. }
  125. // Reference to target Agones fleet.
  126. TargetFleet fleet = 1;
  127. // Reference to target Agones fleet autoscaling policy.
  128. TargetFleetAutoscaler autoscaler = 2;
  129. }
  130. // The game server cluster name. Uses the form:
  131. // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`.
  132. string game_server_cluster_name = 1;
  133. // The game server deployment name. Uses the form:
  134. // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}`.
  135. string game_server_deployment_name = 2;
  136. // Agones fleet details for game server clusters and game server deployments.
  137. repeated TargetFleetDetails fleet_details = 3;
  138. }
  139. // Encapsulates the Target state.
  140. message TargetState {
  141. // Details about Agones fleets.
  142. repeated TargetDetails details = 1;
  143. }
  144. // Details of the deployed Agones fleet.
  145. message DeployedFleetDetails {
  146. // Agones fleet specification and details.
  147. message DeployedFleet {
  148. // DeployedFleetStatus has details about the Agones fleets such as how many
  149. // are running, how many allocated, and so on.
  150. message DeployedFleetStatus {
  151. // The number of GameServer replicas in the READY state in this fleet.
  152. int64 ready_replicas = 1;
  153. // The number of GameServer replicas in the ALLOCATED state in this fleet.
  154. int64 allocated_replicas = 2;
  155. // The number of GameServer replicas in the RESERVED state in this fleet.
  156. // Reserved instances won't be deleted on scale down, but won't cause
  157. // an autoscaler to scale up.
  158. int64 reserved_replicas = 3;
  159. // The total number of current GameServer replicas in this fleet.
  160. int64 replicas = 4;
  161. }
  162. // The name of the Agones fleet.
  163. string fleet = 1;
  164. // The fleet spec retrieved from the Agones fleet.
  165. string fleet_spec = 2;
  166. // The source spec that is used to create the Agones fleet.
  167. // The GameServerConfig resource may no longer exist in the system.
  168. SpecSource spec_source = 3;
  169. // The current status of the Agones fleet.
  170. // Includes count of game servers in various states.
  171. DeployedFleetStatus status = 5;
  172. }
  173. // Details about the Agones autoscaler.
  174. message DeployedFleetAutoscaler {
  175. // The name of the Agones autoscaler.
  176. string autoscaler = 1;
  177. // The source spec that is used to create the autoscaler.
  178. // The GameServerConfig resource may no longer exist in the system.
  179. SpecSource spec_source = 4;
  180. // The autoscaler spec retrieved from Agones.
  181. string fleet_autoscaler_spec = 3;
  182. }
  183. // Information about the Agones fleet.
  184. DeployedFleet deployed_fleet = 1;
  185. // Information about the Agones autoscaler for that fleet.
  186. DeployedFleetAutoscaler deployed_autoscaler = 2;
  187. }