1
0

vpn.swagger.json 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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/restart": {
  45. "post": {
  46. "operationId": "Restart",
  47. "responses": {
  48. "200": {
  49. "description": "",
  50. "schema": {
  51. "$ref": "#/definitions/pbVPNRestartResponse"
  52. }
  53. }
  54. },
  55. "tags": [
  56. "VPNService"
  57. ]
  58. }
  59. },
  60. "/api/v1/vpn/status": {
  61. "get": {
  62. "operationId": "Status",
  63. "responses": {
  64. "200": {
  65. "description": "",
  66. "schema": {
  67. "$ref": "#/definitions/pbVPNStatusResponse"
  68. }
  69. }
  70. },
  71. "tags": [
  72. "VPNService"
  73. ]
  74. }
  75. },
  76. "/api/v1/vpn/update": {
  77. "post": {
  78. "operationId": "Update",
  79. "responses": {
  80. "200": {
  81. "description": "",
  82. "schema": {
  83. "$ref": "#/definitions/pbVPNUpdateResponse"
  84. }
  85. }
  86. },
  87. "parameters": [
  88. {
  89. "name": "body",
  90. "in": "body",
  91. "required": true,
  92. "schema": {
  93. "$ref": "#/definitions/pbVPNUpdateRequest"
  94. }
  95. }
  96. ],
  97. "tags": [
  98. "VPNService"
  99. ]
  100. }
  101. }
  102. },
  103. "definitions": {
  104. "pbVPNInitRequest": {
  105. "type": "object",
  106. "properties": {
  107. "hostname": {
  108. "type": "string"
  109. },
  110. "port": {
  111. "type": "string"
  112. },
  113. "proto_pref": {
  114. "$ref": "#/definitions/pbVPNProto"
  115. },
  116. "ip_block": {
  117. "type": "string"
  118. },
  119. "dns": {
  120. "type": "string"
  121. }
  122. }
  123. },
  124. "pbVPNInitResponse": {
  125. "type": "object"
  126. },
  127. "pbVPNProto": {
  128. "type": "string",
  129. "enum": [
  130. "NOPREF",
  131. "UDP",
  132. "TCP"
  133. ],
  134. "default": "NOPREF"
  135. },
  136. "pbVPNRestartResponse": {
  137. "type": "object"
  138. },
  139. "pbVPNStatusResponse": {
  140. "type": "object",
  141. "properties": {
  142. "name": {
  143. "type": "string"
  144. },
  145. "serial_number": {
  146. "type": "string"
  147. },
  148. "hostname": {
  149. "type": "string"
  150. },
  151. "port": {
  152. "type": "string"
  153. },
  154. "cert": {
  155. "type": "string"
  156. },
  157. "ca_cert": {
  158. "type": "string"
  159. },
  160. "net": {
  161. "type": "string"
  162. },
  163. "mask": {
  164. "type": "string"
  165. },
  166. "created_at": {
  167. "type": "string"
  168. },
  169. "proto": {
  170. "type": "string"
  171. },
  172. "dns": {
  173. "type": "string"
  174. }
  175. }
  176. },
  177. "pbVPNUpdateRequest": {
  178. "type": "object",
  179. "properties": {
  180. "ip_block": {
  181. "type": "string"
  182. },
  183. "dns": {
  184. "type": "string"
  185. }
  186. }
  187. },
  188. "pbVPNUpdateResponse": {
  189. "type": "object"
  190. }
  191. }
  192. }