diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..9d30304 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,1779 @@ + + +

FastAPI v0.1.0

+ +> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu. + +# Authentication + +- oAuth2 authentication. + + - Flow: password + + - Token URL = [/api/v1/login](/api/v1/login) + +|Scope|Scope Description| +|---|---| + +

Default

+ +## root__get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json' +} + +r = requests.get('/', headers = headers) + +print(r.json()) + +``` + +`GET /` + +*Root* + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| + +

Response Schema

+ + + +

user

+ +## logout_api_v1_logout_get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.get('/api/v1/logout', headers = headers) + +print(r.json()) + +``` + +`GET /api/v1/logout` + +*Logout* + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| + +

Response Schema

+ + + +## edit_api_v1_user_edit_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/user/edit', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/user/edit` + +*Edit* + +> Body parameter + +```json +{ + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string", + "password": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[UserInDB](#schemauserindb)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[User](#schemauser)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## login_api_v1_login_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Accept': 'application/json' +} + +r = requests.post('/api/v1/login', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/login` + +*Login* + +> Body parameter + +```yaml +username: string +password: string + +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[Body_login_api_v1_login_post](#schemabody_login_api_v1_login_post)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "access_token": "string", + "token_type": "string", + "user": { + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string" + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[Token](#schematoken)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## create_user_api_v1_users_create__post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/users/create/', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/users/create/` + +*Create User* + +> Body parameter + +```json +{ + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string", + "password": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[UserInDB](#schemauserindb)|true|none| + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + +

Response Schema

+ + + +

server

+ +## servers_all_api_v1_server_all_get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.get('/api/v1/server/all', headers = headers) + +print(r.json()) + +``` + +`GET /api/v1/server/all` + +*Servers All* + +> Example responses + +> 200 Response + +```json +[ + { + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] + } +] +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| + +

Response Schema

+ +Status Code **200** + +*Response Servers All Api V1 Server All Get* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|Response Servers All Api V1 Server All Get|[[WGServer](#schemawgserver)]|false|none|none| +|» WGServer|[WGServer](#schemawgserver)|false|none|none| +|»» id|integer|false|none|none| +|»» address|string|false|none|none| +|»» v6_address|string|false|none|none| +|»» subnet|integer|false|none|none| +|»» v6_subnet|integer|false|none|none| +|»» interface|string|true|none|none| +|»» listen_port|integer|false|none|none| +|»» endpoint|string|false|none|none| +|»» private_key|string|false|none|none| +|»» public_key|string|false|none|none| +|»» is_running|boolean|false|none|none| +|»» configuration|string|false|none|none| +|»» post_up|string|false|none|none| +|»» post_down|string|false|none|none| +|»» dns|string|false|none|none| +|»» peers|[[WGPeer](#schemawgpeer)]|false|none|none| +|»»» WGPeer|[WGPeer](#schemawgpeer)|false|none|none| +|»»»» id|integer|false|none|none| +|»»»» name|string|false|none|none| +|»»»» address|string|false|none|none| +|»»»» v6_address|string|false|none|none| +|»»»» private_key|string|false|none|none| +|»»»» public_key|string|false|none|none| +|»»»» shared_key|string|false|none|none| +|»»»» server_id|string|true|none|none| +|»»»» dns|string|false|none|none| +|»»»» allowed_ips|string|false|none|none| +|»»»» configuration|string|false|none|none| + + + +## add_interface_api_v1_server_add_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/add', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/add` + +*Add Interface* + +> Body parameter + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGServerAdd](#schemawgserveradd)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGServer](#schemawgserver)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## stop_server_api_v1_server_stop_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/stop', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/stop` + +*Stop Server* + +> Body parameter + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGServer](#schemawgserver)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGServer](#schemawgserver)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## start_server_api_v1_server_start_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/start', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/start` + +*Start Server* + +> Body parameter + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGServer](#schemawgserver)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGServer](#schemawgserver)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## restart_server_api_v1_server_restart_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/restart', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/restart` + +*Restart Server* + +> Body parameter + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGServer](#schemawgserver)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGServer](#schemawgserver)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## delete_server_api_v1_server_delete_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/delete', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/delete` + +*Delete Server* + +> Body parameter + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGServer](#schemawgserver)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGServer](#schemawgserver)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## stats_server_api_v1_server_stats_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/stats', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/stats` + +*Stats Server* + +> Body parameter + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGServer](#schemawgserver)|true|none| + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + +

Response Schema

+ + + +## edit_server_api_v1_server_edit_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/server/edit', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/server/edit` + +*Edit Server* + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|object|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGServer](#schemawgserver)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## server_config_api_v1_server_config__server_id__get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.get('/api/v1/server/config/{server_id}', headers = headers) + +print(r.json()) + +``` + +`GET /api/v1/server/config/{server_id}` + +*Server Config* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|server_id|path|integer|true|none| + +> Example responses + +> 200 Response + +```json +"string" +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|string| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +

peer

+ +## add_peer_api_v1_peer_add_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/peer/add', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/peer/add` + +*Add Peer* + +> Body parameter + +```json +{ + "server_interface": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGPeerAdd](#schemawgpeeradd)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "name": "string", + "address": "string", + "v6_address": "string", + "private_key": "string", + "public_key": "string", + "shared_key": "string", + "server_id": "string", + "dns": "string", + "allowed_ips": "string", + "configuration": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGPeer](#schemawgpeer)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## delete_peer_api_v1_peer_delete_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/peer/delete', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/peer/delete` + +*Delete Peer* + +> Body parameter + +```json +{ + "id": 0, + "name": "string", + "address": "string", + "v6_address": "string", + "private_key": "string", + "public_key": "string", + "shared_key": "string", + "server_id": "string", + "dns": "string", + "allowed_ips": "string", + "configuration": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGPeer](#schemawgpeer)|true|none| + +> Example responses + +> 200 Response + +```json +{ + "id": 0, + "name": "string", + "address": "string", + "v6_address": "string", + "private_key": "string", + "public_key": "string", + "shared_key": "string", + "server_id": "string", + "dns": "string", + "allowed_ips": "string", + "configuration": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[WGPeer](#schemawgpeer)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + + + +## edit_peer_api_v1_peer_edit_post + + + +> Code samples + +```python +import requests +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.post('/api/v1/peer/edit', headers = headers) + +print(r.json()) + +``` + +`POST /api/v1/peer/edit` + +*Edit Peer* + +> Body parameter + +```json +{ + "id": 0, + "name": "string", + "address": "string", + "v6_address": "string", + "private_key": "string", + "public_key": "string", + "shared_key": "string", + "server_id": "string", + "dns": "string", + "allowed_ips": "string", + "configuration": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[WGPeer](#schemawgpeer)|true|none| + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + +

Response Schema

+ + + +

wg

+ +## generate_psk_api_v1_wg_generate_psk_get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.get('/api/v1/wg/generate_psk', headers = headers) + +print(r.json()) + +``` + +`GET /api/v1/wg/generate_psk` + +*Generate Psk* + +> Example responses + +> 200 Response + +```json +{ + "psk": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[PSK](#schemapsk)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| + + + +## generate_key_pair_api_v1_wg_generate_keypair_get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.get('/api/v1/wg/generate_keypair', headers = headers) + +print(r.json()) + +``` + +`GET /api/v1/wg/generate_keypair` + +*Generate Key Pair* + +> Example responses + +> 200 Response + +```json +{ + "public_key": "string", + "private_key": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|[KeyPair](#schemakeypair)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found|None| + + + +# Schemas + +

Body_login_api_v1_login_post

+ + + + + + +```json +{ + "username": "string", + "password": "string" +} + +``` + +Body_login_api_v1_login_post + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|username|string|true|none|none| +|password|string|true|none|none| + +

HTTPValidationError

+ + + + + + +```json +{ + "detail": [ + { + "loc": [ + "string" + ], + "msg": "string", + "type": "string" + } + ] +} + +``` + +HTTPValidationError + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|detail|[[ValidationError](#schemavalidationerror)]|false|none|none| + +

KeyPair

+ + + + + + +```json +{ + "public_key": "string", + "private_key": "string" +} + +``` + +KeyPair + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|public_key|string|true|none|none| +|private_key|string|true|none|none| + +

PSK

+ + + + + + +```json +{ + "psk": "string" +} + +``` + +PSK + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|psk|string|true|none|none| + +

Token

+ + + + + + +```json +{ + "access_token": "string", + "token_type": "string", + "user": { + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string" + } +} + +``` + +Token + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|access_token|string|true|none|none| +|token_type|string|true|none|none| +|user|[User](#schemauser)|true|none|none| + +

User

+ + + + + + +```json +{ + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string" +} + +``` + +User + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|integer|false|none|none| +|username|string|true|none|none| +|email|string|false|none|none| +|full_name|string|false|none|none| +|role|string|false|none|none| + +

UserInDB

+ + + + + + +```json +{ + "id": 0, + "username": "string", + "email": "string", + "full_name": "string", + "role": "string", + "password": "string" +} + +``` + +UserInDB + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|integer|false|none|none| +|username|string|true|none|none| +|email|string|false|none|none| +|full_name|string|false|none|none| +|role|string|false|none|none| +|password|string|true|none|none| + +

ValidationError

+ + + + + + +```json +{ + "loc": [ + "string" + ], + "msg": "string", + "type": "string" +} + +``` + +ValidationError + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|loc|[string]|true|none|none| +|msg|string|true|none|none| +|type|string|true|none|none| + +

WGPeer

+ + + + + + +```json +{ + "id": 0, + "name": "string", + "address": "string", + "v6_address": "string", + "private_key": "string", + "public_key": "string", + "shared_key": "string", + "server_id": "string", + "dns": "string", + "allowed_ips": "string", + "configuration": "string" +} + +``` + +WGPeer + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|integer|false|none|none| +|name|string|false|none|none| +|address|string|false|none|none| +|v6_address|string|false|none|none| +|private_key|string|false|none|none| +|public_key|string|false|none|none| +|shared_key|string|false|none|none| +|server_id|string|true|none|none| +|dns|string|false|none|none| +|allowed_ips|string|false|none|none| +|configuration|string|false|none|none| + +

WGPeerAdd

+ + + + + + +```json +{ + "server_interface": "string" +} + +``` + +WGPeerAdd + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|server_interface|string|true|none|none| + +

WGServer

+ + + + + + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} + +``` + +WGServer + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|integer|false|none|none| +|address|string|false|none|none| +|v6_address|string|false|none|none| +|subnet|integer|false|none|none| +|v6_subnet|integer|false|none|none| +|interface|string|true|none|none| +|listen_port|integer|false|none|none| +|endpoint|string|false|none|none| +|private_key|string|false|none|none| +|public_key|string|false|none|none| +|is_running|boolean|false|none|none| +|configuration|string|false|none|none| +|post_up|string|false|none|none| +|post_down|string|false|none|none| +|dns|string|false|none|none| +|peers|[[WGPeer](#schemawgpeer)]|false|none|none| + +

WGServerAdd

+ + + + + + +```json +{ + "id": 0, + "address": "string", + "v6_address": "string", + "subnet": 0, + "v6_subnet": 0, + "interface": "string", + "listen_port": 0, + "endpoint": "string", + "private_key": "string", + "public_key": "string", + "is_running": true, + "configuration": "string", + "post_up": "string", + "post_down": "string", + "dns": "string", + "peers": [] +} + +``` + +WGServerAdd + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|integer|false|none|none| +|address|string|true|none|none| +|v6_address|string|false|none|none| +|subnet|integer|false|none|none| +|v6_subnet|integer|false|none|none| +|interface|string|true|none|none| +|listen_port|integer|true|none|none| +|endpoint|string|false|none|none| +|private_key|string|false|none|none| +|public_key|string|false|none|none| +|is_running|boolean|false|none|none| +|configuration|string|false|none|none| +|post_up|string|false|none|none| +|post_down|string|false|none|none| +|dns|string|false|none|none| +|peers|[[WGPeer](#schemawgpeer)]|false|none|none| +