mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
krata: move protos back into crate directory
This commit is contained in:
@ -7,18 +7,18 @@ fn main() -> Result<()> {
|
||||
.configure(
|
||||
&mut config,
|
||||
&[
|
||||
"../../proto/krata/v1/control.proto",
|
||||
"proto/krata/v1/control.proto",
|
||||
"proto/krata/internal/idm.proto",
|
||||
],
|
||||
&["../../proto/", "proto/"],
|
||||
&["proto/"],
|
||||
)?;
|
||||
tonic_build::configure().compile_with_config(
|
||||
config,
|
||||
&[
|
||||
"../../proto/krata/v1/control.proto",
|
||||
"proto/krata/v1/control.proto",
|
||||
"proto/krata/internal/idm.proto",
|
||||
],
|
||||
&["../../proto/", "proto/"],
|
||||
&["proto/"],
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
82
crates/krata/proto/krata/v1/common.proto
Normal file
82
crates/krata/proto/krata/v1/common.proto
Normal file
@ -0,0 +1,82 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package krata.v1.common;
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "dev.krata.proto.v1.common";
|
||||
option java_outer_classname = "CommonProto";
|
||||
|
||||
message Guest {
|
||||
string id = 1;
|
||||
GuestSpec spec = 2;
|
||||
GuestState state = 3;
|
||||
}
|
||||
|
||||
message GuestSpec {
|
||||
string name = 1;
|
||||
GuestImageSpec image = 2;
|
||||
uint32 vcpus = 3;
|
||||
uint64 mem = 4;
|
||||
GuestTaskSpec task = 5;
|
||||
repeated GuestSpecAnnotation annotations = 6;
|
||||
}
|
||||
|
||||
message GuestImageSpec {
|
||||
oneof image {
|
||||
GuestOciImageSpec oci = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message GuestOciImageSpec {
|
||||
string image = 1;
|
||||
}
|
||||
|
||||
message GuestTaskSpec {
|
||||
repeated GuestTaskSpecEnvVar environment = 1;
|
||||
repeated string command = 2;
|
||||
}
|
||||
|
||||
message GuestTaskSpecEnvVar {
|
||||
string key = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
message GuestSpecAnnotation {
|
||||
string key = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
message GuestState {
|
||||
GuestStatus status = 1;
|
||||
GuestNetworkState network = 2;
|
||||
GuestExitInfo exit_info = 3;
|
||||
GuestErrorInfo error_info = 4;
|
||||
uint32 domid = 5;
|
||||
}
|
||||
|
||||
enum GuestStatus {
|
||||
GUEST_STATUS_UNKNOWN = 0;
|
||||
GUEST_STATUS_STARTING = 1;
|
||||
GUEST_STATUS_STARTED = 2;
|
||||
GUEST_STATUS_EXITED = 3;
|
||||
GUEST_STATUS_DESTROYING = 4;
|
||||
GUEST_STATUS_DESTROYED = 5;
|
||||
GUEST_STATUS_FAILED = 6;
|
||||
}
|
||||
|
||||
message GuestNetworkState {
|
||||
string guest_ipv4 = 1;
|
||||
string guest_ipv6 = 2;
|
||||
string guest_mac = 3;
|
||||
string gateway_ipv4 = 4;
|
||||
string gateway_ipv6 = 5;
|
||||
string gateway_mac = 6;
|
||||
}
|
||||
|
||||
message GuestExitInfo {
|
||||
int32 code = 1;
|
||||
}
|
||||
|
||||
message GuestErrorInfo {
|
||||
string message = 1;
|
||||
}
|
67
crates/krata/proto/krata/v1/control.proto
Normal file
67
crates/krata/proto/krata/v1/control.proto
Normal file
@ -0,0 +1,67 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package krata.v1.control;
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "dev.krata.proto.v1.control";
|
||||
option java_outer_classname = "ControlProto";
|
||||
|
||||
import "krata/v1/common.proto";
|
||||
|
||||
service ControlService {
|
||||
rpc CreateGuest(CreateGuestRequest) returns (CreateGuestReply);
|
||||
rpc DestroyGuest(DestroyGuestRequest) returns (DestroyGuestReply);
|
||||
rpc ResolveGuest(ResolveGuestRequest) returns (ResolveGuestReply);
|
||||
rpc ListGuests(ListGuestsRequest) returns (ListGuestsReply);
|
||||
rpc ConsoleData(stream ConsoleDataRequest) returns (stream ConsoleDataReply);
|
||||
rpc WatchEvents(WatchEventsRequest) returns (stream WatchEventsReply);
|
||||
}
|
||||
|
||||
message CreateGuestRequest {
|
||||
krata.v1.common.GuestSpec spec = 1;
|
||||
}
|
||||
|
||||
message CreateGuestReply {
|
||||
string guest_id = 1;
|
||||
}
|
||||
|
||||
message DestroyGuestRequest {
|
||||
string guest_id = 1;
|
||||
}
|
||||
|
||||
message DestroyGuestReply {}
|
||||
|
||||
message ResolveGuestRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ResolveGuestReply {
|
||||
krata.v1.common.Guest guest = 1;
|
||||
}
|
||||
|
||||
message ListGuestsRequest {}
|
||||
|
||||
message ListGuestsReply {
|
||||
repeated krata.v1.common.Guest guests = 1;
|
||||
}
|
||||
|
||||
message ConsoleDataRequest {
|
||||
string guest_id = 1;
|
||||
bytes data = 2;
|
||||
}
|
||||
|
||||
message ConsoleDataReply {
|
||||
bytes data = 1;
|
||||
}
|
||||
|
||||
message WatchEventsRequest {}
|
||||
|
||||
message WatchEventsReply {
|
||||
oneof event {
|
||||
GuestChangedEvent guest_changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message GuestChangedEvent {
|
||||
krata.v1.common.Guest guest = 1;
|
||||
}
|
Reference in New Issue
Block a user