OliveTin.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. syntax = "proto3";
  2. option go_package = "gen/grpc";
  3. import "google/api/annotations.proto";
  4. message Action {
  5. string id = 1;
  6. string title = 2;
  7. string icon = 3;
  8. bool can_exec = 4;
  9. repeated ActionArgument arguments = 5;
  10. bool popup_on_start = 6;
  11. }
  12. message ActionArgument {
  13. string name = 1;
  14. string title = 2;
  15. string type = 3;
  16. string default_value = 4;
  17. repeated ActionArgumentChoice choices = 5;
  18. string description = 6;
  19. }
  20. message ActionArgumentChoice {
  21. string value = 1;
  22. string title = 2;
  23. }
  24. message Entity {
  25. string title = 1;
  26. string icon = 2;
  27. repeated Action actions = 3;
  28. }
  29. message GetDashboardComponentsResponse {
  30. string title = 1;
  31. repeated Action actions = 2;
  32. repeated Entity entities = 3;
  33. }
  34. message GetDashboardComponentsRequest {}
  35. message StartActionRequest {
  36. string action_name = 1;
  37. repeated StartActionArgument arguments = 2;
  38. string uuid = 3;
  39. }
  40. message StartActionArgument {
  41. string name = 1;
  42. string value = 2;
  43. }
  44. message StartActionResponse {
  45. string execution_uuid = 2;
  46. }
  47. message GetLogsRequest{};
  48. message LogEntry {
  49. string datetime_started = 1;
  50. string action_title = 2;
  51. string stdout = 3;
  52. string stderr = 4;
  53. bool timed_out = 5;
  54. int32 exit_code = 6;
  55. string user = 7;
  56. string user_class = 8;
  57. string action_icon = 9;
  58. repeated string tags = 10;
  59. string execution_uuid = 11;
  60. string datetime_finished = 12;
  61. string uuid = 13;
  62. bool execution_started = 14;
  63. bool execution_finished = 15;
  64. bool blocked = 16;
  65. }
  66. message GetLogsResponse {
  67. repeated LogEntry logs = 1;
  68. }
  69. message ValidateArgumentTypeRequest {
  70. string value = 1;
  71. string type = 2;
  72. }
  73. message ValidateArgumentTypeResponse {
  74. bool valid = 1;
  75. string description = 2;
  76. }
  77. message WatchExecutionRequest {
  78. string execution_uuid = 1;
  79. }
  80. message WatchExecutionUpdate {
  81. string update = 1;
  82. }
  83. message ExecutionStatusRequest {
  84. string execution_uuid = 1;
  85. }
  86. message ExecutionStatusResponse {
  87. LogEntry log_entry = 1;
  88. }
  89. message WhoAmIRequest {}
  90. message WhoAmIResponse {
  91. string authenticated_user = 1;
  92. }
  93. message SosReportRequest {}
  94. message SosReportResponse {
  95. string alert = 1;
  96. }
  97. service OliveTinApiService {
  98. rpc GetDashboardComponents(GetDashboardComponentsRequest) returns (GetDashboardComponentsResponse) {
  99. option (google.api.http) = {
  100. get: "/api/GetDashboardComponents"
  101. };
  102. }
  103. rpc StartAction(StartActionRequest) returns (StartActionResponse) {
  104. option (google.api.http) = {
  105. post: "/api/StartAction"
  106. body: "*"
  107. };
  108. }
  109. rpc ExecutionStatus(ExecutionStatusRequest) returns (ExecutionStatusResponse) {
  110. option (google.api.http) = {
  111. post: "/api/ExecutionStatus"
  112. body: "*"
  113. };
  114. }
  115. rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {
  116. option (google.api.http) = {
  117. get: "/api/GetLogs"
  118. };
  119. }
  120. rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {
  121. option (google.api.http) = {
  122. post: "/api/ValidateArgumentType"
  123. body: "*"
  124. };
  125. }
  126. rpc WhoAmI(WhoAmIRequest) returns (WhoAmIResponse) {
  127. option (google.api.http) = {
  128. get: "/api/WhoAmI"
  129. };
  130. }
  131. rpc SosReport(SosReportRequest) returns (SosReportResponse) {
  132. option (google.api.http) = {
  133. get: "/api/sosreport"
  134. };
  135. }
  136. }