olivetin.proto 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. syntax = "proto3";
  2. package olivetin.api.v1;
  3. option go_package = "github.com/OliveTin/OliveTin/gen/olivetin/api/v1;apiv1";
  4. message Action {
  5. string binding_id = 1;
  6. string title = 2;
  7. string icon = 3;
  8. bool can_exec = 4;
  9. repeated ActionArgument arguments = 5;
  10. string popup_on_start = 6;
  11. int32 order = 7;
  12. int32 timeout = 8;
  13. string datetime_rate_limit_expires = 9; // Datetime when rate limit expires (empty string if not rate limited), format: "2006-01-02 15:04:05"
  14. }
  15. message ActionArgument {
  16. string name = 1;
  17. string title = 2;
  18. string type = 3;
  19. string default_value = 4;
  20. repeated ActionArgumentChoice choices = 5;
  21. string description = 6;
  22. map<string, string> suggestions = 7;
  23. string suggestions_browser_key = 8;
  24. }
  25. message ActionArgumentChoice {
  26. string value = 1;
  27. string title = 2;
  28. }
  29. message Entity {
  30. string title = 1;
  31. string unique_key = 2;
  32. string type = 3;
  33. repeated string directories = 4;
  34. map<string, string> fields = 5;
  35. }
  36. message GetDashboardResponse {
  37. string title = 1;
  38. Dashboard dashboard = 4;
  39. }
  40. message EffectivePolicy {
  41. bool show_diagnostics = 1;
  42. bool show_log_list = 2;
  43. }
  44. message GetDashboardRequest {
  45. string title = 1;
  46. string entity_type = 2;
  47. string entity_key = 3;
  48. }
  49. message Dashboard {
  50. string title = 1;
  51. repeated DashboardComponent contents = 2;
  52. }
  53. message DashboardComponent {
  54. string title = 1;
  55. string type = 2;
  56. repeated DashboardComponent contents = 3;
  57. string icon = 4;
  58. string css_class = 5;
  59. Action action = 6;
  60. string entity_type = 7;
  61. string entity_key = 8;
  62. }
  63. message StartActionRequest {
  64. string binding_id = 1;
  65. repeated StartActionArgument arguments = 2;
  66. string unique_tracking_id = 3;
  67. }
  68. message StartActionArgument {
  69. string name = 1;
  70. string value = 2;
  71. }
  72. message StartActionResponse {
  73. string execution_tracking_id = 2;
  74. }
  75. message StartActionAndWaitRequest {
  76. string action_id = 1;
  77. repeated StartActionArgument arguments = 2;
  78. }
  79. message StartActionAndWaitResponse {
  80. LogEntry log_entry = 1;
  81. }
  82. message StartActionByGetRequest {
  83. string action_id = 1;
  84. }
  85. message StartActionByGetResponse {
  86. string execution_tracking_id = 2;
  87. }
  88. message StartActionByGetAndWaitRequest {
  89. string action_id = 1;
  90. }
  91. message StartActionByGetAndWaitResponse {
  92. LogEntry log_entry = 1;
  93. }
  94. message GetLogsRequest{
  95. int64 start_offset = 1;
  96. string date_filter = 2; // Optional date filter in YYYY-MM-DD format
  97. };
  98. message LogEntry {
  99. string datetime_started = 1;
  100. string action_title = 2;
  101. string output = 3;
  102. bool timed_out = 5;
  103. int32 exit_code = 6;
  104. string user = 7;
  105. string user_class = 8;
  106. string action_icon = 9;
  107. repeated string tags = 10;
  108. string execution_tracking_id = 11;
  109. string datetime_finished = 12;
  110. bool execution_started = 14;
  111. bool execution_finished = 15;
  112. bool blocked = 16;
  113. int64 datetime_index = 17;
  114. bool can_kill = 18;
  115. string datetime_rate_limit_expires = 19; // Datetime when rate limit expires (empty string if not rate limited), format: "2006-01-02 15:04:05"
  116. string binding_id = 20; // Binding ID for matching rate limits to action buttons
  117. }
  118. message GetLogsResponse {
  119. repeated LogEntry logs = 1;
  120. int64 count_remaining = 2;
  121. int64 page_size = 3;
  122. int64 total_count = 4;
  123. int64 start_offset = 5;
  124. }
  125. message GetActionLogsRequest {
  126. string action_id = 1;
  127. int64 start_offset = 2;
  128. }
  129. message GetActionLogsResponse {
  130. repeated LogEntry logs = 1;
  131. int64 count_remaining = 2;
  132. int64 page_size = 3;
  133. int64 total_count = 4;
  134. int64 start_offset = 5;
  135. }
  136. message ValidateArgumentTypeRequest {
  137. string value = 1;
  138. string type = 2;
  139. string binding_id = 3;
  140. string argument_name = 4;
  141. }
  142. message ValidateArgumentTypeResponse {
  143. bool valid = 1;
  144. string description = 2;
  145. }
  146. message WatchExecutionRequest {
  147. string execution_tracking_id = 1;
  148. }
  149. message WatchExecutionUpdate {
  150. string update = 1;
  151. }
  152. message ExecutionStatusRequest {
  153. string execution_tracking_id = 1;
  154. string action_id = 2;
  155. }
  156. message ExecutionStatusResponse {
  157. LogEntry log_entry = 1;
  158. }
  159. message WhoAmIRequest {}
  160. message WhoAmIResponse {
  161. string authenticated_user = 1;
  162. string usergroup = 2;
  163. string provider = 3;
  164. repeated string acls = 4;
  165. string sid = 5;
  166. }
  167. message SosReportRequest {}
  168. message SosReportResponse {
  169. string alert = 1;
  170. }
  171. message DumpVarsRequest {}
  172. message DumpVarsResponse {
  173. string alert = 1;
  174. map<string, string> contents = 2;
  175. }
  176. message DebugBinding {
  177. string action_title = 1;
  178. string entity_prefix = 2;
  179. }
  180. message DumpPublicIdActionMapRequest {}
  181. message DumpPublicIdActionMapResponse {
  182. string alert = 1;
  183. map<string, DebugBinding> contents = 2;
  184. }
  185. message GetReadyzRequest {}
  186. message GetReadyzResponse {
  187. string status = 1;
  188. }
  189. message EventStreamRequest {
  190. }
  191. message EventStreamResponse {
  192. oneof event {
  193. EventEntityChanged entity_changed = 2;
  194. EventConfigChanged config_changed = 3;
  195. EventExecutionFinished execution_finished = 4;
  196. EventExecutionStarted execution_started = 5;
  197. EventOutputChunk output_chunk = 6;
  198. }
  199. }
  200. message EventOutputChunk {
  201. string execution_tracking_id = 1;
  202. string output = 2;
  203. }
  204. message EventEntityChanged {}
  205. message EventConfigChanged {}
  206. message EventExecutionFinished {
  207. LogEntry log_entry = 1;
  208. }
  209. message EventExecutionStarted {
  210. LogEntry log_entry = 1;
  211. }
  212. message KillActionRequest {
  213. string execution_tracking_id = 1;
  214. }
  215. message KillActionResponse {
  216. string execution_tracking_id = 1;
  217. bool killed = 2;
  218. bool already_completed = 3;
  219. bool found = 4;
  220. }
  221. message LocalUserLoginRequest {
  222. string username = 1;
  223. string password = 2;
  224. }
  225. message LocalUserLoginResponse {
  226. bool success = 1;
  227. }
  228. message PasswordHashRequest {
  229. string password = 1;
  230. }
  231. message PasswordHashResponse {
  232. string hash = 1;
  233. }
  234. message LogoutRequest {}
  235. message LogoutResponse {
  236. }
  237. message GetDiagnosticsRequest {
  238. }
  239. message GetDiagnosticsResponse {
  240. string SshFoundKey = 1;
  241. string SshFoundConfig = 2;
  242. }
  243. message InitRequest {}
  244. message InitResponse {
  245. bool showFooter = 1;
  246. bool showNavigation = 2;
  247. bool showNewVersions = 3;
  248. string availableVersion = 4;
  249. string currentVersion = 5;
  250. string pageTitle = 6;
  251. string sectionNavigationStyle = 7;
  252. string defaultIconForBack = 8;
  253. bool enableCustomJs = 9;
  254. string authLoginUrl = 10;
  255. bool authLocalLogin = 11;
  256. repeated string styleMods = 12;
  257. repeated OAuth2Provider oAuth2Providers = 13;
  258. repeated AdditionalLink additionalLinks = 14;
  259. repeated string rootDashboards = 15;
  260. string authenticated_user = 16;
  261. string authenticated_user_provider = 17;
  262. EffectivePolicy effective_policy = 18;
  263. string banner_message = 19;
  264. string banner_css = 20;
  265. bool show_diagnostics = 21;
  266. bool show_log_list = 22;
  267. bool login_required = 23;
  268. repeated string available_themes = 24; // List of available theme names
  269. bool show_navigate_on_start_icons = 25;
  270. }
  271. message AdditionalLink {
  272. string title = 1;
  273. string url = 2;
  274. }
  275. message OAuth2Provider {
  276. string title = 1;
  277. string icon = 3;
  278. string key = 4;
  279. }
  280. message GetActionBindingRequest {
  281. string binding_id = 1;
  282. }
  283. message GetActionBindingResponse {
  284. Action action = 1;
  285. }
  286. message GetEntitiesRequest {
  287. }
  288. message GetEntitiesResponse {
  289. repeated EntityDefinition entity_definitions = 1;
  290. }
  291. message EntityDefinition {
  292. string title = 1;
  293. repeated Entity instances = 2;
  294. repeated string used_on_dashboards = 3;
  295. }
  296. message GetEntityRequest {
  297. string unique_key = 1;
  298. string type = 2;
  299. }
  300. message RestartActionRequest {
  301. string execution_tracking_id = 1;
  302. }
  303. service OliveTinApiService {
  304. rpc GetDashboard(GetDashboardRequest) returns (GetDashboardResponse) {}
  305. rpc StartAction(StartActionRequest) returns (StartActionResponse) {}
  306. rpc StartActionAndWait(StartActionAndWaitRequest) returns (StartActionAndWaitResponse) {}
  307. rpc StartActionByGet(StartActionByGetRequest) returns (StartActionByGetResponse) {}
  308. rpc StartActionByGetAndWait(StartActionByGetAndWaitRequest) returns (StartActionByGetAndWaitResponse) {}
  309. rpc RestartAction(RestartActionRequest) returns (StartActionResponse) {}
  310. rpc KillAction(KillActionRequest) returns (KillActionResponse) {}
  311. rpc ExecutionStatus(ExecutionStatusRequest) returns (ExecutionStatusResponse) {}
  312. rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {}
  313. rpc GetActionLogs(GetActionLogsRequest) returns (GetActionLogsResponse) {}
  314. rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {}
  315. rpc WhoAmI(WhoAmIRequest) returns (WhoAmIResponse) {}
  316. rpc SosReport(SosReportRequest) returns (SosReportResponse) {}
  317. rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse) {}
  318. rpc DumpPublicIdActionMap(DumpPublicIdActionMapRequest) returns (DumpPublicIdActionMapResponse) {}
  319. rpc GetReadyz(GetReadyzRequest) returns (GetReadyzResponse) {}
  320. rpc LocalUserLogin(LocalUserLoginRequest) returns (LocalUserLoginResponse) {}
  321. rpc PasswordHash(PasswordHashRequest) returns (PasswordHashResponse) {}
  322. rpc Logout(LogoutRequest) returns (LogoutResponse) {}
  323. rpc EventStream(EventStreamRequest) returns (stream EventStreamResponse) {}
  324. rpc GetDiagnostics(GetDiagnosticsRequest) returns (GetDiagnosticsResponse) {}
  325. rpc Init(InitRequest) returns (InitResponse) {}
  326. rpc GetActionBinding(GetActionBindingRequest) returns (GetActionBindingResponse) {}
  327. rpc GetEntities(GetEntitiesRequest) returns (GetEntitiesResponse) {}
  328. rpc GetEntity(GetEntityRequest) returns (Entity) {}
  329. }