olivetin.proto 9.2 KB

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