APIs, concepts, guides, and more
rapidgrpc.proto
1// File: rapidgrpc.proto
2// This file describes the gRPC interface for RapidServer servers.
3
4syntax = "proto3";
5package RSI.RapidServer;
6import "google/protobuf/timestamp.proto";
7import "google/protobuf/any.proto";
8
9/*** Common Message Fields ***/
10message RequestHeader {
11 // The time the client sent the request (according to the client's clock).
12 google.protobuf.Timestamp time_sent = 1;
13
14 // The name of the client.
15 string client_name = 2;
16
17 // A way to speed up calls by skipping populating response data.
18 optional ResponseOptimization optimization = 3;
19}
20
21message ResponseOptimization {
22 optional bool skip_config = 1;
23 optional bool skip_info = 2;
24 optional bool skip_status = 3;
25}
26
28message ErrorSource {
29 // Object index (0-based index of the object that has the error)
30 int32 object_index = 1;
31
32 // Whether the error is or is not a warning.
33 bool is_warning = 2;
34
35 // Source file name.
36 string file_name = 3;
37
38 // The name of the function that raised the error.
39 string method_name = 4;
40
41 // The line number in the source code
42 int32 line_number = 5;
43}
44
45message ErrorMessage {
46 // An error that occured on the server while executing the remote procedure call.
47 string message = 1;
48
49 // An error code. Will have to be casted to the appropriate enum type.
50 int32 code = 2;
51
52 // The human-readable name of the error code.
53 string code_name = 3;
54
55 ErrorSource source = 4;
56
57 // A shorter, more concise version of the error message.
58 string short_message = 5;
59}
60
61message ResponseHeader {
62 // Return the RequestHeader back to the client.
63 RequestHeader request_header = 1;
64
65 // The time the server received the request (according to the server's clock).
66 google.protobuf.Timestamp time_request_received = 2;
67
68 // The time the server send the response (according to the server's clock).
69 google.protobuf.Timestamp time_response_sent = 3;
70
71 // Errors to report back to the client.
72 repeated ErrorMessage errors = 4;
73
74 // Return the request message to the client.
75 google.protobuf.Any request = 5;
76}
78
79enum Platform {
80 PLATFORM_UNSPECIFIED = 0;
81 LINUX = 1;
82 INTIME = 2;
83 WINDOWS = 3;
84}
85
86/*** ServerControlService ***/
87
88service ServerControlService {
89
90 // Get details about the server such as the ID, the URI it accepts gRPC
91 // requests on, and its human-readable name.
92 rpc GetInfo (ServerGetInfoRequest) returns (ServerGetInfoResponse);
93
94 // Shuts down the Server
95 rpc Shutdown (ServerShutdownRequest) returns (ServerShutdownResponse);
96
97 // Updates the server and the RMP to the specified version
98 rpc Update (ServerUpdateRequest) returns (ServerUpdateResponse);
99
100 // Restart the server. Can restart a new instance from a specified directory.
101 rpc Restart (ServerRestartRequest) returns (ServerRestartResponse);
102
103 // Reserve the server. Intended for RSI internal use only.
104 rpc Reserve (ServerReserveRequest) returns (ServerReserveResponse);
105
106 // Get a file from the server.
107 rpc GetFile (ServerFileRequest) returns (stream FileChunk);
108
109 // Send a file to the server
110 rpc SendFile (stream FileChunk) returns (ServerSendFileResponse);
111
112 // Check if a file exists on the server's host filesystem.
113 rpc FileExists (ServerFileRequest) returns (ServerFileExistsResponse);
114
115 // Delete a file from the server's host filesystem.
116 rpc DeleteFile (ServerFileRequest) returns (ServerDeleteFileResponse);
117}
118
119message ServerShutdownRequest {
120 // Common request header.
121 RequestHeader header = 1;
122}
123
124message ServerShutdownResponse {
125 // Common response header. Always check the response header for errors.
126 ResponseHeader header = 1;
127}
128
129message ServerGetInfoRequest {
130 // Common request header.
131 RequestHeader header = 1;
132}
133
134message ServerReservation {
135 // A unique identifier for the reserved session between the client and the RapidServer.
136 // This field will be 0 if the server currently has not active reservation.
137 uint64 session_id = 1;
138}
139
140message ServerGetInfoResponse {
141 // Common response header. Always check the response header for errors.
142 ResponseHeader header = 1;
143
144 // Timestamp of when this server was started
145 google.protobuf.Timestamp time_started = 2;
146
147 // ID of the server
148 uint64 id = 3;
149
150 // The friendly name of the server
151 string name = 4;
152
153 // The version of the server
154 string version = 5;
155
156 // The server's current reservation information
157 ServerReservation reservation = 6;
158
159 // The platform (or operating system) the server is running on
160 Platform platform = 7;
161}
162
163message ServerUpdateRequest {
164 // Common request header.
165 RequestHeader header = 1;
166
167 // The version of RMP to download from the RSI downloads site.
168 // The version must be in the format: <major version number>.<minor version number>.<revision number>
169 // An example version would be: "10.3.10"
170 optional string download_version = 2;
171
172 // The source to start a new RapidServer from.
173 // If set to a URI of an RMP zip archive, the zip will be downloaded and the new version of the
174 // RapidServer will be extracted to the directory specified in the destination field.
175 // If set to a zip file located on the local filesystem, the new version of the RapidServer will
176 // be extracted to the directory specified in the destination field.
177 // If set to a directory, a new instance of the RapidServer will be started from the given directory.
178 // This field is only used if the download version is not specified.
179 optional string source = 3;
180
181 // The directory to extract the contents of the zip archive to.
182 // If this field is not set or is an empty string, the contents will be extracted to the current directory.
183 // If the directory doesn't exist, the server will attempt to create it.
184 optional string destination = 4;
185}
186
187message ServerUpdateResponse {
188 // Common response header. Always check the response header for errors.
189 ResponseHeader header = 1;
190}
191
192message ServerRestartRequest {
193 // Common request header.
194 RequestHeader header = 1;
195
196 // The directory to restart the RapidServer from.
197 // If this field is not specified, the RapidServer will just start from
198 // the current directory.
199 optional string start_directory = 2;
200}
201
202message ServerRestartResponse {
203 // Common response header. Always check the response header for errors.
204 ResponseHeader header = 1;
205}
206
207message ServerReserveRequest {
208 // Common request header.
209 RequestHeader header = 1;
210
211 // Set this boolean to true to release the currently active reservation.
212 optional bool release = 2;
213
214 // Set this boolean to true to make a new reservation.
215 // This will override the existing reservation.
216 optional bool reserve = 3;
217}
218
219message ServerReserveResponse {
220 // Common response header. Always check the response header for errors.
221 ResponseHeader header = 1;
222
223 // The ticket containing information about the reservation session.
224 ServerReservation reservation = 2;
225}
226
227message ServerFileRequest {
228 // Common request header.
229 RequestHeader header = 1;
230
231 // The path to the file
232 string path = 2;
233}
234
235message FileChunk {
236 // The contents of the message
237 oneof content {
238 // The raw data to be sent.
239 bytes data = 1;
240
241 // The name to save the file with.
242 // When the server sees a FileChunk message with this field instead of the data field,
243 // it will finish its work with the previous file and begin to write to the file with this name instead.
244 string name = 2;
245 }
246}
247
248message ServerSendFileResponse {
249 // Common response header. Always check the response header for errors.
250 ResponseHeader header = 1;
251}
252
253message ServerFileExistsResponse {
254 // Common response header. Always check the response header for errors.
255 ResponseHeader header = 1;
256
257 // True if the file exists, false otherwise.
258 bool exists = 2;
259}
260
261message ServerDeleteFileResponse {
262 // Common response header. Always check the response header for errors.
263 ResponseHeader header = 1;
264}