fix proto
This commit is contained in:
parent
8a108ec34d
commit
d46983f956
134
proto/docker.proto
Normal file
134
proto/docker.proto
Normal file
@ -0,0 +1,134 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message ContainerRef {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
message ContainerRequest {
|
||||
message List {
|
||||
bool all = 1;
|
||||
}
|
||||
|
||||
message Deploy {
|
||||
uint32 task_id = 1;
|
||||
ContainerDeployParams params = 2;
|
||||
}
|
||||
|
||||
message Start {
|
||||
ContainerRef target = 1;
|
||||
}
|
||||
|
||||
message Stop {
|
||||
ContainerRef target = 1;
|
||||
uint32 timeout_seconds = 2;
|
||||
}
|
||||
|
||||
message Kill {
|
||||
ContainerRef target = 1;
|
||||
string signal = 2;
|
||||
}
|
||||
|
||||
message Remove {
|
||||
ContainerRef target = 1;
|
||||
bool force = 2;
|
||||
bool remove_volumes = 3;
|
||||
}
|
||||
|
||||
message Config {
|
||||
ContainerRef target = 1;
|
||||
bytes config = 2;
|
||||
}
|
||||
|
||||
oneof action {
|
||||
List list = 10;
|
||||
Deploy deploy = 11;
|
||||
Start start = 12;
|
||||
Stop stop = 13;
|
||||
Kill kill = 14;
|
||||
Remove remove = 15;
|
||||
Config config = 16;
|
||||
}
|
||||
}
|
||||
|
||||
message ContainerDeployParams {
|
||||
string container_name = 1;
|
||||
string container_dir = 2;
|
||||
DockerCreateOptions create = 3;
|
||||
}
|
||||
|
||||
message DockerCreateOptions {
|
||||
DockerContainerConfig config = 1;
|
||||
DockerHostConfig host_config = 2;
|
||||
DockerNetworkingConfig networking_config = 3;
|
||||
}
|
||||
|
||||
message DockerContainerConfig {
|
||||
string image = 1;
|
||||
repeated string cmd = 2;
|
||||
repeated string entrypoint = 3;
|
||||
|
||||
repeated string env = 4;
|
||||
map<string, string> labels = 5;
|
||||
repeated string volumes = 6;
|
||||
string user = 7;
|
||||
string working_dir = 8;
|
||||
string hostname = 9;
|
||||
repeated DockerExposedPort exposed_ports = 10;
|
||||
Healthcheck healthcheck = 11;
|
||||
}
|
||||
|
||||
message DockerHostConfig {
|
||||
repeated string binds = 1;
|
||||
string network_mode = 2;
|
||||
RestartPolicy restart_policy = 3;
|
||||
bool privileged = 4;
|
||||
repeated string cap_add = 5;
|
||||
repeated string cap_drop = 6;
|
||||
repeated DeviceMapping devices = 7;
|
||||
uint64 memory = 8;
|
||||
uint64 memory_reservation = 9;
|
||||
uint64 nano_cpus = 10;
|
||||
uint64 cpu_shares = 11;
|
||||
repeated Ulimit ulimits = 12;
|
||||
map<string, string> tmpfs = 13;
|
||||
map<string, string> sysctls = 14;
|
||||
repeated string extra_hosts = 15;
|
||||
}
|
||||
|
||||
message DockerNetworkingConfig {
|
||||
repeated DockerNetworkEndpoint endpoints = 1;
|
||||
}
|
||||
|
||||
message DockerNetworkEndpoint {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message DockerExposedPort {
|
||||
uint32 container_port = 1;
|
||||
string protocol = 2; // tcp / udp
|
||||
}
|
||||
|
||||
message Healthcheck {
|
||||
repeated string test = 1;
|
||||
uint64 interval_ns = 2;
|
||||
uint64 timeout_ns = 3;
|
||||
uint32 retries = 4;
|
||||
}
|
||||
|
||||
message RestartPolicy {
|
||||
string name = 1; // no, always, unless-stopped, on-failure
|
||||
uint32 maximum_retry_count = 2;
|
||||
}
|
||||
|
||||
message DeviceMapping {
|
||||
string host_path = 1;
|
||||
string container_path = 2;
|
||||
string cgroup_permissions = 3; // 默认可填 rwm
|
||||
}
|
||||
|
||||
message Ulimit {
|
||||
string name = 1;
|
||||
uint64 soft = 2;
|
||||
uint64 hard = 3;
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "docker.proto";
|
||||
|
||||
// 整体封装的消息体
|
||||
message RequestFrame {
|
||||
uint32 packet_id = 1;
|
||||
@ -36,140 +38,6 @@ message CastFrame {
|
||||
}
|
||||
|
||||
// message定义
|
||||
|
||||
message ContainerRef {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
message ContainerRequest {
|
||||
message List {
|
||||
bool all = 1;
|
||||
}
|
||||
|
||||
message Deploy {
|
||||
uint32 task_id = 1;
|
||||
ContainerDeployParams params = 2;
|
||||
}
|
||||
|
||||
message Start {
|
||||
ContainerRef target = 1;
|
||||
}
|
||||
|
||||
message Stop {
|
||||
ContainerRef target = 1;
|
||||
uint32 timeout_seconds = 2;
|
||||
}
|
||||
|
||||
message Kill {
|
||||
ContainerRef target = 1;
|
||||
string signal = 2;
|
||||
}
|
||||
|
||||
message Remove {
|
||||
ContainerRef target = 1;
|
||||
bool force = 2;
|
||||
bool remove_volumes = 3;
|
||||
}
|
||||
|
||||
message Config {
|
||||
ContainerRef target = 1;
|
||||
bytes config = 2;
|
||||
}
|
||||
|
||||
oneof action {
|
||||
List list = 10;
|
||||
Deploy deploy = 11;
|
||||
Start start = 12;
|
||||
Stop stop = 13;
|
||||
Kill kill = 14;
|
||||
Remove remove = 15;
|
||||
Config config = 16;
|
||||
}
|
||||
}
|
||||
|
||||
message ContainerDeployParams {
|
||||
string container_name = 1;
|
||||
string container_dir = 2;
|
||||
DockerCreateOptions create = 3;
|
||||
}
|
||||
|
||||
message DockerCreateOptions {
|
||||
DockerContainerConfig config = 1;
|
||||
DockerHostConfig host_config = 2;
|
||||
DockerNetworkingConfig networking_config = 3;
|
||||
}
|
||||
|
||||
message DockerContainerConfig {
|
||||
string image = 1;
|
||||
repeated string cmd = 2;
|
||||
repeated string entrypoint = 3;
|
||||
|
||||
repeated string env = 4;
|
||||
map<string, string> labels = 5;
|
||||
repeated string volumes = 6;
|
||||
string user = 7;
|
||||
string working_dir = 8;
|
||||
string hostname = 9;
|
||||
repeated DockerExposedPort exposed_ports = 10;
|
||||
Healthcheck healthcheck = 11;
|
||||
}
|
||||
|
||||
message DockerHostConfig {
|
||||
repeated string binds = 1;
|
||||
string network_mode = 2;
|
||||
RestartPolicy restart_policy = 3;
|
||||
bool privileged = 4;
|
||||
repeated string cap_add = 5;
|
||||
repeated string cap_drop = 6;
|
||||
repeated DeviceMapping devices = 7;
|
||||
uint64 memory = 8;
|
||||
uint64 memory_reservation = 9;
|
||||
uint64 nano_cpus = 10;
|
||||
uint64 cpu_shares = 11;
|
||||
repeated Ulimit ulimits = 12;
|
||||
map<string, string> tmpfs = 13;
|
||||
map<string, string> sysctls = 14;
|
||||
repeated string extra_hosts = 15;
|
||||
}
|
||||
|
||||
message DockerNetworkingConfig {
|
||||
repeated DockerNetworkEndpoint endpoints = 1;
|
||||
}
|
||||
|
||||
message DockerNetworkEndpoint {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message DockerExposedPort {
|
||||
uint32 container_port = 1;
|
||||
string protocol = 2; // tcp / udp
|
||||
}
|
||||
|
||||
message Healthcheck {
|
||||
repeated string test = 1;
|
||||
uint64 interval_ns = 2;
|
||||
uint64 timeout_ns = 3;
|
||||
uint32 retries = 4;
|
||||
}
|
||||
|
||||
message RestartPolicy {
|
||||
string name = 1; // no, always, unless-stopped, on-failure
|
||||
uint32 maximum_retry_count = 2;
|
||||
}
|
||||
|
||||
message DeviceMapping {
|
||||
string host_path = 1;
|
||||
string container_path = 2;
|
||||
string cgroup_permissions = 3; // 默认可填 rwm
|
||||
}
|
||||
|
||||
message Ulimit {
|
||||
string name = 1;
|
||||
uint64 soft = 2;
|
||||
uint64 hard = 3;
|
||||
}
|
||||
|
||||
message AuthRequest {
|
||||
bytes uuid = 1;
|
||||
bytes username = 2;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user