vpn.proto 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 Protopref = 3;
  14. string IPBlock = 4;
  15. string DNS = 5;
  16. }
  17. message VPNUpdateRequest {
  18. string IPBlock = 1;
  19. string DNS = 2;
  20. }
  21. service VPNService {
  22. rpc Status (VPNStatusRequest) returns (VPNStatusResponse) {
  23. option (google.api.http) = {
  24. post: "/v1/vpn/status"
  25. body: "*"
  26. };}
  27. rpc Init (VPNInitRequest) returns (VPNInitResponse) {
  28. option (google.api.http) = {
  29. post: "/v1/vpn/init"
  30. body: "*"
  31. };}
  32. rpc Update (VPNUpdateRequest) returns (VPNUpdateResponse) {
  33. option (google.api.http) = {
  34. post: "/v1/vpn/update"
  35. body: "*"
  36. };}
  37. }
  38. message VPNStatusResponse {
  39. string Name = 1;
  40. string SerialNumber = 2;
  41. string Hostname = 3;
  42. string Port = 4;
  43. string Cert = 5;
  44. string CACert = 6;
  45. string Net = 7;
  46. string Mask = 8;
  47. string CreatedAt = 9;
  48. string Proto = 10;
  49. string DNS = 11;
  50. }
  51. message VPNInitResponse {}
  52. message VPNUpdateResponse {}