vpn.proto 1.7 KB

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