route/proto/route.proto

139 lines
2.3 KiB
Protocol Buffer

syntax = "proto3";
// option go_package = "git.xeserv.us/xena/route/routerpc/routegrpc;routegrpc";
package route;
// import "google/api/annotations.proto";
message Nil {}
service Routes {
rpc Get(GetRouteRequest) returns (Route) {
// option (google.api.http) = {
// get: "/v1/routes/{host}"
// };
}
rpc GetAll(Nil) returns (GetAllRoutesResponse) {
// option (google.api.http) = {
// get: "/v1/routes"
// };
}
rpc Put(Route) returns (IDResponse) {
// option (google.api.http) = {
// post: "/v1/routes"
// };
}
rpc Delete(Route) returns (IDResponse) {
// option (google.api.http) = {
// delete: "/v1/routes/{host}"
// };
}
}
message GetRouteRequest {
string host = 1;
}
message Route {
string id = 1;
string creator = 2;
string host = 3;
}
message GetAllRoutesResponse {
repeated Route routes = 1;
}
message IDResponse {
string id = 1;
}
service Tokens {
rpc Get(GetTokenRequest) returns (Token) {
// option (google.api.http) = {
// get: "/v1/tokens/one"
// };
}
rpc GetAll(Nil) returns (TokenSet) {
// option (google.api.http) = {
// get: "/v1/tokens"
// };
}
rpc Put(Token) returns (Token) {
// option (google.api.http) = {
// post: "/v1/tokens"
// };
}
rpc Delete(Token) returns (Nil) {
// option (google.api.http) = {
// delete: "/v1/tokens"
// };
}
rpc Deactivate(Token) returns (Nil) {
// option (google.api.http) = {
// post: "/v1/tokens/deactivate"
// };
}
}
message Token {
string id = 1;
string body = 2;
repeated string scopes = 3;
bool active = 4;
}
message TokenSet {
repeated Token tokens = 1;
}
message GetTokenRequest {
string token = 1;
string id = 2;
}
service Backends {
rpc List(BackendSelector) returns (BackendList) {
// option (google.api.http) = {
// get: "/v1/backends"
// };
}
rpc Kill(BackendID) returns (Nil) {
// option (google.api.http) = {
// post: "/v1/backends/{id}/kill"
// };
}
}
message Backend {
string id = 1;
string proto = 2;
string user = 3;
string domain = 4;
float phi = 5;
string host = 6;
bool usable = 7;
}
message BackendList {
BackendSelector bs = 1;
repeated Backend backends = 2;
}
message BackendSelector {
string domain = 1;
string user = 2;
}
message BackendID {
string id = 1;
}