mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
* refactor: refactor cmd alias status and disconnect --------- Co-authored-by: wencaiwulue <895703375@qq.com>
273 lines
5.1 KiB
Protocol Buffer
273 lines
5.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = ".;rpc";
|
|
|
|
package rpc;
|
|
|
|
service Daemon {
|
|
rpc Connect (ConnectRequest) returns (stream ConnectResponse) {}
|
|
rpc ConnectFork (ConnectRequest) returns (stream ConnectResponse) {}
|
|
rpc Disconnect (DisconnectRequest) returns (stream DisconnectResponse) {}
|
|
rpc Proxy (ConnectRequest) returns (stream ConnectResponse) {}
|
|
rpc Leave (LeaveRequest) returns (stream LeaveResponse) {}
|
|
rpc Clone (CloneRequest) returns (stream CloneResponse) {}
|
|
rpc Remove (RemoveRequest) returns (stream RemoveResponse) {}
|
|
|
|
rpc ConfigAdd (ConfigAddRequest) returns (ConfigAddResponse) {}
|
|
rpc ConfigRemove (ConfigRemoveRequest) returns (ConfigRemoveResponse) {}
|
|
rpc SshStart (SshStartRequest) returns (SshStartResponse) {}
|
|
rpc SshStop (SshStopRequest) returns (SshStopResponse) {}
|
|
rpc SshConnect (stream SshConnectRequest) returns (stream SshConnectResponse) {}
|
|
|
|
rpc Logs (LogRequest) returns (stream LogResponse) {}
|
|
rpc List (ListRequest) returns (ListResponse) {}
|
|
rpc Get (GetRequest) returns (GetResponse) {}
|
|
rpc Upgrade (UpgradeRequest) returns (UpgradeResponse) {}
|
|
rpc Status (StatusRequest) returns (StatusResponse) {}
|
|
rpc Version (VersionRequest) returns (VersionResponse) {}
|
|
rpc Reset (ResetRequest) returns (stream ResetResponse) {}
|
|
rpc Quit (QuitRequest) returns (stream QuitResponse) {}
|
|
}
|
|
|
|
message ConnectRequest {
|
|
string KubeconfigBytes = 1;
|
|
string Namespace = 2;
|
|
map<string, string> Headers = 3;
|
|
repeated string PortMap = 4;
|
|
repeated string Workloads = 5;
|
|
string Engine = 7;
|
|
|
|
// extra route table info
|
|
ExtraRoute ExtraRoute = 8;
|
|
|
|
// ssh jump
|
|
SshJump SshJump = 9;
|
|
|
|
// transfer image
|
|
bool TransferImage = 10;
|
|
string Image = 11;
|
|
|
|
// foreground
|
|
bool Foreground = 12;
|
|
|
|
// log level
|
|
int32 Level = 13;
|
|
|
|
string OriginKubeconfigPath = 14;
|
|
}
|
|
|
|
message ConnectResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message DisconnectRequest {
|
|
// 1) disconnect by id
|
|
optional int32 ID = 1;
|
|
// 2) disconnect all
|
|
optional bool All = 2;
|
|
// 3) disconnect by kubeConfig
|
|
optional string KubeconfigBytes = 3;
|
|
optional string Namespace = 4;
|
|
SshJump SshJump = 5;
|
|
// 4) disconnect by cluster ids
|
|
repeated string ClusterIDs = 6;
|
|
}
|
|
|
|
message DisconnectResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message LeaveRequest {
|
|
repeated string Workloads = 1;
|
|
}
|
|
|
|
message LeaveResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message CloneRequest {
|
|
string KubeconfigBytes = 1;
|
|
string Namespace = 2;
|
|
map<string, string> Headers = 3;
|
|
repeated string Workloads = 4;
|
|
string Engine = 6;
|
|
|
|
// extra route table info
|
|
ExtraRoute ExtraRoute = 7;
|
|
|
|
// ssh jump
|
|
SshJump SshJump = 8;
|
|
|
|
// target cluster info
|
|
string TargetKubeconfig = 9;
|
|
string TargetNamespace = 10;
|
|
string TargetContainer = 11;
|
|
string TargetImage = 12;
|
|
string TargetRegistry = 13;
|
|
bool IsChangeTargetRegistry = 14;
|
|
|
|
// transfer image
|
|
bool TransferImage = 15;
|
|
string Image = 16;
|
|
|
|
// log level
|
|
int32 Level = 17;
|
|
|
|
string OriginKubeconfigPath = 18;
|
|
}
|
|
|
|
message CloneResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message RemoveRequest {
|
|
repeated string Workloads = 1;
|
|
}
|
|
|
|
message RemoveResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message QuitRequest {
|
|
}
|
|
|
|
message QuitResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message StatusRequest {
|
|
repeated string ClusterIDs = 1;
|
|
}
|
|
|
|
message StatusResponse {
|
|
repeated Status List = 1;
|
|
}
|
|
|
|
message Status {
|
|
int32 ID = 1;
|
|
string ClusterID = 2;
|
|
string Cluster = 3;
|
|
string Mode = 4;
|
|
string Kubeconfig = 5;
|
|
string Namespace = 6;
|
|
string Status = 7;
|
|
string Netif = 8;
|
|
}
|
|
|
|
message VersionRequest {
|
|
}
|
|
|
|
message VersionResponse {
|
|
string version = 1;
|
|
}
|
|
|
|
message ConfigAddRequest {
|
|
string KubeconfigBytes = 1;
|
|
string Namespace = 2;
|
|
// ssh jump
|
|
SshJump SshJump = 3;
|
|
}
|
|
|
|
message SshStartRequest {
|
|
string ClientIP = 1;
|
|
}
|
|
|
|
message SshStartResponse {
|
|
string ServerIP = 1;
|
|
}
|
|
|
|
message SshStopRequest {
|
|
string ClientIP = 1;
|
|
}
|
|
|
|
message SshStopResponse {
|
|
string ServerIP = 1;
|
|
}
|
|
|
|
message SshConnectRequest {
|
|
string Stdin = 1;
|
|
SshJump SshJump = 2;
|
|
}
|
|
|
|
message SshConnectResponse {
|
|
string Stdout = 1;
|
|
string Stderr = 2;
|
|
}
|
|
|
|
message ConfigAddResponse {
|
|
string ClusterID = 1;
|
|
}
|
|
|
|
message ConfigRemoveRequest {
|
|
string ClusterID = 1;
|
|
}
|
|
|
|
message ConfigRemoveResponse {
|
|
}
|
|
|
|
message LogRequest {
|
|
bool Follow = 1;
|
|
}
|
|
|
|
message LogResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message ListRequest {
|
|
}
|
|
|
|
message ListResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message GetRequest {
|
|
string Namespace = 2;
|
|
string resource = 4;
|
|
}
|
|
|
|
message GetResponse {
|
|
repeated metadata metadata = 1;
|
|
}
|
|
|
|
message metadata {
|
|
string name = 1;
|
|
string namespace = 2;
|
|
}
|
|
|
|
message UpgradeRequest {
|
|
string ClientVersion = 1;
|
|
string ClientCommitId = 2;
|
|
}
|
|
|
|
message UpgradeResponse {
|
|
bool NeedUpgrade = 1;
|
|
}
|
|
|
|
message ResetRequest {
|
|
string KubeconfigBytes = 1;
|
|
string Namespace = 2;
|
|
// ssh jump
|
|
SshJump SshJump = 3;
|
|
}
|
|
|
|
message ResetResponse {
|
|
string message = 1;
|
|
}
|
|
|
|
message SshJump {
|
|
string Addr = 1;
|
|
string User = 2;
|
|
string Password = 3;
|
|
string Keyfile = 4;
|
|
string ConfigAlias = 5;
|
|
string RemoteKubeconfig = 6;
|
|
string GSSAPIKeytabConf = 7;
|
|
string GSSAPIPassword = 8;
|
|
string GSSAPICacheFile = 9;
|
|
}
|
|
|
|
message ExtraRoute {
|
|
repeated string ExtraCIDR = 1;
|
|
repeated string ExtraDomain = 2;
|
|
bool ExtraNodeIP = 3;
|
|
} |