agones.dev/agones@v1.54.0/sdks/csharp/proto/sdk/sdk.proto (about)

     1  // Copyright 2017 Google LLC All Rights Reserved.
     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  
    15  syntax = "proto3";
    16  
    17  package agones.dev.sdk;
    18  option go_package = "./sdk";
    19  
    20  import "google/api/annotations.proto";
    21  
    22  
    23  
    24  
    25  
    26  
    27  
    28  
    29  
    30  
    31  // SDK service to be used in the GameServer SDK to the Pod Sidecar
    32  service SDK {
    33      // Call when the GameServer is ready
    34      rpc Ready (Empty) returns (Empty) {
    35          option (google.api.http) = {
    36              post: "/ready"
    37              body: "*"
    38          };
    39      }
    40  
    41      // Call to self Allocation the GameServer
    42      rpc Allocate(Empty) returns (Empty) {
    43          option (google.api.http) = {
    44              post: "/allocate"
    45              body: "*"
    46          };
    47      }
    48  
    49      // Call when the GameServer is shutting down
    50      rpc Shutdown (Empty) returns (Empty) {
    51          option (google.api.http) = {
    52              post: "/shutdown"
    53              body: "*"
    54          };
    55      }
    56      // Send a Empty every d Duration to declare that this GameSever is healthy
    57      rpc Health (stream Empty) returns (Empty) {
    58          option (google.api.http) = {
    59              post: "/health"
    60              body: "*"
    61          };
    62      }
    63      // Retrieve the current GameServer data
    64      rpc GetGameServer (Empty) returns (GameServer) {
    65          option (google.api.http) = {
    66              get: "/gameserver"
    67          };
    68      }
    69      // Send GameServer details whenever the GameServer is updated
    70      rpc WatchGameServer (Empty) returns (stream GameServer) {
    71          option (google.api.http) = {
    72              get: "/watch/gameserver"
    73          };
    74      }
    75  
    76      // Apply a Label to the backing GameServer metadata
    77      rpc SetLabel(KeyValue) returns (Empty) {
    78          option (google.api.http) = {
    79              put: "/metadata/label"
    80              body: "*"
    81          };
    82      }
    83  
    84      // Apply a Annotation to the backing GameServer metadata
    85      rpc SetAnnotation(KeyValue) returns (Empty) {
    86          option (google.api.http) = {
    87              put: "/metadata/annotation"
    88              body: "*"
    89          };
    90      }
    91  
    92      // Marks the GameServer as the Reserved state for Duration
    93      rpc Reserve(Duration) returns (Empty) {
    94          option (google.api.http) = {
    95              post: "/reserve"
    96              body: "*"
    97          };
    98      }
    99  }
   100  
   101  // I am Empty
   102  message Empty {
   103  }
   104  
   105  // Key, Value entry
   106  message KeyValue {
   107      string key = 1;
   108      string value = 2;
   109  }
   110  
   111  // time duration, in seconds
   112  message Duration {
   113      int64 seconds = 1;
   114  }
   115  
   116  // A GameServer Custom Resource Definition object
   117  // We will only export those resources that make the most
   118  // sense. Can always expand to more as needed.
   119  message GameServer {
   120      ObjectMeta object_meta = 1;
   121      Spec spec = 2;
   122      Status status = 3;
   123  
   124      // representation of the K8s ObjectMeta resource
   125      message ObjectMeta {
   126          string name = 1;
   127          string namespace = 2;
   128          string uid = 3;
   129          string resource_version = 4;
   130          int64 generation = 5;
   131          // timestamp is in Epoch format, unit: seconds
   132          int64 creation_timestamp = 6;
   133          // optional deletion timestamp in Epoch format, unit: seconds
   134          int64 deletion_timestamp = 7;
   135          map<string, string> annotations = 8;
   136          map<string, string> labels = 9;
   137      }
   138  
   139      message Spec {
   140          Health health = 1;
   141  
   142          message Health {
   143              bool disabled = 1;
   144              int32 period_seconds = 2;
   145              int32 failure_threshold = 3;
   146              int32 initial_delay_seconds = 4;
   147          }
   148      }
   149  
   150      message Status {
   151          message Address {
   152              string type = 1;
   153              string address = 2;
   154          }
   155  
   156          message Port {
   157              string name = 1;
   158              int32 port = 2;
   159          }
   160          // [Stage:Alpha]
   161          // [FeatureFlag:PlayerTracking]
   162          message PlayerStatus {
   163              int64 count = 1;
   164              int64 capacity = 2;
   165              repeated string ids = 3;
   166          }
   167  
   168          // [Stage:Beta]
   169          // [FeatureFlag:CountsAndLists]
   170          message CounterStatus {
   171            int64 count = 1;
   172            int64 capacity = 2;
   173          }
   174  
   175          // [Stage:Beta]
   176          // [FeatureFlag:CountsAndLists]
   177          message ListStatus {
   178            int64 capacity = 1;
   179            repeated string values = 2;
   180          }
   181  
   182          string state = 1;
   183          string address = 2;
   184          repeated Address addresses = 7;
   185          repeated Port ports = 3;
   186  
   187          // [Stage:Alpha]
   188          // [FeatureFlag:PlayerTracking]
   189          PlayerStatus players = 4;
   190  
   191          // [Stage:Beta]
   192          // [FeatureFlag:CountsAndLists]
   193          map<string, CounterStatus> counters = 5;
   194  
   195          // [Stage:Beta]
   196          // [FeatureFlag:CountsAndLists]
   197          map<string, ListStatus> lists = 6;
   198      }
   199  }