olivetin/OliveTin.proto

215 lines
4.0 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "gen/grpc";
import "google/api/annotations.proto";
message Action {
string id = 1;
string title = 2;
string icon = 3;
bool can_exec = 4;
repeated ActionArgument arguments = 5;
bool popup_on_start = 6;
}
message ActionArgument {
string name = 1;
string title = 2;
string type = 3;
string default_value = 4;
repeated ActionArgumentChoice choices = 5;
string description = 6;
}
message ActionArgumentChoice {
string value = 1;
string title = 2;
}
message Entity {
string title = 1;
string icon = 2;
repeated Action actions = 3;
}
message GetDashboardComponentsResponse {
string title = 1;
repeated Action actions = 2;
repeated Entity entities = 3;
}
message GetDashboardComponentsRequest {}
message StartActionRequest {
string action_name = 1;
repeated StartActionArgument arguments = 2;
string uuid = 3;
}
message StartActionArgument {
string name = 1;
string value = 2;
}
message StartActionResponse {
string execution_uuid = 2;
}
message StartActionAndWaitRequest {
string action_name = 1;
}
message StartActionAndWaitResponse {
LogEntry log_entry = 1;
}
message StartActionByAliasRequest {
string action_alias = 1;
}
message StartActionByAliasResponse {
string execution_uuid = 2;
}
message StartActionByAliasAndWaitRequest {
string action_alias = 1;
}
message StartActionByAliasAndWaitResponse {
LogEntry log_entry = 1;
}
message GetLogsRequest{};
message LogEntry {
string datetime_started = 1;
string action_title = 2;
string stdout = 3;
string stderr = 4;
bool timed_out = 5;
int32 exit_code = 6;
string user = 7;
string user_class = 8;
string action_icon = 9;
repeated string tags = 10;
string execution_uuid = 11;
string datetime_finished = 12;
string uuid = 13;
bool execution_started = 14;
bool execution_finished = 15;
bool blocked = 16;
}
message GetLogsResponse {
repeated LogEntry logs = 1;
}
message ValidateArgumentTypeRequest {
string value = 1;
string type = 2;
}
message ValidateArgumentTypeResponse {
bool valid = 1;
string description = 2;
}
message WatchExecutionRequest {
string execution_uuid = 1;
}
message WatchExecutionUpdate {
string update = 1;
}
message ExecutionStatusRequest {
string execution_uuid = 1;
}
message ExecutionStatusResponse {
LogEntry log_entry = 1;
}
message WhoAmIRequest {}
message WhoAmIResponse {
string authenticated_user = 1;
}
message SosReportRequest {}
message SosReportResponse {
string alert = 1;
}
service OliveTinApiService {
rpc GetDashboardComponents(GetDashboardComponentsRequest) returns (GetDashboardComponentsResponse) {
option (google.api.http) = {
get: "/api/GetDashboardComponents"
};
}
rpc StartAction(StartActionRequest) returns (StartActionResponse) {
option (google.api.http) = {
post: "/api/StartAction"
body: "*"
};
}
rpc StartActionAndWait(StartActionAndWaitRequest) returns (StartActionAndWaitResponse) {
option (google.api.http) = {
post: "/api/StartActionAndWait"
body: "*"
};
}
rpc StartActionByAlias(StartActionByAliasRequest) returns (StartActionByAliasResponse) {
option (google.api.http) = {
get: "/api/StartActionByAlias/{action_alias}"
};
}
rpc StartActionByAliasAndWait(StartActionByAliasAndWaitRequest) returns (StartActionByAliasAndWaitResponse) {
option (google.api.http) = {
get: "/api/StartActionByAliasAndWait/{action_alias}"
};
}
rpc ExecutionStatus(ExecutionStatusRequest) returns (ExecutionStatusResponse) {
option (google.api.http) = {
post: "/api/ExecutionStatus"
body: "*"
};
}
rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {
option (google.api.http) = {
get: "/api/GetLogs"
};
}
rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {
option (google.api.http) = {
post: "/api/ValidateArgumentType"
body: "*"
};
}
rpc WhoAmI(WhoAmIRequest) returns (WhoAmIResponse) {
option (google.api.http) = {
get: "/api/WhoAmI"
};
}
rpc SosReport(SosReportRequest) returns (SosReportResponse) {
option (google.api.http) = {
get: "/api/sosreport"
};
}
}