OliveTin.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 canExec = 4;
  9. repeated ActionArgument arguments = 5;
  10. }
  11. message ActionArgument {
  12. string name = 1;
  13. string title = 2;
  14. string type = 3;
  15. string defaultValue = 4;
  16. repeated ActionArgumentChoice choices = 5;
  17. string description = 6;
  18. }
  19. message ActionArgumentChoice {
  20. string value = 1;
  21. string title = 2;
  22. }
  23. message Entity {
  24. string title = 1;
  25. string icon = 2;
  26. repeated Action actions = 3;
  27. }
  28. message GetDashboardComponentsResponse {
  29. string title = 1;
  30. repeated Action actions = 2;
  31. repeated Entity entities = 3;
  32. }
  33. message GetDashboardComponentsRequest {}
  34. message StartActionRequest {
  35. string actionName = 1;
  36. repeated StartActionArgument arguments = 2;
  37. }
  38. message StartActionArgument {
  39. string name = 1;
  40. string value = 2;
  41. }
  42. message StartActionResponse {
  43. LogEntry logEntry = 1;
  44. }
  45. message GetLogsRequest{};
  46. message LogEntry {
  47. string datetime = 1;
  48. string actionTitle = 2;
  49. string stdout = 3;
  50. string stderr = 4;
  51. bool timedOut = 5;
  52. int32 exitCode = 6;
  53. string user = 7;
  54. string userClass = 8;
  55. string actionIcon = 9;
  56. repeated string tags = 10;
  57. }
  58. message GetLogsResponse {
  59. repeated LogEntry logs = 1;
  60. }
  61. message ValidateArgumentTypeRequest {
  62. string value = 1;
  63. string type = 2;
  64. }
  65. message ValidateArgumentTypeResponse {
  66. bool valid = 1;
  67. string description = 2;
  68. }
  69. message WhoAmIRequest {}
  70. message WhoAmIResponse {
  71. string authenticatedUser = 1;
  72. }
  73. message SosReportRequest {}
  74. message SosReportResponse {
  75. string alert = 1;
  76. }
  77. service OliveTinApi {
  78. rpc GetDashboardComponents(GetDashboardComponentsRequest) returns (GetDashboardComponentsResponse) {
  79. option (google.api.http) = {
  80. get: "/api/GetDashboardComponents"
  81. };
  82. }
  83. rpc StartAction(StartActionRequest) returns (StartActionResponse) {
  84. option (google.api.http) = {
  85. post: "/api/StartAction"
  86. body: "*"
  87. };
  88. }
  89. rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {
  90. option (google.api.http) = {
  91. get: "/api/GetLogs"
  92. };
  93. }
  94. rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {
  95. option (google.api.http) = {
  96. post: "/api/ValidateArgumentType"
  97. body: "*"
  98. };
  99. }
  100. rpc WhoAmI(WhoAmIRequest) returns (WhoAmIResponse) {
  101. option (google.api.http) = {
  102. get: "/api/WhoAmI"
  103. };
  104. }
  105. rpc SosReport(SosReportRequest) returns (SosReportResponse) {
  106. option (google.api.http) = {
  107. get: "/api/sosreport"
  108. };
  109. }
  110. }