-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-api.yaml
202 lines (195 loc) · 4.15 KB
/
node-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
swagger: "2.0"
info:
title: ForestVPN Node API
description: |
ForestVPN defeats content restrictions and censorship to deliver unlimited access to video, music, social media,
and more, from anywhere in the world.
termsOfService: https://www.forestvpn.com/terms/
contact:
name: Digital Services LLC
url: https://www.forestvpn.com/
email: [email protected]
license:
name: MIT
url: https://opensource.org/licenses/MIT
version: "2.0"
externalDocs:
description: Find more info here
url: https://www.forestvpn.com/
host: api.forestvpn.com
basePath: /internal/v2/
schemes:
- https
- http
consumes:
- application/json
produces:
- application/json
securityDefinitions:
Bearer:
type: apiKey
in: header
name: Authorization
Basic:
type: basic
security:
- Basic: [ ]
paths:
/interfaces/:
get:
summary: List of network interfaces configuration and specs
operationId: InterfaceList
tags:
- network
parameters:
- in: header
name: X-Relay-Hostname
type: string
required: true
responses:
200:
description: ok
schema:
type: array
items:
$ref: "#/definitions/InterfaceSpec"
default:
description: error
schema:
$ref: "#/definitions/Error"
/devices/:
get:
summary: List of device that should be presented on host
operationId: DeviceList
tags:
- device
parameters:
- in: header
name: X-Relay-Hostname
type: string
required: true
responses:
200:
description: ok
schema:
$ref: "#/definitions/DeviceList"
default:
description: error
schema:
$ref: "#/definitions/Error"
/stats/:
post:
summary: Connected devices stats to the API
operationId: DevicesStatsUpdate
tags:
- device
parameters:
- in: body
name: request
schema:
$ref: "#/definitions/DeviceStatsMap"
required: true
- in: header
name: X-Relay-Hostname
type: string
required: true
responses:
200:
description: ok
default:
description: error
schema:
$ref: "#/definitions/Error"
definitions:
Error:
type: object
properties:
code:
type: string
message:
type: string
PortForwarding:
type: object
properties:
src:
type: integer
dst:
type: integer
WireguardSpec:
type: object
properties:
pub_key:
type: string
ps_key:
type: string
endpoint:
type: string
DeviceList:
type: array
items:
$ref: "#/definitions/Device"
Device:
type: object
properties:
fwmark:
type: integer
x-go-name: FwMark
ips:
type: array
items:
type: string
x-go-name: IPs
ports:
type: array
items:
$ref: "#/definitions/PortForwarding"
wireguard:
type: object
$ref: "#/definitions/WireguardSpec"
DeviceStats:
type: object
properties:
connections:
type: integer
description: Number of active connections
received_bytes:
type: integer
transmitted_bytes:
type: integer
DeviceStatsMap:
type: object
additionalProperties:
$ref: "#/definitions/DeviceStats"
DeviceEvent:
type: object
properties:
action:
type: string
enum:
- create
- update
- delete
- update_ports
device:
$ref: "#/definitions/Device"
WireguardInterfaceSpec:
type: object
properties:
priv_key:
type: string
ports:
type: array
items:
type: integer
InterfaceSpec:
type: object
properties:
name:
type: string
ips:
type: array
items:
type: string
x-go-name: IPs
wireguard:
$ref: "#/definitions/WireguardInterfaceSpec"