vpn.proto 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. syntax = "proto3";
  2. package pb;
  3. import "google/api/annotations.proto";
  4. enum VPNProto {
  5. NOPREF = 0;
  6. UDP = 1;
  7. TCP = 2;
  8. }
  9. message VPNStatusRequest {}
  10. message VPNInitRequest {
  11. string hostname = 1;
  12. string port = 2;
  13. VPNProto proto_pref = 3;
  14. string ip_block = 4;
  15. string dns = 5;
  16. string keepalive_period = 6;
  17. string keepalive_timeout = 7;
  18. bool use_lzo = 8;
  19. }
  20. message VPNUpdateRequest {
  21. string ip_block = 1;
  22. string dns = 2;
  23. }
  24. message VPNRestartRequest {}
  25. service VPNService {
  26. rpc Status (VPNStatusRequest) returns (VPNStatusResponse) {
  27. option (google.api.http) = {
  28. get: "/api/v1/vpn/status"
  29. //body: "*"
  30. };}
  31. rpc Init (VPNInitRequest) returns (VPNInitResponse) {
  32. option (google.api.http) = {
  33. post: "/api/v1/vpn/init"
  34. body: "*"
  35. };}
  36. rpc Update (VPNUpdateRequest) returns (VPNUpdateResponse) {
  37. option (google.api.http) = {
  38. post: "/api/v1/vpn/update"
  39. body: "*"
  40. };}
  41. rpc Restart (VPNRestartRequest) returns (VPNRestartResponse) {
  42. option (google.api.http) = {
  43. post: "/api/v1/vpn/restart"
  44. //body: "*"
  45. };}
  46. }
  47. message VPNStatusResponse {
  48. string name = 1;
  49. string serial_number = 2;
  50. string hostname = 3;
  51. string port = 4;
  52. string cert = 5;
  53. string ca_cert = 6;
  54. string net = 7;
  55. string mask = 8;
  56. string created_at = 9;
  57. string proto = 10;
  58. string dns = 11;
  59. string expires_at = 12;
  60. string ca_expires_at = 13;
  61. }
  62. message VPNInitResponse {}
  63. message VPNUpdateResponse {}
  64. message VPNRestartResponse {}