node.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. syntax = "proto3";
  2. package node;
  3. option go_package = "google.golang.org/protobuf/types/known/nodepb";
  4. service NodeService {
  5. rpc Login(LoginRequest) returns (LoginResponse);
  6. rpc CreateNode(CreateNodeReq) returns (CreateNodeRes);
  7. rpc ReadNode(ReadNodeReq) returns (ReadNodeRes);
  8. rpc UpdateNode(UpdateNodeReq) returns (UpdateNodeRes);
  9. rpc DeleteNode(DeleteNodeReq) returns (DeleteNodeRes);
  10. rpc GetPeers(GetPeersReq) returns (stream GetPeersRes);
  11. rpc CheckIn(CheckInReq) returns (CheckInRes);
  12. }
  13. message LoginRequest {
  14. string macaddress = 1;
  15. string password = 2;
  16. string network = 3;
  17. }
  18. message LoginResponse { string accesstoken = 1; }
  19. message Node {
  20. string id = 1;
  21. string name = 2;
  22. string address = 3;
  23. int32 listenport = 4;
  24. string publickey = 5;
  25. string endpoint = 6;
  26. string macaddress = 7;
  27. string password = 8;
  28. string nodenetwork = 9;
  29. bool ispending = 10;
  30. string postup = 11;
  31. string postdown = 12;
  32. int32 keepalive = 13;
  33. bool saveconfig = 14;
  34. string accesskey = 15;
  35. string interface = 16;
  36. string lastcheckin = 17;
  37. string lastmodified = 18;
  38. int32 checkininterval = 19;
  39. string localaddress = 20;
  40. string postchanges = 21;
  41. string allowedips = 22;
  42. bool islocal = 23;
  43. bool dnsoff = 24;
  44. string localrange = 25;
  45. }
  46. message CheckInResponse {
  47. bool success = 1;
  48. bool needpeerupdate = 2;
  49. bool needconfigupdate = 3;
  50. string nodemessage = 4;
  51. bool ispending = 5;
  52. bool needkeyupdate = 6;
  53. bool needdelete = 7;
  54. }
  55. message PeersResponse {
  56. bool isgateway = 1;
  57. string gatewayrange = 2;
  58. string publickey = 5;
  59. string endpoint = 6;
  60. string address = 3;
  61. int32 listenport = 4;
  62. string localaddress = 7;
  63. int32 keepalive = 13;
  64. }
  65. message CreateNodeReq {
  66. Node node = 1; // Node id blank
  67. }
  68. message CreateNodeRes {
  69. Node node = 1; // Node id filled in
  70. }
  71. message UpdateNodeReq {
  72. Node node = 1;
  73. }
  74. message UpdateNodeRes {
  75. Node node = 1;
  76. }
  77. message ReadNodeReq {
  78. string macaddress = 1;
  79. string network = 2;
  80. }
  81. message ReadNodeRes {
  82. Node node = 1;
  83. }
  84. message DeleteNodeReq {
  85. string macaddress = 1;
  86. string networkName = 2;
  87. }
  88. message DeleteNodeRes {
  89. bool success = 1;
  90. }
  91. message GetPeersReq {
  92. string macaddress = 1;
  93. string network = 2;
  94. }
  95. message GetPeersRes {
  96. PeersResponse peers = 1;
  97. }
  98. message CheckInReq {
  99. Node node = 1;
  100. // bool postchanges = 2;
  101. }
  102. message CheckInRes {
  103. CheckInResponse checkinresponse = 1;
  104. }