Skip to content

Commit 9db1cf4

Browse files
committed
driver(external): proto file init
Signed-off-by: Ansuman Sahoo <[email protected]>
1 parent dac2cff commit 9db1cf4

File tree

1 file changed

+144
-0
lines changed

1 file changed

+144
-0
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
// [WIP]: Please do not review this file yet.
2+
3+
syntax = "proto3";
4+
5+
package driver;
6+
7+
option go_package = "github.com/lima-vm/lima/pkg/driver/external/proto";
8+
9+
import "google/protobuf/empty.proto";
10+
11+
service Driver {
12+
rpc Validate(google.protobuf.Empty) returns (ValidateResponse);
13+
rpc Initialize(google.protobuf.Empty) returns (InitializeResponse);
14+
rpc CreateDisk(google.protobuf.Empty) returns (CreateDiskResponse);
15+
rpc Start(google.protobuf.Empty) returns (StartResponse);
16+
rpc Stop(google.protobuf.Empty) returns (StopResponse);
17+
18+
rpc Name(google.protobuf.Empty) returns (NameResponse);
19+
rpc SetConfig(SetConfigRequest) returns (SetConfigResponse);
20+
21+
rpc GetVSockPort(google.protobuf.Empty) returns (GetVSockPortResponse);
22+
rpc GetVirtioPort(google.protobuf.Empty) returns (GetVirtioPortResponse);
23+
}
24+
25+
message Empty {}
26+
27+
message InstanceConfig {
28+
string id = 1;
29+
string name = 2;
30+
string dir = 3;
31+
string arch = 4;
32+
string cpuType = 5;
33+
repeated string rosetta = 6;
34+
int32 cpus = 7;
35+
string memory = 8;
36+
string disk = 9;
37+
string kernel = 10;
38+
string initrd = 11;
39+
bool headless = 12;
40+
bool mountHostUsers = 13;
41+
bool enableSharing = 14;
42+
string ssh = 15;
43+
string sshLocalPort = 16;
44+
repeated Mount mounts = 17;
45+
repeated Port ports = 18;
46+
repeated Network networks = 19;
47+
string containerd = 20;
48+
string containerdUser = 21;
49+
string containerdNamespace = 22;
50+
string vmType = 23;
51+
repeated string requirements = 24;
52+
repeated string firmware = 25;
53+
repeated AdditionalDisk additionalDisks = 26;
54+
ProxyCommand proxyCommand = 27;
55+
}
56+
57+
message Mount {
58+
string location = 1;
59+
string mountPoint = 2;
60+
bool writable = 3;
61+
string sshfs = 4;
62+
int32 ninep = 5;
63+
}
64+
65+
message Port {
66+
string guestPort = 1;
67+
string hostPort = 2;
68+
string proto = 3;
69+
}
70+
71+
message Network {
72+
string lima = 1;
73+
string socket_vmnet = 2;
74+
}
75+
76+
message AdditionalDisk {
77+
string location = 1;
78+
bool writable = 2;
79+
string size = 3;
80+
}
81+
82+
message ProxyCommand {
83+
string command = 1;
84+
}
85+
86+
message ValidateResponse {
87+
bool valid = 1;
88+
string error = 2;
89+
}
90+
91+
message InitializeResponse {
92+
bool success = 1;
93+
string error = 2;
94+
}
95+
96+
message CreateDiskResponse {
97+
bool success = 1;
98+
string error = 2;
99+
}
100+
101+
message StartResponse {
102+
bool success = 1;
103+
string error = 2;
104+
}
105+
106+
message StopResponse {
107+
bool success = 1;
108+
string error = 2;
109+
}
110+
111+
message RegisterResponse {
112+
bool success = 1;
113+
string error = 2;
114+
}
115+
116+
117+
message UnregisterResponse {
118+
bool success = 1;
119+
string error = 2;
120+
}
121+
122+
message NameResponse {
123+
string name = 1;
124+
}
125+
126+
message SetConfigRequest {
127+
bytes instance_config_json = 1;
128+
int32 ssh_local_port = 3;
129+
}
130+
131+
message SetConfigResponse {
132+
bool success = 1;
133+
string error = 2;
134+
}
135+
136+
137+
message GetVSockPortResponse {
138+
int32 port = 1;
139+
}
140+
141+
142+
message GetVirtioPortResponse {
143+
string port = 1;
144+
}

0 commit comments

Comments
 (0)