Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 53 additions & 4 deletions protect/control/v1/common.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
syntax = "proto3";

Check failure on line 1 in protect/control/v1/common.proto

View workflow job for this annotation

GitHub Actions / buf

Previously present message "DeviceInfo" was deleted from file.

package protect.control.v1;

Expand Down Expand Up @@ -152,7 +152,7 @@
}

message DeviceReferenceSpec {
string name = 1;
string id = 1;
}

message WorkloadBlockDeviceSpec {
Expand Down Expand Up @@ -492,10 +492,59 @@
bool is_bytes = 3;
}

message DeviceInfo {
message PciDeviceSpec {
string location = 1;
bool permissive = 2;
bool msi_translate = 3;
bool power_management = 4;
PciDeviceRdmReservePolicy rdm_reserve_policy = 5;
}

enum PciDeviceRdmReservePolicy {
PCI_DEVICE_RDM_RESERVE_POLICY_UNKNOWN = 0;
PCI_DEVICE_RDM_RESERVE_POLICY_STRICT = 1;
PCI_DEVICE_RDM_RESERVE_POLICY_RELAXED = 2;
}

message BlockDeviceSpec {
string device_path = 1;
}

message DeviceSpec {
string name = 1;
bool claimed = 2;
string owner_zone = 3;
oneof device_type {
PciDeviceSpec pci = 2;
BlockDeviceSpec block = 3;
}
repeated string modules = 4;
repeated KernelModuleParameter module_parameters = 5;
}

enum DeviceState {
DEVICE_STATE_UNKNOWN = 0;
DEVICE_STATE_AVAILABLE = 1;
DEVICE_STATE_TAINTED = 2;
DEVICE_STATE_USED = 3;
DEVICE_STATE_DESTROYING = 4;
DEVICE_STATE_DESTROYED = 5;
DEVICE_STATE_CREATING = 6;
DEVICE_STATE_FAILED = 7;
}

message DeviceStatus {
DeviceState state = 1;
string zone_id = 2;
DeviceErrorStatus error_status = 3;
}

message DeviceErrorStatus {
string message = 1;
}

message Device {
string id = 1;
DeviceSpec spec = 2;
DeviceStatus status = 3;
}

message ZoneScratchDiskSpec {
Expand Down
50 changes: 49 additions & 1 deletion protect/control/v1/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
rpc SnoopIdm(SnoopIdmRequest) returns (stream SnoopIdmReply);
rpc GetHostCpuTopology(GetHostCpuTopologyRequest) returns (GetHostCpuTopologyReply);

rpc CreateDevice(CreateDeviceRequest) returns (CreateDeviceReply);
rpc ListDevices(ListDevicesRequest) returns (ListDevicesReply);
rpc GetDevice(GetDeviceRequest) returns (GetDeviceReply);
rpc UpdateDeviceState(UpdateDeviceStateRequest) returns (UpdateDeviceStateReply);
rpc DestroyDevice(DestroyDeviceRequest) returns (DestroyDeviceReply);
rpc ResolveDeviceIds(ResolveDeviceIdsRequest) returns (ResolveDeviceIdsReply);

rpc CreateNetworkReservation(CreateNetworkReservationRequest) returns (CreateNetworkReservationReply);
rpc DestroyNetworkReservation(DestroyNetworkReservationRequest) returns (DestroyNetworkReservationReply);
Expand Down Expand Up @@ -73,6 +78,13 @@
optional string protect_branch = 11;
}

message UpdateDeviceStateRequest {
string device_id = 1;
DeviceState state = 2;
}

message UpdateDeviceStateReply {}

message CreateZoneRequest {
ZoneSpec spec = 1;
}
Expand Down Expand Up @@ -398,6 +410,7 @@
oneof event {
ZoneChangedEvent zone_changed = 1;
WorkloadChangedEvent workload_changed = 2;
DeviceChangedEvent device_changed = 3;
}
}

Expand All @@ -409,6 +422,10 @@
Workload workload = 1;
}

message DeviceChangedEvent {
Device device = 1;
}

message ReadZoneMetricsRequest {
string zone_id = 1;
}
Expand Down Expand Up @@ -479,9 +496,10 @@

message ListDevicesRequest {}

message ListDevicesReply {
repeated DeviceInfo devices = 1;
reserved 1;
repeated Device devices = 2;
}

Check failure on line 502 in protect/control/v1/control.proto

View workflow job for this annotation

GitHub Actions / buf

Previously present field "1" with name "devices" on message "ListDevicesReply" was deleted without reserving the name "devices".

message GetHostCpuTopologyRequest {}

Expand Down Expand Up @@ -617,3 +635,33 @@
message DialNetworkSocketReply {
DialNetworkSocketData data = 1;
}

message CreateDeviceRequest {
DeviceSpec spec = 1;
}

message CreateDeviceReply {
string device_id = 1;
}

message DestroyDeviceRequest {
string device_id = 1;
}

message DestroyDeviceReply {}

message ResolveDeviceIdsRequest {
string name = 1;
}

message ResolveDeviceIdsReply {
repeated string device_ids = 1;
}

message GetDeviceRequest {
string device_id = 1;
}

message GetDeviceReply {
Device device = 1;
}
Loading