olivetin/OliveTin.proto

81 lines
1.3 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "gen/grpc";
import "google/api/annotations.proto";
message ActionButton {
string id = 1;
string title = 2;
string icon = 3;
bool canExec = 4;
repeated ActionArgument arguments = 5;
}
message ActionArgument {
string name = 1;
string label = 2;
string type = 3;
string defaultValue = 4;
repeated ActionArgumentChoice choices = 5;
}
message ActionArgumentChoice {
string value = 1;
string label = 2;
}
message GetButtonsResponse {
string title = 1;
repeated ActionButton actions = 2;
}
message GetButtonsRequest {}
message StartActionRequest {
string actionName = 1;
}
message StartActionResponse {
LogEntry logEntry = 1;
}
message GetLogsRequest{};
message LogEntry {
string datetime = 1;
string actionTitle = 2;
string stdout = 3;
string stderr = 4;
bool timedOut = 5;
int32 exitCode = 6;
string user = 7;
string userClass = 8;
}
message GetLogsResponse {
repeated LogEntry logs = 1;
}
service OliveTinApi {
rpc GetButtons(GetButtonsRequest) returns (GetButtonsResponse) {
option (google.api.http) = {
get: "/api/GetButtons"
};
}
rpc StartAction(StartActionRequest) returns (StartActionResponse) {
option (google.api.http) = {
get: "/api/StartAction"
};
}
rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {
option (google.api.http) = {
get: "/api/GetLogs"
};
}
}