The RMP Motion Controller APIs
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
58message ResponseHeader {
59 // Return the RequestHeader back to the client.
60 RequestHeader request_header = 1;
61
62 // The time the server received the request (according to the server's clock).
63 google.protobuf.Timestamp time_request_received = 2;
64
65 // The time the server send the response (according to the server's clock).
66 google.protobuf.Timestamp time_response_sent = 3;
67
68 // Errors to report back to the client.
69 repeated ErrorMessage errors = 4;
70
71 // Return the request message to the client.
72 google.protobuf.Any request = 5;
73}
75
76enum Platform {
77 PLATFORM_UNSPECIFIED = 0;
78 LINUX = 1;
79 INTIME = 2;
80 WINDOWS = 3;
81}
82
83/*** ServerControlService ***/
84
85service ServerControlService {
86
87 // Get details about the server such as the ID, the URI it accepts gRPC
88 // requests on, and its human-readable name.
89 rpc GetInfo (ServerGetInfoRequest) returns (ServerGetInfoResponse);
90
91 // Shuts down the Server
92 rpc Shutdown (ServerShutdownRequest) returns (ServerShutdownResponse);
93
94 // Updates the server and the RMP to the specified version
95 rpc Update (ServerUpdateRequest) returns (ServerUpdateResponse);
96
97 // Restart the server. Can restart a new instance from a specified directory.
98 rpc Restart (ServerRestartRequest) returns (ServerRestartResponse);
99
100 // Reserve the server. Intended for RSI internal use only.
101 rpc Reserve (ServerReserveRequest) returns (ServerReserveResponse);
102
103 // Get a file from the server.
104 rpc GetFile (ServerFileRequest) returns (stream FileChunk);
105
106 // Send a file to the server
107 rpc SendFile (stream FileChunk) returns (ServerSendFileResponse);
108
109 // Check if a file exists on the server's host filesystem.
110 rpc FileExists (ServerFileRequest) returns (ServerFileExistsResponse);
111
112 // Delete a file from the server's host filesystem.
113 rpc DeleteFile (ServerFileRequest) returns (ServerDeleteFileResponse);
114}
115
116message ServerShutdownRequest {
117 // Common request header.
118 RequestHeader header = 1;
119}
120
121message ServerShutdownResponse {
122 // Common response header. Always check the response header for errors.
123 ResponseHeader header = 1;
124}
125
126message ServerGetInfoRequest {
127 // Common request header.
128 RequestHeader header = 1;
129}
130
131message ServerReservation {
132 // A unique identifier for the reserved session between the client and the RapidServer.
133 // This field will be 0 if the server currently has not active reservation.
134 uint64 session_id = 1;
135}
136
137message ServerGetInfoResponse {
138 // Common response header. Always check the response header for errors.
139 ResponseHeader header = 1;
140
141 // Timestamp of when this server was started
142 google.protobuf.Timestamp time_started = 2;
143
144 // ID of the server
145 uint64 id = 3;
146
147 // The friendly name of the server
148 string name = 4;
149
150 // The version of the server
151 string version = 5;
152
153 // The server's current reservation information
154 ServerReservation reservation = 6;
155
156 // The platform (or operating system) the server is running on
157 Platform platform = 7;
158}
159
160message ServerUpdateRequest {
161 // Common request header.
162 RequestHeader header = 1;
163
164 // The version of RMP to download from the RSI downloads site.
165 // The version must be in the format: <major version number>.<minor version number>.<revision number>
166 // An example version would be: "10.3.10"
167 optional string download_version = 2;
168
169 // The source to start a new RapidServer from.
170 // If set to a URI of an RMP zip archive, the zip will be downloaded and the new version of the
171 // RapidServer will be extracted to the directory specified in the destination field.
172 // If set to a zip file located on the local filesystem, the new version of the RapidServer will
173 // be extracted to the directory specified in the destination field.
174 // If set to a directory, a new instance of the RapidServer will be started from the given directory.
175 // This field is only used if the download version is not specified.
176 optional string source = 3;
177
178 // The directory to extract the contents of the zip archive to.
179 // If this field is not set or is an empty string, the contents will be extracted to the current directory.
180 // If the directory doesn't exist, the server will attempt to create it.
181 optional string destination = 4;
182}
183
184message ServerUpdateResponse {
185 // Common response header. Always check the response header for errors.
186 ResponseHeader header = 1;
187}
188
189message ServerRestartRequest {
190 // Common request header.
191 RequestHeader header = 1;
192
193 // The directory to restart the RapidServer from.
194 // If this field is not specified, the RapidServer will just start from
195 // the current directory.
196 optional string start_directory = 2;
197}
198
199message ServerRestartResponse {
200 // Common response header. Always check the response header for errors.
201 ResponseHeader header = 1;
202}
203
204message ServerReserveRequest {
205 // Common request header.
206 RequestHeader header = 1;
207
208 // Set this boolean to true to release the currently active reservation.
209 optional bool release = 2;
210
211 // Set this boolean to true to make a new reservation.
212 // This will override the existing reservation.
213 optional bool reserve = 3;
214}
215
216message ServerReserveResponse {
217 // Common response header. Always check the response header for errors.
218 ResponseHeader header = 1;
219
220 // The ticket containing information about the reservation session.
221 ServerReservation reservation = 2;
222}
223
224message ServerFileRequest {
225 // Common request header.
226 RequestHeader header = 1;
227
228 // The path to the file
229 string path = 2;
230}
231
232message FileChunk {
233 // The contents of the message
234 oneof content {
235 // The raw data to be sent.
236 bytes data = 1;
237
238 // The name to save the file with.
239 // When the server sees a FileChunk message with this field instead of the data field,
240 // it will finish its work with the previous file and begin to write to the file with this name instead.
241 string name = 2;
242 }
243}
244
245message ServerSendFileResponse {
246 // Common response header. Always check the response header for errors.
247 ResponseHeader header = 1;
248}
249
250message ServerFileExistsResponse {
251 // Common response header. Always check the response header for errors.
252 ResponseHeader header = 1;
253
254 // True if the file exists, false otherwise.
255 bool exists = 2;
256}
257
258message ServerDeleteFileResponse {
259 // Common response header. Always check the response header for errors.
260 ResponseHeader header = 1;
261}