vpn.proto 1.6 KB

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