• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2018 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto3";
6option optimize_for = LITE_RUNTIME;
7
8// This file defines messages used for interacting directly with containers
9// running inside of a VM.
10package vm_tools.cicerone;
11option go_package = "vm_cicerone_proto";
12
13// Message sent to cicerone when a VM has started up. This is just for
14// tracking purposes by cicerone.
15message NotifyVmStartedRequest {
16  // Name of the VM.
17  string vm_name = 1;
18
19  // The owner of the VM.
20  string owner_id = 2;
21
22  // The IPv4 subnet for containers within the VM in network byte order.
23  uint32 container_ipv4_subnet = 3;
24
25  // The netmask for the IPv4 subnet for containers within the VM in network
26  // byte order.
27  uint32 container_ipv4_netmask = 4;
28
29  // The IPv4 address of the VM in network byte order.
30  uint32 ipv4_address = 5;
31
32  // The virtual socket context id assigned to the VM.
33  uint32 cid = 6;
34}
35
36// Message sent to cicerone when a VM stopped or failed to complete startup.
37// This is just for tracking purposes by cicerone.
38message NotifyVmStoppedRequest {
39  // Name of the VM.
40  string vm_name = 1;
41
42  // The owner of the VM.
43  string owner_id = 2;
44}
45
46// Message sent to cicerone when requesting a token for linking to a container
47// that is going to be started for a VM.
48message ContainerTokenRequest {
49  // Name of the VM.
50  string vm_name = 1;
51
52  // Name of the container within the VM.
53  string container_name = 2;
54
55  // The owner of the VM.
56  string owner_id = 3;
57}
58
59// Reply to the GetContainerToken method.
60message ContainerTokenResponse {
61  // A token that should be passed into the container to identify itself. This
62  // token will be the empty string if the request was invalid.
63  string container_token = 1;
64}
65
66// Message sent to cicerone to check whether or not a specific container is
67// currently running.
68message IsContainerRunningRequest {
69  // Name of the VM.
70  string vm_name = 1;
71
72  // Name of the container within the VM.
73  string container_name = 2;
74
75  // The owner of the VM.
76  string owner_id = 3;
77}
78
79// Reply to the IsContainerRunning method.
80message IsContainerRunningResponse {
81  // True if the container is running, false otherwise.
82  bool container_running = 1;
83}
84
85// Message used in the signal for when tremplin has started.
86message TremplinStartedSignal {
87  // Name of the VM the container is in.
88  string vm_name = 1;
89
90  // The owner of the VM.
91  string owner_id = 2;
92}
93
94// Message used in the signal for when a container has started up.
95message ContainerStartedSignal {
96  // Name of the VM the container is in.
97  string vm_name = 1;
98
99  // Name of the container within the VM.
100  string container_name = 2;
101
102  // The owner of the VM and container.
103  string owner_id = 3;
104}
105
106// Message used in the signal for when a container has shut down.
107message ContainerShutdownSignal {
108  // Name of the VM the container is in.
109  string vm_name = 1;
110
111  // Name of the container within the VM.
112  string container_name = 2;
113
114  // The owner of the VM and container.
115  string owner_id = 3;
116}
117
118// Request to launch on application in the specified VM/container. Used with the
119// LaunchContainerApplication D-Bus message into vm_concierge.
120message LaunchContainerApplicationRequest {
121  // Display scaling of the app windows.
122  enum DisplayScaling {
123    // Default scaling.
124    UNSCALED = 0;
125    // Windows scaled. Used to scale up older app windows that don't show well
126    // with HiDPI display otherwise.
127    SCALED = 1;
128  }
129
130  // Name of the VM to target.
131  string vm_name = 1;
132
133  // Name of the container within the VM to target, if empty the default
134  // container name will be used.
135  string container_name = 2;
136
137  // ID of the application to launch, should map to the desktop_file_id that
138  // is in the application list sent back from the container.
139  string desktop_file_id = 3;
140
141  // The owner of the vm and container.
142  string owner_id = 4;
143
144  // Files to pass as arguments when launching the application, if any, given
145  // as absolute paths within the container's filesystem.
146  repeated string files = 5;
147
148  // Display scaling requested.
149  DisplayScaling display_scaling = 6;
150}
151
152// Response sent back by vm_concierge when it receives a
153// LaunchContainerApplication D-Bus message.
154message LaunchContainerApplicationResponse {
155  // If true, the requested application launched successfully.
156  bool success = 1;
157
158  // The failure_reason if the requested application could not be started.
159  string failure_reason = 2;
160}
161
162// Request to get application icons in the specified VM/container. Used with the
163// GetContainerAppIcon D-Bus message into vm_concierge.
164message ContainerAppIconRequest {
165  // Name of the VM to target.
166  string vm_name = 1;
167
168  // Name of the container within the VM to target, if empty the default
169  // container name will be used.
170  string container_name = 2;
171
172  // IDs of the application to get icons for, should map to the desktop_file_id
173  // that is in the application list sent back from the container.
174  repeated string desktop_file_ids = 3;
175
176  // The icon size with both its height and width equal to this number.
177  int32 size = 4;
178
179  // The target scale of this icon. This is the scale factor at which this icon
180  // is designed to be used.
181  int32 scale = 5;
182
183  // The owner of the VM and container.
184  string owner_id = 6;
185}
186
187// One desktop file ID with its icon.
188message DesktopIcon {
189  string desktop_file_id = 1;
190  bytes icon = 2;
191}
192
193// Response sent back by vm_concierge when it receives a
194// GetContainerAppIcon D-Bus message.
195// Some desktop_file_id may not have an icon.
196message ContainerAppIconResponse {
197  repeated DesktopIcon icons = 1;
198}
199
200// Launch vshd request.
201message LaunchVshdRequest {
202  // Name of the VM to target.
203  string vm_name = 1;
204
205  // Name of the container within the VM to target.
206  string container_name = 2;
207
208  // The port for vshd to connect to.
209  uint32 port = 3;
210
211  // The owner of the VM and container.
212  string owner_id = 4;
213}
214
215// Response sent back by vm_cicerone when it receives a LaunchVshd
216// call.
217message LaunchVshdResponse {
218  bool success = 1;
219
220  string failure_reason = 2;
221}
222
223// Request to get information about a Linux package file in the container.
224message LinuxPackageInfoRequest {
225  // Name of the VM to target.
226  string vm_name = 1;
227
228  // Name of the container within the VM to target.
229  string container_name = 2;
230
231  // The owner of the VM and container.
232  string owner_id = 3;
233
234  // Path to the package file (e.g. .deb) in the container's filesystem.
235  string file_path = 4;
236}
237
238// Response sent back from a GetLinuxPackageInfo call.
239message LinuxPackageInfoResponse {
240  // True if the file was successfully parsed and the other fields are valid.
241  bool success = 1;
242
243  // Contains a textual reason for the failure in case success is false.
244  string failure_reason = 2;
245
246  // The package identifier is in the form of a semicolon delimited string of
247  // the format: name;version;arch;data
248  // name, version and arch are as expected. data is somewhat variant and refers
249  // to the state of the package as well as potentially remote repository
250  // information.
251  string package_id = 3;
252
253  // The license associated with the package. So far only the value of
254  // 'unknown' has been observed for this field.
255  string license = 4;
256
257  // The description of the package, can be a multi-line text string.
258  string description = 5;
259
260  // The URL for the homepage of the project.
261  string project_url = 6;
262
263  // Size of the package file in bytes.
264  uint64 size = 7;
265
266  // Usually more of a title for a package, but sometimes less descriptive
267  // than that.
268  string summary = 8;
269}
270
271// Request to install a Linux package file in the container.
272message InstallLinuxPackageRequest {
273  // Name of the VM to target.
274  string vm_name = 1;
275
276  // Name of the container within the VM to target.
277  string container_name = 2;
278
279  // The owner of the VM and container.
280  string owner_id = 3;
281
282  // Path to the package file (e.g. .deb) in the container's filesystem.
283  string file_path = 4;
284}
285
286// Response sent back from a InstallLinuxPackage call.
287message InstallLinuxPackageResponse {
288  enum Status {
289    // Install process was successfully started, all further updates will be
290    // sent via the InstallLinuxPackageProgress signal.
291    STARTED = 0;
292
293    // Failed to start up for a general reason, specific details are given in
294    // failure_reason.
295    FAILED = 1;
296
297    // Indicates another install is already in process, this one will not be
298    // started.
299    INSTALL_ALREADY_ACTIVE = 2;
300  }
301  Status status = 1;
302
303  // Contains a textual reason for the failure in case of a FAILED status.
304  string failure_reason = 2;
305}
306
307// Message used in a signal for updates on Linux package installations.
308message InstallLinuxPackageProgressSignal {
309  // Name of the VM the container is in.
310  string vm_name = 1;
311
312  // Name of the container within the VM.
313  string container_name = 2;
314
315  // The owner of the VM and container.
316  string owner_id = 3;
317
318  enum Status {
319    // Install has completed and was successful. No further signals will be
320    // sent after this one.
321    SUCCEEDED = 0;
322
323    // Install failed to complete, the specific reason will be in
324    // failure_details. No further signals will be sent after this one.
325    FAILED = 1;
326
327    // This is sent periodically while packages are being downloaded.
328    DOWNLOADING = 2;
329
330    // This is sent periodically during the general installation phase for
331    // package and dependency installation.
332    INSTALLING = 3;
333  }
334
335  // Current status of the installation progress.
336  Status status = 4;
337
338  // Overall percentage progress.
339  uint32 progress_percent = 5;
340
341  // Details relating to the failure state. This can be a multi-line string in
342  // some cases (that's how it comes out of PackageKit, for example in the case
343  // of an unsatisfiable dependency).
344  string failure_details = 6;
345}
346
347
348// Request for creating an LXD container.
349message CreateLxdContainerRequest {
350  // Name of the VM to target.
351  string vm_name = 1;
352
353  // Name of the container to start within the VM.
354  string container_name = 2;
355
356  // The owner of the VM and container.
357  string owner_id = 3;
358
359  // LXD image server URL. Only simplestreams is supported for now.
360  string image_server = 4;
361
362  // LXD image alias.
363  string image_alias = 5;
364}
365
366// Response for creating an LXD container.
367message CreateLxdContainerResponse {
368  enum Status {
369    // The status of creating the container is unknown.
370    UNKNOWN = 0;
371
372    // The container is now being created. An LxdContainerCreated signal will
373    // relay the final result.
374    CREATING = 1;
375
376    // A container with this name already exists.
377    EXISTS = 2;
378
379    // The container could not be created.
380    FAILED = 3;
381  }
382
383  // Container creation status.
384  Status status = 1;
385
386  // The failure_reason if the container could not be created.
387  string failure_reason = 2;
388}
389
390// Message used in the LxdContainerCreated signal for the outcome of an
391// LxdCreateContainer message.
392message LxdContainerCreatedSignal {
393  // Name of the VM the container is in.
394  string vm_name = 1;
395
396  // Name of the container within the VM.
397  string container_name = 2;
398
399  // The owner of the VM and container.
400  string owner_id = 3;
401
402  enum Status {
403    // The container creation status is unknown.
404    UNKNOWN = 0;
405
406    // The container was successfully created.
407    CREATED = 1;
408
409    // The container download timed out.
410    DOWNLOAD_TIMED_OUT = 2;
411
412    // The container creation was cancelled.
413    CANCELLED = 3;
414
415    // The container creation failed for an unspecified reason.
416    FAILED = 4;
417  }
418
419  // Container creation status.
420  Status status = 4;
421
422  // The failure_reason if the container was not successfully created.
423  string failure_reason = 5;
424}
425
426// Message used in the signal for when a container is downloading.
427message LxdContainerDownloadingSignal {
428  // Name of the VM the container is in.
429  string vm_name = 1;
430
431  // Name of the container within the VM.
432  string container_name = 2;
433
434  // The owner of the VM and container.
435  string owner_id = 3;
436
437  // Container download progress, as a percentage.
438  int32 download_progress = 4;
439}
440
441// Request for starting an LXD container.
442message StartLxdContainerRequest {
443  // Name of the VM to target.
444  string vm_name = 1;
445
446  // Name of the container to start within the VM.
447  string container_name = 2;
448
449  // The owner of the VM and container.
450  string owner_id = 3;
451}
452
453// Response for starting an LXD container.
454message StartLxdContainerResponse {
455  enum Status {
456    // The status of starting the container is unknown.
457    UNKNOWN = 0;
458
459    // The container has started.
460    STARTED = 1;
461
462    // The container was already running.
463    RUNNING = 2;
464
465    // The container could not be started.
466    FAILED = 3;
467  }
468
469  // Container startup status.
470  Status status = 1;
471
472  // The failure_reason if the container could not be started.
473  string failure_reason = 2;
474}
475
476// Request for getting the primary user for an LXD container.
477message GetLxdContainerUsernameRequest {
478  // Name of the VM to target.
479  string vm_name = 1;
480
481  // Name of the container to get the primary user for.
482  string container_name = 2;
483
484  // The owner of the VM and container.
485  string owner_id = 3;
486}
487
488// Response for getting the primary user for an LXD container.
489message GetLxdContainerUsernameResponse {
490  enum Status {
491    // The status is unknown.
492    UNKNOWN = 0;
493
494    // The primary username is stored in the username field.
495    SUCCESS = 1;
496
497    // A container with the specified name doesn't exist.
498    CONTAINER_NOT_FOUND = 2;
499
500    // The container is not running, so the username could not be found.
501    CONTAINER_NOT_RUNNING = 3;
502
503    // The primary user doesn't exist.
504    USER_NOT_FOUND = 4;
505
506    // Some part of the operation failed.
507    FAILED = 5;
508  }
509
510  // Status of getting the primary username.
511  Status status = 1;
512
513  // The primary username of the container, if successful.
514  string username = 2;
515
516  // The failure_reason if the username could not be retrieved.
517  string failure_reason = 3;
518}
519// Request for setting up the user for an LXD container.
520message SetUpLxdContainerUserRequest {
521  // Name of the VM to target.
522  string vm_name = 1;
523
524  // Name of the container to start within the VM.
525  string container_name = 2;
526
527  // The owner of the VM and container.
528  string owner_id = 3;
529
530  // Username for the first user in the container.
531  string container_username = 4;
532}
533
534// Response for setting up the user on an LXD container.
535message SetUpLxdContainerUserResponse {
536  enum Status {
537    // The status of setting up the user is unknown.
538    UNKNOWN = 0;
539
540    // The user has been set up sucessfully.
541    SUCCESS = 1;
542
543    // The user already exists.
544    EXISTS = 2;
545
546    // Setting up the user failed.
547    FAILED = 3;
548  }
549
550  // Status of setting up the user.
551  Status status = 1;
552
553  // The failure_reason if the user was not set up successfully.
554  string failure_reason = 2;
555}
556
557// Request for debug information about virtual machine and container state.
558message GetDebugInformationRequest {
559}
560
561// Response for debug information about virtual machine and container state.
562message GetDebugInformationResponse {
563  // Debug information about virtual machine and container state in arbitrary format.
564  string debug_information = 1;
565}
566