Rainbond/worker/server/pb/app_runtime_server.proto

324 lines
7.3 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package pb;
service AppRuntimeSync {
2020-09-28 16:43:27 +08:00
// Deprecated: -
rpc GetAppStatusDeprecated (ServicesRequest) returns (StatusMessage) {}
rpc GetAppStatus (AppStatusReq) returns (AppStatus) {}
rpc GetAppPods (ServiceRequest) returns (ServiceAppPodList) {}
2020-07-29 19:08:01 +08:00
rpc GetMultiAppPods (ServicesRequest) returns (MultiServiceAppPodList) {}
2021-05-26 10:00:36 +08:00
rpc GetComponentPodNums (ServicesRequest) returns (ComponentPodNums) {}
2018-12-07 13:45:47 +08:00
rpc GetDeployInfo (ServiceRequest) returns (DeployInfo) {}
rpc GetTenantResource (TenantRequest) returns (TenantResource) {}
rpc GetTenantResources (Empty) returns (TenantResourceList) {}
rpc ListThirdPartyEndpoints (ServiceRequest) returns (ThirdPartyEndpoints) {}
2019-03-09 21:54:17 +08:00
rpc AddThirdPartyEndpoint (AddThirdPartyEndpointsReq) returns (Empty) {}
rpc UpdThirdPartyEndpoint (UpdThirdPartyEndpointsReq) returns (Empty) {}
rpc DelThirdPartyEndpoint (DelThirdPartyEndpointsReq) returns (Empty) {}
2019-08-21 14:01:47 +08:00
rpc GetPodDetail(GetPodDetailReq) returns (PodDetail) {}
rpc GetStorageClasses(Empty) returns (StorageClasses) {}
2019-11-28 19:45:04 +08:00
rpc GetAppVolumeStatus(ServiceRequest) returns(ServiceVolumeStatusMessage){}
2021-04-20 11:25:24 +08:00
rpc ListAppServices(AppReq) returns(AppServices){}
2021-04-27 11:13:54 +08:00
rpc ListHelmAppRelease(AppReq) returns(HelmAppReleases){}
2021-07-22 19:49:22 +08:00
rpc ListAppStatuses(AppStatusesReq) returns(AppStatuses){}
}
2019-03-09 21:54:17 +08:00
message Empty {}
2021-04-19 17:34:56 +08:00
message AppReq {
string app_id = 1;
}
2020-09-28 16:43:27 +08:00
message AppStatusReq {
string app_id = 1;
}
2019-03-01 13:27:27 +08:00
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 {
2019-08-16 12:52:29 +08:00
repeated ServiceAppPod oldPods = 1;
repeated ServiceAppPod newPods = 2;
}
2019-08-16 12:52:29 +08:00
2020-07-29 19:08:01 +08:00
message MultiServiceAppPodList {
map<string, ServiceAppPodList> servicePods = 1;
}
2021-05-26 10:00:36 +08:00
message ComponentPodNums {
map<string, int32> podNums = 1;
}
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;
2019-12-12 17:40:40 +08:00
repeated string pod_volumes = 8;
}
message Container {
string container_name = 1;
int64 memory_limit = 2;
2020-11-24 14:59:27 +08:00
int64 cpu_request = 3;
2018-12-07 13:45:47 +08:00
}
message DeployInfo {
string namespace = 1;
string statefuleset = 2;
string deployment = 3;
2019-08-23 09:22:23 +08:00
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 running_app_third_num = 10;
int64 running_app_internal_num = 11;
2019-03-01 13:27:27 +08:00
}
message TenantResourceList {
map<string, TenantResource> resources = 1;
}
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;
string ip = 3;
int32 port = 4;
}
message ThirdPartyEndpoint {
2021-08-15 14:41:33 +08:00
string name = 1;
string componentID = 2;
string address = 3;
string status = 4;
}
message ThirdPartyEndpoints {
2021-08-15 14:41:33 +08:00
repeated ThirdPartyEndpoint items = 1;
2019-08-16 12:52:29 +08:00
}
message ListPodsBySIDReq {
string sid = 1;
2019-08-20 17:26:14 +08:00
}
2019-08-21 14:01:47 +08:00
message GetPodDetailReq {
2019-08-20 17:26:14 +08:00
string sid = 1;
2019-08-21 14:01:47 +08:00
string pod_name = 2;
2019-08-20 17:26:14 +08:00
}
message PodEvent {
string type = 1;
string reason = 2;
string age = 3;
string message = 5;
2019-08-21 14:01:47 +08:00
}
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;
2019-08-27 17:32:24 +08:00
NOTREADY = 9;
2019-09-01 10:30:14 +08:00
UNHEALTHY = 10;
2019-08-21 14:01:47 +08:00
}
Type type = 1;
string reason = 2;
string message = 3;
string advice = 4;
2019-08-23 15:55:40 +08:00
string type_str = 5;
2019-08-21 14:01:47 +08:00
}
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;
2019-08-26 16:47:47 +08:00
string node_ip = 6;
2019-08-26 16:53:49 +08:00
string version = 7;
repeated PodContainer init_containers = 8;
repeated PodContainer containers = 9;
repeated PodEvent events = 10;
}
message StorageClasses {
repeated StorageClassDetail list = 1;
}
message StorageClassDetail{
string name = 1;
string provisioner = 2;
map<string, string> parameters = 3;
string reclaim_policy = 4;
bool allow_volume_expansion = 5;
string volume_binding_mode = 6;
repeated TopologySelectorTerm allowed_topologies = 7;
}
message TopologySelectorTerm {
repeated TopologySelectorLabelRequirement match_label_expressions = 1;
}
message TopologySelectorLabelRequirement {
string key = 1;
repeated string values = 2;
2019-11-28 19:45:04 +08:00
}
enum ServiceVolumeStatus {
READY = 0;
NOT_READY = 1;
}
message ServiceVolumeStatusMessage {
map<string, ServiceVolumeStatus> status = 1;
2020-09-28 16:43:27 +08:00
}
message AppStatus {
enum Status {
2021-04-19 17:34:56 +08:00
NIL = 0;
RUNNING = 1;
CLOSED = 2;
ABNORMAL = 3;
STARTING = 4;
STOPPING = 5;
2020-09-28 16:43:27 +08:00
}
2021-04-19 17:34:56 +08:00
string status = 1;
int64 cpu = 2;
int64 memory = 3;
2021-05-08 14:05:00 +08:00
bool setCPU = 4;
bool setMemory = 5;
string phase = 6;
repeated string overrides = 7;
string version = 8;
2021-05-11 10:32:55 +08:00
repeated AppStatusCondition conditions=9;
2021-07-22 19:49:22 +08:00
int64 gpu = 10;
string app_id = 11;
string app_name = 12;
2021-04-19 17:34:56 +08:00
}
2021-05-11 10:32:55 +08:00
message AppStatusCondition {
2021-04-19 17:34:56 +08:00
string type = 1;
2021-05-11 10:32:55 +08:00
bool status = 2;
string reason = 3;
string message = 4;
2021-04-19 17:34:56 +08:00
}
2021-04-20 11:25:24 +08:00
message AppService {
message Pod {
string name=1;
string status=2;
}
2021-06-30 20:47:39 +08:00
message Port {
int32 port=1;
string protocol=2;
}
2021-04-20 11:25:24 +08:00
string name=1;
2021-04-21 15:12:34 +08:00
string address=2;
2021-06-30 20:47:39 +08:00
repeated Port ports=3;
repeated Pod pods=4;
repeated Pod oldPods=5;
2021-04-20 11:25:24 +08:00
}
message AppServices {
repeated AppService services=1;
2021-04-20 22:27:09 +08:00
}
2021-04-27 11:13:54 +08:00
message HelmAppReleases {
repeated HelmAppRelease helmAppRelease=1;
}
message HelmAppRelease {
int32 revision=1;
string updated=2;
string status=3;
string chart=4;
string appVersion=5;
string description=6;
}
2021-07-22 19:49:22 +08:00
message AppStatusesReq {
repeated string app_ids = 1;
}
message AppStatuses {
repeated AppStatus app_statuses = 1;
}