vpn.proto 1.4 KB

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