2017-01-26 15:51:22 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2017-01-27 02:43:17 +00:00
|
|
|
// option go_package = "git.xeserv.us/xena/route/routerpc/routegrpc;routegrpc";
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
package route;
|
|
|
|
|
2017-01-26 15:51:22 +00:00
|
|
|
import "google/api/annotations.proto";
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message Nil {}
|
2017-01-26 15:51:22 +00:00
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
service Routes {
|
|
|
|
rpc Get(GetRouteRequest) returns (Route) {
|
2017-01-26 15:51:22 +00:00
|
|
|
option (google.api.http) = {
|
2017-04-28 21:56:52 +00:00
|
|
|
get: "/v1/routes/{host}"
|
2017-01-26 15:51:22 +00:00
|
|
|
};
|
|
|
|
}
|
2017-04-28 21:56:52 +00:00
|
|
|
|
|
|
|
rpc GetAll(Nil) returns (GetAllRoutesResponse) {
|
2017-01-26 15:51:22 +00:00
|
|
|
option (google.api.http) = {
|
2017-04-28 21:56:52 +00:00
|
|
|
get: "/v1/routes"
|
2017-01-26 15:51:22 +00:00
|
|
|
};
|
|
|
|
}
|
2017-04-28 21:56:52 +00:00
|
|
|
|
|
|
|
rpc Put(Route) returns (IDResponse) {
|
2017-01-26 15:51:22 +00:00
|
|
|
option (google.api.http) = {
|
2017-04-28 21:56:52 +00:00
|
|
|
post: "/v1/routes"
|
2017-01-26 15:51:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
rpc Delete(Route) returns (IDResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
delete: "/v1/routes/{host}"
|
|
|
|
};
|
|
|
|
}
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message GetRouteRequest {
|
|
|
|
string host = 1;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message Route {
|
2017-01-26 15:51:22 +00:00
|
|
|
string id = 1;
|
2017-04-28 21:56:52 +00:00
|
|
|
string creator = 2;
|
|
|
|
string host = 3;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message GetAllRoutesResponse {
|
|
|
|
repeated Route routes = 1;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message IDResponse {
|
|
|
|
string id = 1;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service Tokens {
|
2017-04-28 21:56:52 +00:00
|
|
|
rpc Get(GetTokenRequest) returns (Token) {
|
2017-01-26 15:51:22 +00:00
|
|
|
option (google.api.http) = {
|
2017-04-28 21:56:52 +00:00
|
|
|
get: "/v1/tokens/one"
|
2017-01-26 15:51:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
rpc GetAll(Nil) returns (TokenSet) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/tokens"
|
|
|
|
};
|
|
|
|
}
|
2017-01-26 15:51:22 +00:00
|
|
|
|
2017-04-29 02:47:24 +00:00
|
|
|
rpc Put(Token) returns (Token) {
|
2017-04-28 21:56:52 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
post: "/v1/tokens"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
rpc Delete(Token) returns (Nil) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
delete: "/v1/tokens"
|
|
|
|
};
|
|
|
|
}
|
2017-01-26 15:51:22 +00:00
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
rpc Deactivate(Token) returns (Nil) {
|
2017-01-26 15:51:22 +00:00
|
|
|
option (google.api.http) = {
|
2017-04-28 21:56:52 +00:00
|
|
|
post: "/v1/tokens/deactivate"
|
2017-01-26 15:51:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message Token {
|
|
|
|
string id = 1;
|
|
|
|
string body = 2;
|
|
|
|
repeated string scopes = 3;
|
|
|
|
bool active = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TokenSet {
|
|
|
|
repeated Token tokens = 1;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message GetTokenRequest {
|
2017-01-26 15:51:22 +00:00
|
|
|
string token = 1;
|
2017-04-28 21:56:52 +00:00
|
|
|
string id = 2;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|