180 lines
2.7 KiB
Protocol Buffer
180 lines
2.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
// iot <-> efka protocol payload definitions.
|
|
//
|
|
// The transport frame keeps the first byte as the coarse message class:
|
|
//
|
|
// [CLASS_REQUEST][protobuf(Request)]
|
|
// [CLASS_RESPONSE][protobuf(Response)]
|
|
// [CLASS_COMMAND][protobuf(Command)]
|
|
// [CLASS_COMMAND_RESPONSE][protobuf(CommandResponse)]
|
|
// [CLASS_MESSAGE][protobuf(Message)]
|
|
// [CLASS_STREAM][protobuf(Stream)]
|
|
//
|
|
// HTTP proxy bytes carried by Stream.Data are transparent payload bytes.
|
|
|
|
message Request {
|
|
uint64 packet_id = 1;
|
|
|
|
message AuthRequest {
|
|
bytes uuid = 1;
|
|
bytes token = 2;
|
|
uint64 timestamp = 3;
|
|
}
|
|
|
|
oneof body {
|
|
AuthRequest auth_request = 10;
|
|
}
|
|
|
|
}
|
|
|
|
message Response {
|
|
uint64 packet_id = 1;
|
|
|
|
message Error {
|
|
uint32 code = 1;
|
|
bytes reason = 2;
|
|
}
|
|
|
|
message AuthResponse {
|
|
|
|
}
|
|
|
|
oneof body {
|
|
AuthResponse auth_response = 10;
|
|
Error error = 11;
|
|
}
|
|
|
|
}
|
|
|
|
message Command {
|
|
uint64 packet_id = 1;
|
|
|
|
message Container {
|
|
message ContainerTarget {
|
|
bytes name = 1;
|
|
bytes id = 2;
|
|
}
|
|
|
|
message ContainerList {
|
|
|
|
}
|
|
|
|
message ContainerStart {
|
|
ContainerTarget target = 1;
|
|
}
|
|
|
|
message ContainerStop {
|
|
ContainerTarget target = 1;
|
|
uint32 timeout_seconds = 2;
|
|
}
|
|
|
|
message ContainerKill {
|
|
ContainerTarget target = 1;
|
|
bytes signal = 2;
|
|
}
|
|
|
|
message ContainerRemove {
|
|
ContainerTarget target = 1;
|
|
bool force = 2;
|
|
bool remove_volumes = 3;
|
|
}
|
|
|
|
message ContainerConfig {
|
|
ContainerTarget target = 1;
|
|
bytes config = 2;
|
|
}
|
|
|
|
oneof action {
|
|
ContainerList list = 1;
|
|
ContainerStart start = 3;
|
|
ContainerStop stop = 4;
|
|
ContainerKill kill = 5;
|
|
ContainerRemove remove = 6;
|
|
ContainerConfig config = 7;
|
|
}
|
|
|
|
}
|
|
|
|
oneof body {
|
|
Container container = 10;
|
|
}
|
|
|
|
}
|
|
|
|
message CommandResponse {
|
|
uint64 packet_id = 1;
|
|
|
|
message Error {
|
|
uint32 code = 1;
|
|
bytes reason = 2;
|
|
}
|
|
|
|
oneof body {
|
|
bytes result = 10;
|
|
Error error = 11;
|
|
}
|
|
|
|
}
|
|
|
|
message Message {
|
|
message Ping {
|
|
}
|
|
|
|
message Pong {
|
|
}
|
|
|
|
message Pub {
|
|
bytes topic = 1;
|
|
uint32 qos = 2;
|
|
bytes content = 3;
|
|
}
|
|
|
|
message MetricData {
|
|
bytes route_key = 1;
|
|
bytes metric = 2;
|
|
}
|
|
|
|
oneof body {
|
|
Ping ping = 10;
|
|
Pong pong = 11;
|
|
Pub pub = 12;
|
|
MetricData metric_data = 13;
|
|
}
|
|
}
|
|
|
|
message Stream {
|
|
uint32 stream_id = 1;
|
|
|
|
message Open {
|
|
uint32 target = 1;
|
|
}
|
|
|
|
message Opened {
|
|
}
|
|
|
|
message OpenError {
|
|
bytes reason = 1;
|
|
}
|
|
|
|
message Data {
|
|
bytes bytes = 1;
|
|
}
|
|
|
|
message Fin {
|
|
}
|
|
|
|
message Reset {
|
|
bytes reason = 1;
|
|
}
|
|
|
|
oneof payload {
|
|
Open open = 10;
|
|
Opened opened = 11;
|
|
OpenError open_error = 12;
|
|
Data data = 13;
|
|
Fin fin = 14;
|
|
Reset reset = 15;
|
|
}
|
|
}
|