Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/pkg/driver/external/driver.proto
2611 views
syntax = "proto3";

import "google/protobuf/empty.proto";

option go_package = "github.com/lima-vm/lima/v2/pkg/driver/external";

service Driver {
  rpc Validate(google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc Create(google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc CreateDisk(google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc Start(google.protobuf.Empty) returns (stream StartResponse);
  rpc Stop(google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc Delete(google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc BootScripts(google.protobuf.Empty) returns (BootScriptsResponse);

  rpc RunGUI(google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc ChangeDisplayPassword(ChangeDisplayPasswordRequest) returns (google.protobuf.Empty);
  rpc GetDisplayConnection(google.protobuf.Empty) returns (GetDisplayConnectionResponse);

  rpc CreateSnapshot(CreateSnapshotRequest) returns (google.protobuf.Empty);
  rpc ApplySnapshot(ApplySnapshotRequest) returns (google.protobuf.Empty);
  rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty);
  rpc ListSnapshots(google.protobuf.Empty) returns (ListSnapshotsResponse);

  rpc ForwardGuestAgent(google.protobuf.Empty) returns (ForwardGuestAgentResponse);
  rpc GuestAgentConn(google.protobuf.Empty) returns (google.protobuf.Empty);

  rpc Configure(SetConfigRequest) returns (google.protobuf.Empty);
  rpc Info(google.protobuf.Empty) returns (InfoResponse);
  rpc SSHAddress(google.protobuf.Empty) returns (SSHAddressResponse);

  // AdditionalSetupForSSH provides additional setup required for SSH connection.
  // It is called after VM is started, before first SSH connection.
  rpc AdditionalSetupForSSH(google.protobuf.Empty) returns (google.protobuf.Empty);
}

message BootScriptsResponse {
  map<string, bytes> scripts = 1;
}

message SSHAddressResponse {
  string address = 1;
}

message InfoResponse{
  bytes info_json = 1;
}

// StartResponse is a streamed response for Start() RPC. It tries to mimic
// errChan from pkg/driver/driver.go. The server sends an initial response 
// with success=true when Start() is initiated. If errors occur, they are 
// sent as success=false with the error field populated. When the error channel 
// closes, a final success=true message is sent.
message StartResponse {
  bool success = 1;
  string error = 2;
}

message SetConfigRequest {
  bytes instance_config_json = 1;
}

message ChangeDisplayPasswordRequest {
  string password = 1;
}

message GetDisplayConnectionResponse {
  string connection = 1;
}

message CreateSnapshotRequest {
  string tag = 1;
}

message ApplySnapshotRequest {
  string tag = 1;
}

message DeleteSnapshotRequest {
  string tag = 1;
}

message ListSnapshotsResponse {
  string snapshots = 1;
}

message ForwardGuestAgentResponse {
  bool should_forward = 1;
}