mirror of
https://github.com/edera-dev/krata.git
synced 2025-09-10 15:21:31 +00:00
263 lines
6.0 KiB
Protocol Buffer
263 lines
6.0 KiB
Protocol Buffer
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/idm/transport.proto";
|
|
import "krata/v1/common.proto";
|
|
|
|
service ControlService {
|
|
rpc HostStatus(HostStatusRequest) returns (HostStatusReply);
|
|
rpc SnoopIdm(SnoopIdmRequest) returns (stream SnoopIdmReply);
|
|
rpc GetHostCpuTopology(GetHostCpuTopologyRequest) returns (GetHostCpuTopologyReply);
|
|
rpc SetHostPowerManagementPolicy(SetHostPowerManagementPolicyRequest) returns (SetHostPowerManagementPolicyReply);
|
|
|
|
rpc ListDevices(ListDevicesRequest) returns (ListDevicesReply);
|
|
|
|
rpc PullImage(PullImageRequest) returns (stream PullImageReply);
|
|
|
|
rpc CreateZone(CreateZoneRequest) returns (CreateZoneReply);
|
|
rpc DestroyZone(DestroyZoneRequest) returns (DestroyZoneReply);
|
|
|
|
rpc ResolveZoneId(ResolveZoneIdRequest) returns (ResolveZoneIdReply);
|
|
|
|
rpc GetZone(GetZoneRequest) returns (GetZoneReply);
|
|
|
|
rpc UpdateZoneResources(UpdateZoneResourcesRequest) returns (UpdateZoneResourcesReply);
|
|
|
|
rpc ListZones(ListZonesRequest) returns (ListZonesReply);
|
|
|
|
rpc AttachZoneConsole(stream ZoneConsoleRequest) returns (stream ZoneConsoleReply);
|
|
rpc ExecInsideZone(stream ExecInsideZoneRequest) returns (stream ExecInsideZoneReply);
|
|
rpc ReadZoneMetrics(ReadZoneMetricsRequest) returns (ReadZoneMetricsReply);
|
|
|
|
rpc WatchEvents(WatchEventsRequest) returns (stream WatchEventsReply);
|
|
|
|
rpc ReadHypervisorConsole(ReadHypervisorConsoleRequest) returns (ReadHypervisorConsoleReply);
|
|
}
|
|
|
|
message HostStatusRequest {}
|
|
|
|
message HostStatusReply {
|
|
string host_uuid = 1;
|
|
uint32 host_domid = 2;
|
|
string krata_version = 3;
|
|
}
|
|
|
|
message CreateZoneRequest {
|
|
krata.v1.common.ZoneSpec spec = 1;
|
|
}
|
|
|
|
message CreateZoneReply {
|
|
string zone_id = 1;
|
|
}
|
|
|
|
message DestroyZoneRequest {
|
|
string zone_id = 1;
|
|
}
|
|
|
|
message DestroyZoneReply {}
|
|
|
|
message ResolveZoneIdRequest {
|
|
string name = 1;
|
|
}
|
|
|
|
message ResolveZoneIdReply {
|
|
string zone_id = 1;
|
|
}
|
|
|
|
message GetZoneRequest {
|
|
string zone_id = 1;
|
|
}
|
|
|
|
message GetZoneReply {
|
|
krata.v1.common.Zone zone = 1;
|
|
}
|
|
|
|
message ListZonesRequest {}
|
|
|
|
message ListZonesReply {
|
|
repeated krata.v1.common.Zone zones = 1;
|
|
}
|
|
|
|
message ExecInsideZoneRequest {
|
|
string zone_id = 1;
|
|
krata.v1.common.ZoneTaskSpec task = 2;
|
|
bytes stdin = 3;
|
|
bool stdin_closed = 4;
|
|
}
|
|
|
|
message ExecInsideZoneReply {
|
|
bool exited = 1;
|
|
string error = 2;
|
|
int32 exit_code = 3;
|
|
bytes stdout = 4;
|
|
bytes stderr = 5;
|
|
}
|
|
|
|
message ZoneConsoleRequest {
|
|
string zone_id = 1;
|
|
bytes data = 2;
|
|
}
|
|
|
|
message ZoneConsoleReply {
|
|
bytes data = 1;
|
|
}
|
|
|
|
message WatchEventsRequest {}
|
|
|
|
message WatchEventsReply {
|
|
oneof event {
|
|
ZoneChangedEvent zone_changed = 1;
|
|
}
|
|
}
|
|
|
|
message ZoneChangedEvent {
|
|
krata.v1.common.Zone zone = 1;
|
|
}
|
|
|
|
message ReadZoneMetricsRequest {
|
|
string zone_id = 1;
|
|
}
|
|
|
|
message ReadZoneMetricsReply {
|
|
krata.v1.common.ZoneMetricNode root = 1;
|
|
}
|
|
|
|
message SnoopIdmRequest {}
|
|
|
|
message SnoopIdmReply {
|
|
string from = 1;
|
|
string to = 2;
|
|
krata.idm.transport.IdmTransportPacket packet = 3;
|
|
}
|
|
|
|
message ImageProgress {
|
|
ImageProgressPhase phase = 1;
|
|
repeated ImageProgressLayer layers = 2;
|
|
ImageProgressIndication indication = 3;
|
|
}
|
|
|
|
enum ImageProgressPhase {
|
|
IMAGE_PROGRESS_PHASE_UNKNOWN = 0;
|
|
IMAGE_PROGRESS_PHASE_STARTED = 1;
|
|
IMAGE_PROGRESS_PHASE_RESOLVING = 2;
|
|
IMAGE_PROGRESS_PHASE_RESOLVED = 3;
|
|
IMAGE_PROGRESS_PHASE_CONFIG_DOWNLOAD = 4;
|
|
IMAGE_PROGRESS_PHASE_LAYER_DOWNLOAD = 5;
|
|
IMAGE_PROGRESS_PHASE_ASSEMBLE = 6;
|
|
IMAGE_PROGRESS_PHASE_PACK = 7;
|
|
IMAGE_PROGRESS_PHASE_COMPLETE = 8;
|
|
}
|
|
|
|
message ImageProgressLayer {
|
|
string id = 1;
|
|
ImageProgressLayerPhase phase = 2;
|
|
ImageProgressIndication indication = 3;
|
|
}
|
|
|
|
enum ImageProgressLayerPhase {
|
|
IMAGE_PROGRESS_LAYER_PHASE_UNKNOWN = 0;
|
|
IMAGE_PROGRESS_LAYER_PHASE_WAITING = 1;
|
|
IMAGE_PROGRESS_LAYER_PHASE_DOWNLOADING = 2;
|
|
IMAGE_PROGRESS_LAYER_PHASE_DOWNLOADED = 3;
|
|
IMAGE_PROGRESS_LAYER_PHASE_EXTRACTING = 4;
|
|
IMAGE_PROGRESS_LAYER_PHASE_EXTRACTED = 5;
|
|
}
|
|
|
|
message ImageProgressIndication {
|
|
oneof indication {
|
|
ImageProgressIndicationBar bar = 1;
|
|
ImageProgressIndicationSpinner spinner = 2;
|
|
ImageProgressIndicationHidden hidden = 3;
|
|
ImageProgressIndicationCompleted completed = 4;
|
|
}
|
|
}
|
|
|
|
message ImageProgressIndicationBar {
|
|
string message = 1;
|
|
uint64 current = 2;
|
|
uint64 total = 3;
|
|
bool is_bytes = 4;
|
|
}
|
|
|
|
message ImageProgressIndicationSpinner {
|
|
string message = 1;
|
|
}
|
|
|
|
message ImageProgressIndicationHidden {}
|
|
|
|
message ImageProgressIndicationCompleted {
|
|
string message = 1;
|
|
uint64 total = 2;
|
|
bool is_bytes = 3;
|
|
}
|
|
|
|
message PullImageRequest {
|
|
string image = 1;
|
|
krata.v1.common.OciImageFormat format = 2;
|
|
bool overwrite_cache = 3;
|
|
bool update = 4;
|
|
}
|
|
|
|
message PullImageReply {
|
|
ImageProgress progress = 1;
|
|
string digest = 2;
|
|
krata.v1.common.OciImageFormat format = 3;
|
|
}
|
|
|
|
message DeviceInfo {
|
|
string name = 1;
|
|
bool claimed = 2;
|
|
string owner = 3;
|
|
}
|
|
|
|
message ListDevicesRequest {}
|
|
|
|
message ListDevicesReply {
|
|
repeated DeviceInfo devices = 1;
|
|
}
|
|
|
|
enum HostCpuTopologyClass {
|
|
HOST_CPU_TOPOLOGY_CLASS_STANDARD = 0;
|
|
HOST_CPU_TOPOLOGY_CLASS_PERFORMANCE = 1;
|
|
HOST_CPU_TOPOLOGY_CLASS_EFFICIENCY = 2;
|
|
}
|
|
|
|
message HostCpuTopologyInfo {
|
|
uint32 core = 1;
|
|
uint32 socket = 2;
|
|
uint32 node = 3;
|
|
uint32 thread = 4;
|
|
HostCpuTopologyClass class = 5;
|
|
}
|
|
|
|
message GetHostCpuTopologyRequest {}
|
|
|
|
message GetHostCpuTopologyReply {
|
|
repeated HostCpuTopologyInfo cpus = 1;
|
|
}
|
|
|
|
message SetHostPowerManagementPolicyRequest {
|
|
string scheduler = 1;
|
|
bool smt_awareness = 2;
|
|
}
|
|
|
|
message SetHostPowerManagementPolicyReply {}
|
|
|
|
message UpdateZoneResourcesRequest {
|
|
string zone_id = 1;
|
|
krata.v1.common.ZoneResourceSpec resources = 2;
|
|
}
|
|
|
|
message UpdateZoneResourcesReply {}
|
|
|
|
message ReadHypervisorConsoleRequest {}
|
|
|
|
message ReadHypervisorConsoleReply {
|
|
string data = 1;
|
|
}
|