3
This commit is contained in:
@@ -214,5 +214,53 @@ message CallResponse { bytes result = 1; bool ok = 2; string error = 3; }
|
||||
message HeartbeatRequest { string plugin_id = 1; }
|
||||
message HeartbeatResponse { bool ok = 1; }
|
||||
|
||||
// ========== Admin (plugin lifecycle management, = systemctl) ==========
|
||||
service Admin {
|
||||
rpc Start(AdminIdRequest) returns (AdminResponse);
|
||||
rpc Stop(AdminIdRequest) returns (AdminResponse);
|
||||
rpc Restart(AdminIdRequest) returns (AdminResponse);
|
||||
rpc Status(AdminIdRequest) returns (AdminStatusResponse);
|
||||
rpc ListPlugins(Empty) returns (AdminListResponse);
|
||||
rpc Logs(AdminLogsRequest) returns (AdminLogsResponse);
|
||||
rpc Install(AdminInstallRequest) returns (AdminResponse);
|
||||
rpc Uninstall(AdminIdRequest) returns (AdminResponse);
|
||||
rpc Enable(AdminIdRequest) returns (AdminResponse);
|
||||
rpc Disable(AdminIdRequest) returns (AdminResponse);
|
||||
}
|
||||
|
||||
message AdminIdRequest { string id = 1; }
|
||||
message AdminResponse { bool ok = 1; string error = 2; string message = 3; }
|
||||
message AdminStatusResponse {
|
||||
bool ok = 1;
|
||||
string error = 2;
|
||||
AdminPluginState plugin = 3;
|
||||
}
|
||||
message AdminListResponse { repeated AdminPluginState plugins = 1; }
|
||||
message AdminPluginState {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string version = 3;
|
||||
string plugin_type = 4;
|
||||
string status = 5; // "registered" | "running" | "stopped" | "failed: <reason>"
|
||||
bool enabled = 6;
|
||||
bool installed = 7;
|
||||
uint32 pid = 8; // 0 if not running under supervisor
|
||||
uint64 started_at_ms = 9; // 0 if not running
|
||||
uint32 restart_count = 10;
|
||||
repeated string depends = 11;
|
||||
}
|
||||
message AdminLogsRequest {
|
||||
string id = 1;
|
||||
uint32 tail_lines = 2; // 0 = default (100)
|
||||
}
|
||||
message AdminLogsResponse {
|
||||
bool ok = 1;
|
||||
string error = 2;
|
||||
repeated string lines = 3;
|
||||
}
|
||||
message AdminInstallRequest {
|
||||
string path = 1; // directory containing plugin.yaml
|
||||
}
|
||||
|
||||
// ========== Common ==========
|
||||
message Empty {}
|
||||
|
||||
Reference in New Issue
Block a user