503 lines
11 KiB
Protocol Buffer
503 lines
11 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package olivetin.api.v1;
|
|
|
|
option go_package = "github.com/OliveTin/OliveTin/gen/olivetin/api/v1;apiv1";
|
|
|
|
message Action {
|
|
string binding_id = 1;
|
|
string title = 2;
|
|
string icon = 3;
|
|
bool can_exec = 4;
|
|
repeated ActionArgument arguments = 5;
|
|
string popup_on_start = 6;
|
|
int32 order = 7;
|
|
int32 timeout = 8;
|
|
string datetime_rate_limit_expires = 9; // Datetime when rate limit expires (empty string if not rate limited), format: "2006-01-02 15:04:05"
|
|
bool exec_on_startup = 10;
|
|
repeated string exec_on_cron = 11;
|
|
repeated string exec_on_file_created_in_dir = 12;
|
|
repeated string exec_on_file_changed_in_dir = 13;
|
|
string exec_on_calendar_file = 14;
|
|
repeated ActionWebhookExecHint exec_on_webhooks = 15;
|
|
bool justification = 16;
|
|
bool has_running_instance = 17;
|
|
bool has_queued_instance = 18;
|
|
repeated ActionGroupMembership groups = 19;
|
|
}
|
|
|
|
message ActionGroupMembership {
|
|
string name = 1;
|
|
int32 max_concurrent = 2;
|
|
int32 queue_size = 3;
|
|
}
|
|
|
|
message ActionWebhookExecHint {
|
|
string template = 1;
|
|
string match_path = 2;
|
|
map<string, string> match_headers = 3;
|
|
map<string, string> match_query = 4;
|
|
}
|
|
|
|
message ActionArgument {
|
|
string name = 1;
|
|
string title = 2;
|
|
string type = 3;
|
|
string default_value = 4;
|
|
|
|
repeated ActionArgumentChoice choices = 5;
|
|
|
|
string description = 6;
|
|
map<string, string> suggestions = 7;
|
|
string suggestions_browser_key = 8;
|
|
}
|
|
|
|
message ActionArgumentChoice {
|
|
string value = 1;
|
|
string title = 2;
|
|
}
|
|
|
|
message Entity {
|
|
string title = 1;
|
|
string unique_key = 2;
|
|
string type = 3;
|
|
repeated string directories = 4;
|
|
map<string, string> fields = 5;
|
|
}
|
|
|
|
message GetDashboardResponse {
|
|
string title = 1;
|
|
|
|
Dashboard dashboard = 4;
|
|
}
|
|
|
|
message EffectivePolicy {
|
|
bool show_diagnostics = 1;
|
|
bool show_log_list = 2;
|
|
bool show_version_number = 3;
|
|
}
|
|
|
|
message GetDashboardRequest {
|
|
string title = 1;
|
|
string entity_type = 2;
|
|
string entity_key = 3;
|
|
}
|
|
|
|
message Dashboard {
|
|
string title = 1;
|
|
repeated DashboardComponent contents = 2;
|
|
}
|
|
|
|
message DashboardComponent {
|
|
string title = 1;
|
|
string type = 2;
|
|
repeated DashboardComponent contents = 3;
|
|
string icon = 4;
|
|
string css_class = 5;
|
|
Action action = 6;
|
|
string entity_type = 7;
|
|
string entity_key = 8;
|
|
}
|
|
|
|
message StartActionRequest {
|
|
string binding_id = 1;
|
|
|
|
repeated StartActionArgument arguments = 2;
|
|
|
|
string unique_tracking_id = 3;
|
|
string justification = 4;
|
|
}
|
|
|
|
message StartActionArgument {
|
|
string name = 1;
|
|
string value = 2;
|
|
}
|
|
|
|
message StartActionResponse {
|
|
string execution_tracking_id = 2;
|
|
}
|
|
|
|
message StartActionAndWaitRequest {
|
|
string action_id = 1;
|
|
|
|
repeated StartActionArgument arguments = 2;
|
|
|
|
string justification = 3;
|
|
}
|
|
|
|
message StartActionAndWaitResponse {
|
|
LogEntry log_entry = 1;
|
|
}
|
|
|
|
message StartActionByGetRequest {
|
|
string action_id = 1;
|
|
}
|
|
|
|
message StartActionByGetResponse {
|
|
string execution_tracking_id = 2;
|
|
}
|
|
|
|
message StartActionByGetAndWaitRequest {
|
|
string action_id = 1;
|
|
}
|
|
|
|
message StartActionByGetAndWaitResponse {
|
|
LogEntry log_entry = 1;
|
|
}
|
|
|
|
message GetLogsRequest{
|
|
int64 start_offset = 1;
|
|
string date_filter = 2; // Optional date filter in YYYY-MM-DD format
|
|
int64 page_size = 3; // Number of logs per page (optional; server default used if 0 or unset)
|
|
string filter = 4; // Optional filter expression (see logs UI syntax help)
|
|
};
|
|
|
|
message LogEntry {
|
|
string datetime_started = 1;
|
|
string action_title = 2;
|
|
string output = 3;
|
|
bool timed_out = 5;
|
|
int32 exit_code = 6;
|
|
string user = 7;
|
|
string user_class = 8;
|
|
string action_icon = 9;
|
|
repeated string tags = 10;
|
|
string execution_tracking_id = 11;
|
|
string datetime_finished = 12;
|
|
bool execution_started = 14;
|
|
bool execution_finished = 15;
|
|
bool blocked = 16;
|
|
int64 datetime_index = 17;
|
|
bool can_kill = 18;
|
|
string datetime_rate_limit_expires = 19; // Datetime when rate limit expires (empty string if not rate limited), format: "2006-01-02 15:04:05"
|
|
string binding_id = 20; // Binding ID for matching rate limits to action buttons
|
|
bool queued = 21;
|
|
string queued_for_group = 22;
|
|
string justification = 23;
|
|
}
|
|
|
|
message GetLogsResponse {
|
|
repeated LogEntry logs = 1;
|
|
int64 count_remaining = 2;
|
|
int64 page_size = 3;
|
|
int64 total_count = 4;
|
|
int64 start_offset = 5;
|
|
}
|
|
|
|
message GetActionLogsRequest {
|
|
string action_id = 1;
|
|
int64 start_offset = 2;
|
|
}
|
|
|
|
message GetActionLogsResponse {
|
|
repeated LogEntry logs = 1;
|
|
int64 count_remaining = 2;
|
|
int64 page_size = 3;
|
|
int64 total_count = 4;
|
|
int64 start_offset = 5;
|
|
}
|
|
|
|
message GetExecutionQueueRequest {}
|
|
|
|
message ExecutionQueueAction {
|
|
string binding_id = 1;
|
|
string action_title = 2;
|
|
string action_icon = 3;
|
|
int32 max_concurrent = 4;
|
|
int32 active_count = 5;
|
|
string entity_prefix = 6;
|
|
repeated LogEntry entries = 7;
|
|
}
|
|
|
|
message ExecutionQueueGroup {
|
|
string name = 1;
|
|
string icon = 2;
|
|
int32 max_concurrent = 3;
|
|
int32 active_count = 4;
|
|
repeated ExecutionQueueAction actions = 5;
|
|
int32 queued_count = 6;
|
|
int32 queue_size = 7;
|
|
}
|
|
|
|
message GetExecutionQueueResponse {
|
|
repeated ExecutionQueueGroup groups = 1;
|
|
int32 total_active = 2;
|
|
}
|
|
|
|
message ValidateArgumentTypeRequest {
|
|
string value = 1;
|
|
string type = 2;
|
|
string binding_id = 3;
|
|
string argument_name = 4;
|
|
}
|
|
|
|
message ValidateArgumentTypeResponse {
|
|
bool valid = 1;
|
|
string description = 2;
|
|
}
|
|
|
|
message WatchExecutionRequest {
|
|
string execution_tracking_id = 1;
|
|
}
|
|
|
|
message WatchExecutionUpdate {
|
|
string update = 1;
|
|
}
|
|
|
|
message ExecutionStatusRequest {
|
|
string execution_tracking_id = 1;
|
|
string action_id = 2;
|
|
}
|
|
|
|
message DashboardNavigationTarget {
|
|
string title = 1;
|
|
string entity_type = 2;
|
|
string entity_key = 3;
|
|
string path = 4;
|
|
}
|
|
|
|
message ExecutionStatusResponse {
|
|
LogEntry log_entry = 1;
|
|
repeated DashboardNavigationTarget back_to_dashboards = 2;
|
|
}
|
|
|
|
message WhoAmIRequest {}
|
|
|
|
message WhoAmIResponse {
|
|
string authenticated_user = 1;
|
|
string usergroup = 2;
|
|
string provider = 3;
|
|
|
|
repeated string acls = 4;
|
|
|
|
string sid = 5;
|
|
}
|
|
|
|
message SosReportRequest {}
|
|
|
|
message SosReportResponse {
|
|
string alert = 1;
|
|
}
|
|
|
|
message DumpVarsRequest {}
|
|
|
|
message DumpVarsResponse {
|
|
string alert = 1;
|
|
map<string, string> contents = 2;
|
|
}
|
|
|
|
message DebugBinding {
|
|
string action_title = 1;
|
|
string entity_prefix = 2;
|
|
}
|
|
|
|
message DumpPublicIdActionMapRequest {}
|
|
message DumpPublicIdActionMapResponse {
|
|
string alert = 1;
|
|
map<string, DebugBinding> contents = 2;
|
|
}
|
|
|
|
message GetReadyzRequest {}
|
|
|
|
message GetReadyzResponse {
|
|
string status = 1;
|
|
}
|
|
|
|
message EventStreamRequest {
|
|
}
|
|
|
|
message EventStreamResponse {
|
|
oneof event {
|
|
EventEntityChanged entity_changed = 2;
|
|
EventConfigChanged config_changed = 3;
|
|
EventExecutionFinished execution_finished = 4;
|
|
EventExecutionStarted execution_started = 5;
|
|
EventOutputChunk output_chunk = 6;
|
|
EventHeartbeat heartbeat = 7;
|
|
}
|
|
}
|
|
|
|
message EventOutputChunk {
|
|
string execution_tracking_id = 1;
|
|
|
|
string output = 2;
|
|
}
|
|
|
|
message EventEntityChanged {}
|
|
message EventConfigChanged {}
|
|
message EventHeartbeat {}
|
|
message EventExecutionFinished {
|
|
LogEntry log_entry = 1;
|
|
}
|
|
|
|
message EventExecutionStarted {
|
|
LogEntry log_entry = 1;
|
|
}
|
|
|
|
message KillActionRequest {
|
|
string execution_tracking_id = 1;
|
|
}
|
|
|
|
message KillActionResponse {
|
|
string execution_tracking_id = 1;
|
|
bool killed = 2;
|
|
bool already_completed = 3;
|
|
bool found = 4;
|
|
}
|
|
|
|
message LocalUserLoginRequest {
|
|
string username = 1;
|
|
string password = 2;
|
|
}
|
|
|
|
message LocalUserLoginResponse {
|
|
bool success = 1;
|
|
}
|
|
|
|
message PasswordHashRequest {
|
|
string password = 1;
|
|
}
|
|
|
|
message PasswordHashResponse {
|
|
string hash = 1;
|
|
}
|
|
|
|
message LogoutRequest {}
|
|
|
|
message LogoutResponse {
|
|
}
|
|
|
|
message GetDiagnosticsRequest {
|
|
}
|
|
|
|
message GetDiagnosticsResponse {
|
|
string SshFoundKey = 1;
|
|
string SshFoundConfig = 2;
|
|
}
|
|
|
|
message InitRequest {}
|
|
|
|
message InitResponse {
|
|
bool showFooter = 1;
|
|
bool showNavigation = 2;
|
|
bool showNewVersions = 3;
|
|
string availableVersion = 4;
|
|
string currentVersion = 5;
|
|
string pageTitle = 6;
|
|
string sectionNavigationStyle = 7;
|
|
string defaultIconForBack = 8;
|
|
bool enableCustomJs = 9;
|
|
string authLoginUrl = 10;
|
|
bool authLocalLogin = 11;
|
|
repeated string styleMods = 12;
|
|
repeated OAuth2Provider oAuth2Providers = 13;
|
|
repeated AdditionalLink additionalLinks = 14;
|
|
repeated string rootDashboards = 15;
|
|
string authenticated_user = 16;
|
|
string authenticated_user_provider = 17;
|
|
EffectivePolicy effective_policy = 18;
|
|
string banner_message = 19;
|
|
string banner_css = 20;
|
|
bool show_diagnostics = 21;
|
|
bool show_log_list = 22;
|
|
bool login_required = 23;
|
|
repeated string available_themes = 24; // List of available theme names
|
|
bool show_navigate_on_start_icons = 25;
|
|
}
|
|
|
|
message AdditionalLink {
|
|
string title = 1;
|
|
string url = 2;
|
|
}
|
|
|
|
message OAuth2Provider {
|
|
string title = 1;
|
|
string icon = 3;
|
|
string key = 4;
|
|
}
|
|
|
|
message GetActionBindingRequest {
|
|
string binding_id = 1;
|
|
}
|
|
|
|
message GetActionBindingResponse {
|
|
Action action = 1;
|
|
repeated DashboardNavigationTarget back_to_dashboards = 2;
|
|
}
|
|
|
|
message GetEntitiesRequest {
|
|
}
|
|
|
|
message GetEntitiesResponse {
|
|
repeated EntityDefinition entity_definitions = 1;
|
|
}
|
|
|
|
message EntityDefinition {
|
|
string title = 1;
|
|
repeated Entity instances = 2;
|
|
repeated string used_on_dashboards = 3;
|
|
}
|
|
|
|
message GetEntityRequest {
|
|
string unique_key = 1;
|
|
string type = 2;
|
|
}
|
|
|
|
message RestartActionRequest {
|
|
string execution_tracking_id = 1;
|
|
}
|
|
|
|
service OliveTinApiService {
|
|
rpc GetDashboard(GetDashboardRequest) returns (GetDashboardResponse) {}
|
|
|
|
rpc StartAction(StartActionRequest) returns (StartActionResponse) {}
|
|
|
|
rpc StartActionAndWait(StartActionAndWaitRequest) returns (StartActionAndWaitResponse) {}
|
|
|
|
rpc StartActionByGet(StartActionByGetRequest) returns (StartActionByGetResponse) {}
|
|
|
|
rpc StartActionByGetAndWait(StartActionByGetAndWaitRequest) returns (StartActionByGetAndWaitResponse) {}
|
|
|
|
rpc RestartAction(RestartActionRequest) returns (StartActionResponse) {}
|
|
|
|
rpc KillAction(KillActionRequest) returns (KillActionResponse) {}
|
|
|
|
rpc ExecutionStatus(ExecutionStatusRequest) returns (ExecutionStatusResponse) {}
|
|
|
|
rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {}
|
|
|
|
rpc GetActionLogs(GetActionLogsRequest) returns (GetActionLogsResponse) {}
|
|
|
|
rpc GetExecutionQueue(GetExecutionQueueRequest) returns (GetExecutionQueueResponse) {}
|
|
|
|
rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {}
|
|
|
|
rpc WhoAmI(WhoAmIRequest) returns (WhoAmIResponse) {}
|
|
|
|
rpc SosReport(SosReportRequest) returns (SosReportResponse) {}
|
|
|
|
rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse) {}
|
|
|
|
rpc DumpPublicIdActionMap(DumpPublicIdActionMapRequest) returns (DumpPublicIdActionMapResponse) {}
|
|
|
|
rpc GetReadyz(GetReadyzRequest) returns (GetReadyzResponse) {}
|
|
|
|
rpc LocalUserLogin(LocalUserLoginRequest) returns (LocalUserLoginResponse) {}
|
|
|
|
rpc PasswordHash(PasswordHashRequest) returns (PasswordHashResponse) {}
|
|
|
|
rpc Logout(LogoutRequest) returns (LogoutResponse) {}
|
|
|
|
rpc EventStream(EventStreamRequest) returns (stream EventStreamResponse) {}
|
|
|
|
rpc GetDiagnostics(GetDiagnosticsRequest) returns (GetDiagnosticsResponse) {}
|
|
|
|
rpc Init(InitRequest) returns (InitResponse) {}
|
|
|
|
rpc GetActionBinding(GetActionBindingRequest) returns (GetActionBindingResponse) {}
|
|
|
|
rpc GetEntities(GetEntitiesRequest) returns (GetEntitiesResponse) {}
|
|
|
|
rpc GetEntity(GetEntityRequest) returns (Entity) {}
|
|
}
|