vpn.swagger.json 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "vpn.proto",
  5. "version": "version not set"
  6. },
  7. "schemes": [
  8. "http",
  9. "https"
  10. ],
  11. "consumes": [
  12. "application/json"
  13. ],
  14. "produces": [
  15. "application/json"
  16. ],
  17. "paths": {
  18. "/api/v1/vpn/init": {
  19. "post": {
  20. "operationId": "Init",
  21. "responses": {
  22. "200": {
  23. "description": "",
  24. "schema": {
  25. "$ref": "#/definitions/pbVPNInitResponse"
  26. }
  27. }
  28. },
  29. "parameters": [
  30. {
  31. "name": "body",
  32. "in": "body",
  33. "required": true,
  34. "schema": {
  35. "$ref": "#/definitions/pbVPNInitRequest"
  36. }
  37. }
  38. ],
  39. "tags": [
  40. "VPNService"
  41. ]
  42. }
  43. },
  44. "/api/v1/vpn/status": {
  45. "get": {
  46. "operationId": "Status",
  47. "responses": {
  48. "200": {
  49. "description": "",
  50. "schema": {
  51. "$ref": "#/definitions/pbVPNStatusResponse"
  52. }
  53. }
  54. },
  55. "tags": [
  56. "VPNService"
  57. ]
  58. }
  59. },
  60. "/api/v1/vpn/update": {
  61. "post": {
  62. "operationId": "Update",
  63. "responses": {
  64. "200": {
  65. "description": "",
  66. "schema": {
  67. "$ref": "#/definitions/pbVPNUpdateResponse"
  68. }
  69. }
  70. },
  71. "parameters": [
  72. {
  73. "name": "body",
  74. "in": "body",
  75. "required": true,
  76. "schema": {
  77. "$ref": "#/definitions/pbVPNUpdateRequest"
  78. }
  79. }
  80. ],
  81. "tags": [
  82. "VPNService"
  83. ]
  84. }
  85. }
  86. },
  87. "definitions": {
  88. "pbVPNInitRequest": {
  89. "type": "object",
  90. "properties": {
  91. "hostname": {
  92. "type": "string"
  93. },
  94. "port": {
  95. "type": "string"
  96. },
  97. "proto_pref": {
  98. "$ref": "#/definitions/pbVPNProto"
  99. },
  100. "ip_block": {
  101. "type": "string"
  102. },
  103. "dns": {
  104. "type": "string"
  105. }
  106. }
  107. },
  108. "pbVPNInitResponse": {
  109. "type": "object"
  110. },
  111. "pbVPNProto": {
  112. "type": "string",
  113. "enum": [
  114. "NOPREF",
  115. "UDP",
  116. "TCP"
  117. ],
  118. "default": "NOPREF"
  119. },
  120. "pbVPNStatusResponse": {
  121. "type": "object",
  122. "properties": {
  123. "name": {
  124. "type": "string"
  125. },
  126. "serial_number": {
  127. "type": "string"
  128. },
  129. "hostname": {
  130. "type": "string"
  131. },
  132. "port": {
  133. "type": "string"
  134. },
  135. "cert": {
  136. "type": "string"
  137. },
  138. "ca_cert": {
  139. "type": "string"
  140. },
  141. "net": {
  142. "type": "string"
  143. },
  144. "mask": {
  145. "type": "string"
  146. },
  147. "created_at": {
  148. "type": "string"
  149. },
  150. "proto": {
  151. "type": "string"
  152. },
  153. "dns": {
  154. "type": "string"
  155. }
  156. }
  157. },
  158. "pbVPNUpdateRequest": {
  159. "type": "object",
  160. "properties": {
  161. "ip_block": {
  162. "type": "string"
  163. },
  164. "dns": {
  165. "type": "string"
  166. }
  167. }
  168. },
  169. "pbVPNUpdateResponse": {
  170. "type": "object"
  171. }
  172. }
  173. }