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 // [Linux] Isolated CPU ids (isolcpus=), the values to offer for
163 // MotionControllerCreationParameters.cpu_affinity. Read once at server startup. Empty on Windows.
164 repeated int32 isolated_cpus = 8;
165
166 // [Linux] Ethernet NIC names (loopback and virtual interfaces excluded), the values to offer for
167 // MotionControllerCreationParameters.primary_nic. Read once at server startup. Empty on Windows.
168 repeated string nic_names = 9;
169}
170
171message ServerUpdateRequest {
172 // Common request header.
173 RequestHeader header = 1;
174
175 // The version of RMP to download from the RSI downloads site.
176 // The version must be in the format: <major version number>.<minor version number>.<revision number>
177 // An example version would be: "10.3.10"
178 optional string download_version = 2;
179
180 // The source to start a new RapidServer from.
181 // If set to a URI of an RMP zip archive, the zip will be downloaded and the new version of the
182 // RapidServer will be extracted to the directory specified in the destination field.
183 // If set to a zip file located on the local filesystem, the new version of the RapidServer will
184 // be extracted to the directory specified in the destination field.
185 // If set to a directory, a new instance of the RapidServer will be started from the given directory.
186 // This field is only used if the download version is not specified.
187 optional string source = 3;
188
189 // The directory to extract the contents of the zip archive to.
190 // If this field is not set or is an empty string, the contents will be extracted to the current directory.
191 // If the directory doesn't exist, the server will attempt to create it.
192 optional string destination = 4;
193}
194
195message ServerUpdateResponse {
196 // Common response header. Always check the response header for errors.
197 ResponseHeader header = 1;
198}
199
200message ServerRestartRequest {
201 // Common request header.
202 RequestHeader header = 1;
203
204 // The directory to restart the RapidServer from.
205 // If this field is not specified, the RapidServer will just start from
206 // the current directory.
207 optional string start_directory = 2;
208}
209
210message ServerRestartResponse {
211 // Common response header. Always check the response header for errors.
212 ResponseHeader header = 1;
213}
214
215message ServerReserveRequest {
216 // Common request header.
217 RequestHeader header = 1;
218
219 // Set this boolean to true to release the currently active reservation.
220 optional bool release = 2;
221
222 // Set this boolean to true to make a new reservation.
223 // This will override the existing reservation.
224 optional bool reserve = 3;
225}
226
227message ServerReserveResponse {
228 // Common response header. Always check the response header for errors.
229 ResponseHeader header = 1;
230
231 // The ticket containing information about the reservation session.
232 ServerReservation reservation = 2;
233}
234
235message ServerFileRequest {
236 // Common request header.
237 RequestHeader header = 1;
238
239 // The path to the file.
240 // Accepts both absolute paths and paths relative to the server executable's directory.
241 string path = 2;
242}
243
244message FileChunk {
245 // The contents of the message
246 oneof content {
247 // The raw data to be sent.
248 bytes data = 1;
249
250 // The name to save the file with.
251 // When the server sees a FileChunk message with this field instead of the data field,
252 // it will finish its work with the previous file and begin to write to the file with this name instead.
253 string name = 2;
254 }
255}
256
257message ServerSendFileResponse {
258 // Common response header. Always check the response header for errors.
259 ResponseHeader header = 1;
260}
261
262message ServerFileExistsResponse {
263 // Common response header. Always check the response header for errors.
264 ResponseHeader header = 1;
265
266 // True if the file exists, false otherwise.
267 bool exists = 2;
268}
269
270message ServerDeleteFileResponse {
271 // Common response header. Always check the response header for errors.
272 ResponseHeader header = 1;
273}