olivetin.proto 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. syntax = "proto3";
  2. package olivetin.api.v1;
  3. option go_package = "github.com/jamesread/OliveTin/gen/grpc/olivetin/api/v1;apiv1";
  4. import "google/api/annotations.proto";
  5. import "google/api/httpbody.proto";
  6. message Action {
  7. string id = 1;
  8. string title = 2;
  9. string icon = 3;
  10. bool can_exec = 4;
  11. repeated ActionArgument arguments = 5;
  12. string popup_on_start = 6;
  13. int32 order = 7;
  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. }
  24. message ActionArgumentChoice {
  25. string value = 1;
  26. string title = 2;
  27. }
  28. message Entity {
  29. string title = 1;
  30. string icon = 2;
  31. repeated Action actions = 3;
  32. }
  33. message GetDashboardComponentsResponse {
  34. string title = 1;
  35. repeated Action actions = 2;
  36. repeated Entity entities = 3;
  37. repeated DashboardComponent dashboards = 4;
  38. string authenticated_user = 5;
  39. string authenticated_user_provider = 6;
  40. EffectivePolicy effective_policy = 7;
  41. Diagnostics diagnostics = 8;
  42. }
  43. message Diagnostics {
  44. string SshFoundKey = 1;
  45. string SshFoundConfig = 2;
  46. }
  47. message EffectivePolicy {
  48. bool show_diagnostics = 1;
  49. bool show_log_list = 2;
  50. }
  51. message GetDashboardComponentsRequest {}
  52. message DashboardComponent {
  53. string title = 1;
  54. string type = 2;
  55. repeated DashboardComponent contents = 3;
  56. string icon = 4;
  57. string css_class = 5;
  58. }
  59. message StartActionRequest {
  60. string action_id = 1;
  61. repeated StartActionArgument arguments = 2;
  62. string unique_tracking_id = 3;
  63. }
  64. message StartActionArgument {
  65. string name = 1;
  66. string value = 2;
  67. }
  68. message StartActionResponse {
  69. string execution_tracking_id = 2;
  70. }
  71. message StartActionAndWaitRequest {
  72. string action_id = 1;
  73. repeated StartActionArgument arguments = 2;
  74. }
  75. message StartActionAndWaitResponse {
  76. LogEntry log_entry = 1;
  77. }
  78. message StartActionByGetRequest {
  79. string action_id = 1;
  80. }
  81. message StartActionByGetResponse {
  82. string execution_tracking_id = 2;
  83. }
  84. message StartActionByGetAndWaitRequest {
  85. string action_id = 1;
  86. }
  87. message StartActionByGetAndWaitResponse {
  88. LogEntry log_entry = 1;
  89. }
  90. message GetLogsRequest{
  91. int64 start_offset = 1;
  92. };
  93. message LogEntry {
  94. string datetime_started = 1;
  95. string action_title = 2;
  96. string output = 3;
  97. bool timed_out = 5;
  98. int32 exit_code = 6;
  99. string user = 7;
  100. string user_class = 8;
  101. string action_icon = 9;
  102. repeated string tags = 10;
  103. string execution_tracking_id = 11;
  104. string datetime_finished = 12;
  105. string action_id = 13;
  106. bool execution_started = 14;
  107. bool execution_finished = 15;
  108. bool blocked = 16;
  109. int64 datetime_index = 17;
  110. bool can_kill = 18;
  111. }
  112. message GetLogsResponse {
  113. repeated LogEntry logs = 1;
  114. int64 count_remaining = 2;
  115. int64 page_size = 3;
  116. }
  117. message ValidateArgumentTypeRequest {
  118. string value = 1;
  119. string type = 2;
  120. }
  121. message ValidateArgumentTypeResponse {
  122. bool valid = 1;
  123. string description = 2;
  124. }
  125. message WatchExecutionRequest {
  126. string execution_tracking_id = 1;
  127. }
  128. message WatchExecutionUpdate {
  129. string update = 1;
  130. }
  131. message ExecutionStatusRequest {
  132. string execution_tracking_id = 1;
  133. string action_id = 2;
  134. }
  135. message ExecutionStatusResponse {
  136. LogEntry log_entry = 1;
  137. }
  138. message WhoAmIRequest {}
  139. message WhoAmIResponse {
  140. string authenticated_user = 1;
  141. string usergroup = 2;
  142. string provider = 3;
  143. repeated string acls = 4;
  144. string sid = 5;
  145. }
  146. message SosReportRequest {}
  147. message SosReportResponse {
  148. string alert = 1;
  149. }
  150. message DumpVarsRequest {}
  151. message DumpVarsResponse {
  152. string alert = 1;
  153. map<string, string> contents = 2;
  154. }
  155. message ActionEntityPair {
  156. string action_title = 1;
  157. string entity_prefix = 2;
  158. }
  159. message DumpPublicIdActionMapRequest {}
  160. message DumpPublicIdActionMapResponse {
  161. string alert = 1;
  162. map<string, ActionEntityPair> contents = 2;
  163. }
  164. message GetReadyzRequest {}
  165. message GetReadyzResponse {
  166. string status = 1;
  167. }
  168. message EventOutputChunk {
  169. string execution_tracking_id = 1;
  170. string output = 2;
  171. }
  172. message EventEntityChanged {}
  173. message EventConfigChanged {}
  174. message EventExecutionFinished {
  175. LogEntry log_entry = 1;
  176. }
  177. message EventExecutionStarted {
  178. LogEntry log_entry = 1;
  179. }
  180. message KillActionRequest {
  181. string execution_tracking_id = 1;
  182. }
  183. message KillActionResponse {
  184. string execution_tracking_id = 1;
  185. bool killed = 2;
  186. bool already_completed = 3;
  187. bool found = 4;
  188. }
  189. message LocalUserLoginRequest {
  190. string username = 1;
  191. string password = 2;
  192. }
  193. message LocalUserLoginResponse {
  194. bool success = 1;
  195. }
  196. message PasswordHashRequest {
  197. string password = 1;
  198. }
  199. message PasswordHashResponse {
  200. }
  201. message LogoutRequest {}
  202. service OliveTinApiService {
  203. rpc GetDashboardComponents(GetDashboardComponentsRequest) returns (GetDashboardComponentsResponse) {
  204. option (google.api.http) = {
  205. get: "/api/GetDashboardComponents"
  206. };
  207. }
  208. rpc StartAction(StartActionRequest) returns (StartActionResponse) {
  209. option (google.api.http) = {
  210. post: "/api/StartAction"
  211. body: "*"
  212. };
  213. }
  214. rpc StartActionAndWait(StartActionAndWaitRequest) returns (StartActionAndWaitResponse) {
  215. option (google.api.http) = {
  216. post: "/api/StartActionAndWait"
  217. body: "*"
  218. };
  219. }
  220. rpc StartActionByGet(StartActionByGetRequest) returns (StartActionByGetResponse) {
  221. option (google.api.http) = {
  222. get: "/api/StartActionByGet/{action_id}"
  223. };
  224. }
  225. rpc StartActionByGetAndWait(StartActionByGetAndWaitRequest) returns (StartActionByGetAndWaitResponse) {
  226. option (google.api.http) = {
  227. get: "/api/StartActionByGetAndWait/{action_id}"
  228. };
  229. }
  230. rpc KillAction(KillActionRequest) returns (KillActionResponse) {
  231. option (google.api.http) = {
  232. post: "/api/KillAction"
  233. body: "*"
  234. };
  235. }
  236. rpc ExecutionStatus(ExecutionStatusRequest) returns (ExecutionStatusResponse) {
  237. option (google.api.http) = {
  238. post: "/api/ExecutionStatus"
  239. body: "*"
  240. };
  241. }
  242. rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {
  243. option (google.api.http) = {
  244. get: "/api/GetLogs"
  245. };
  246. }
  247. rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {
  248. option (google.api.http) = {
  249. post: "/api/ValidateArgumentType"
  250. body: "*"
  251. };
  252. }
  253. rpc WhoAmI(WhoAmIRequest) returns (WhoAmIResponse) {
  254. option (google.api.http) = {
  255. get: "/api/WhoAmI"
  256. };
  257. }
  258. rpc SosReport(SosReportRequest) returns (google.api.HttpBody) {
  259. option (google.api.http) = {
  260. get: "/api/sosreport"
  261. };
  262. }
  263. rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse) {
  264. option (google.api.http) = {
  265. get: "/api/DumpVars"
  266. };
  267. }
  268. rpc DumpPublicIdActionMap(DumpPublicIdActionMapRequest) returns (DumpPublicIdActionMapResponse) {
  269. option (google.api.http) = {
  270. get: "/api/DumpActionMap"
  271. };
  272. }
  273. rpc GetReadyz(GetReadyzRequest) returns (GetReadyzResponse) {
  274. option (google.api.http) = {
  275. get: "/api/readyz"
  276. };
  277. }
  278. rpc LocalUserLogin(LocalUserLoginRequest) returns (LocalUserLoginResponse) {
  279. option (google.api.http) = {
  280. post: "/api/LocalUserLogin"
  281. body: "*"
  282. };
  283. }
  284. rpc PasswordHash(PasswordHashRequest) returns (google.api.HttpBody) {
  285. option (google.api.http) = {
  286. post: "/api/PasswordHash"
  287. body: "*"
  288. };
  289. }
  290. rpc Logout(LogoutRequest) returns (google.api.HttpBody) {
  291. option (google.api.http) = {
  292. get: "/api/Logout"
  293. };
  294. }
  295. }