mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-05 05:07:38 +08:00
187 lines
4.5 KiB
Protocol Buffer
187 lines
4.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
package pb;
|
|
|
|
service AppRuntimeSync {
|
|
rpc GetAppStatus (ServicesRequest) returns (StatusMessage) {}
|
|
rpc GetAppPods (ServiceRequest) returns (ServiceAppPodList) {}
|
|
rpc GetDeployInfo (ServiceRequest) returns (DeployInfo) {}
|
|
rpc GetTenantResource (TenantRequest) returns (TenantResource) {}
|
|
rpc ListThirdPartyEndpoints (ServiceRequest) returns (ThirdPartyEndpoints) {}
|
|
rpc AddThirdPartyEndpoint (AddThirdPartyEndpointsReq) returns (Empty) {}
|
|
rpc UpdThirdPartyEndpoint (UpdThirdPartyEndpointsReq) returns (Empty) {}
|
|
rpc DelThirdPartyEndpoint (DelThirdPartyEndpointsReq) returns (Empty) {}
|
|
rpc GetPodDetail(GetPodDetailReq) returns (PodDetail) {}
|
|
}
|
|
|
|
message Empty {}
|
|
|
|
message ServiceRequest {
|
|
string service_id = 1;
|
|
}
|
|
message ServicesRequest {
|
|
string service_ids = 1;
|
|
}
|
|
message TenantRequest {
|
|
string tenant_id = 1;
|
|
}
|
|
|
|
message StatusMessage {
|
|
map<string, string> status = 1;
|
|
}
|
|
|
|
message DiskMessage {
|
|
map<string, double> disks = 1;
|
|
}
|
|
|
|
message ServiceAppPodList {
|
|
repeated ServiceAppPod oldPods = 1;
|
|
repeated ServiceAppPod newPods = 2;
|
|
}
|
|
|
|
message ServiceAppPod {
|
|
string service_id = 1;
|
|
string deploy_id = 2;
|
|
string deploy_type = 3;
|
|
string pod_name = 4;
|
|
string pod_ip = 5;
|
|
string pod_status = 6;
|
|
map<string, Container> containers = 7;
|
|
}
|
|
|
|
message Container {
|
|
string container_name = 1;
|
|
int64 memory_limit = 2;
|
|
}
|
|
|
|
message DeployInfo {
|
|
string namespace = 1;
|
|
string statefuleset = 2;
|
|
string deployment = 3;
|
|
string start_time = 4;
|
|
map<string, string> pods = 5;
|
|
map<string, string> services = 6;
|
|
map<string, string> endpoints = 7;
|
|
map<string, string> secrets = 8;
|
|
map<string, string> ingresses = 9;
|
|
map<string, string> replicatset = 10;
|
|
string status = 11;
|
|
}
|
|
|
|
message TenantResource {
|
|
int64 cpu_request = 1;
|
|
int64 cpu_limit = 2;
|
|
int64 memory_request = 3;
|
|
int64 memory_limit = 4;
|
|
int64 running_app_num = 5;
|
|
int64 unscd_cpu_req = 6;
|
|
int64 unscd_cpu_limit = 7;
|
|
int64 unscd_memory_req = 8;
|
|
int64 unscd_memory_limit = 9;
|
|
int64 running_app_third_num = 10;
|
|
int64 running_app_internal_num = 11;
|
|
}
|
|
|
|
message AddThirdPartyEndpointsReq {
|
|
string uuid = 1;
|
|
string sid = 2;
|
|
string ip = 3;
|
|
int32 port = 4;
|
|
bool is_online = 5;
|
|
}
|
|
|
|
message UpdThirdPartyEndpointsReq {
|
|
string uuid = 1;
|
|
string sid = 2;
|
|
string ip = 3;
|
|
int32 port = 4;
|
|
bool is_online = 5;
|
|
}
|
|
|
|
message DelThirdPartyEndpointsReq {
|
|
string uuid = 1;
|
|
string sid = 2;
|
|
}
|
|
|
|
message ThirdPartyEndpoint {
|
|
string uuid = 1;
|
|
string sid = 2;
|
|
string ip = 3;
|
|
int32 port = 4;
|
|
string status = 5;
|
|
bool is_online = 6;
|
|
}
|
|
|
|
message ThirdPartyEndpoints {
|
|
repeated ThirdPartyEndpoint obj = 1;
|
|
}
|
|
|
|
message ListPodsBySIDReq {
|
|
string sid = 1;
|
|
}
|
|
|
|
message GetPodDetailReq {
|
|
string sid = 1;
|
|
string pod_name = 2;
|
|
}
|
|
|
|
message PodEvent {
|
|
string type = 1;
|
|
string reason = 2;
|
|
string age = 3;
|
|
string message = 5;
|
|
}
|
|
|
|
message PodStatus {
|
|
enum Type {
|
|
// PENDING means the pod has been accepted by the system, but one or more of the containers
|
|
// has not been started. This includes time before being bound to a node, as well as time spent
|
|
// pulling images onto the host.
|
|
PENDING = 0;
|
|
// RUNNING means the pod has been bound to a node and all of the containers have been started.
|
|
// At least one container is still running or is in the process of being restarted.
|
|
RUNNING = 1;
|
|
// SUCCEEDED means that all containers in the pod have voluntarily terminated
|
|
// with a container exit code of 0, and the system is not going to restart any of these containers.
|
|
SUCCEEDED = 2;
|
|
// FAILED means that all containers in the pod have terminated, and at least one container has
|
|
// terminated in a failure (exited with a non-zero exit code or was stopped by the system).
|
|
FAILED = 3;
|
|
// UNKNOWN means that for some reason the state of the pod could not be obtained, typically due
|
|
// to an error in communicating with the host of the pod.
|
|
UNKNOWN = 4;
|
|
TEMINATING = 5;
|
|
ABNORMAL = 6;
|
|
INITIATING = 7;
|
|
SCHEDULING = 8;
|
|
}
|
|
|
|
Type type = 1;
|
|
string reason = 2;
|
|
string message = 3;
|
|
string advice = 4;
|
|
string type_str = 5;
|
|
}
|
|
|
|
message PodContainer {
|
|
string image = 1;
|
|
string state = 2;
|
|
string reason = 3;
|
|
string started = 4;
|
|
string limit_memory = 5;
|
|
string limit_cpu = 6;
|
|
string request_memory = 7;
|
|
string request_cpu = 8;
|
|
}
|
|
|
|
message PodDetail {
|
|
string name = 1;
|
|
string node = 2;
|
|
string start_time = 3;
|
|
PodStatus status = 4;
|
|
string ip = 5;
|
|
string node_ip = 6;
|
|
string version = 7;
|
|
repeated PodContainer init_containers = 8;
|
|
repeated PodContainer containers = 9;
|
|
repeated PodEvent events = 10;
|
|
} |