olivetin.proto 9.3 KB

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