mirror of
https://github.com/h44z/wg-portal.git
synced 2026-11-20 20:53:40 +01:00
feat(api): crud for interface backend settings and create default peer flag (#765)
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"description": "This endpoint updates an existing interface with the provided data. All required fields must be filled (e.g. name, private key, public key, ...).",
|
||||
"description": "This endpoint updates an existing interface with the provided data. All required fields must be filled (e.g. name, private key, public key, ...).\nBackend must be a configured backend ID. Omitted Backend and CreateDefaultPeer fields preserve their existing values. Server-managed metadata is preserved.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -246,7 +246,7 @@
|
||||
},
|
||||
"/interface/new": {
|
||||
"post": {
|
||||
"description": "This endpoint creates a new interface with the provided data. All required fields must be filled (e.g. name, private key, public key, ...).",
|
||||
"description": "This endpoint creates a new interface with the provided data. All required fields must be filled (e.g. name, private key, public key, ...).\nBackend must be a configured backend ID. When omitted, the local backend is used. CreateDefaultPeer defaults to false when omitted, preserving legacy create behavior.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -1601,6 +1601,17 @@
|
||||
"10.11.12.1/24"
|
||||
]
|
||||
},
|
||||
"Backend": {
|
||||
"description": "Backend is the configured backend ID used to manage this interface. Omit it on create to use the local backend, or on update to preserve the current backend.",
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"example": "local"
|
||||
},
|
||||
"CreateDefaultPeer": {
|
||||
"description": "CreateDefaultPeer enables default peer creation for this interface. Defaults to false when omitted on create; preserves the current setting when omitted on update.",
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"Disabled": {
|
||||
"description": "Disabled is a flag that specifies if the interface is enabled (up) or not (down). Disabled interfaces are not able to accept connections.",
|
||||
"type": "boolean",
|
||||
|
||||
@@ -52,6 +52,19 @@ definitions:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
Backend:
|
||||
description: Backend is the configured backend ID used to manage this interface.
|
||||
Omit it on create to use the local backend, or on update to preserve the
|
||||
current backend.
|
||||
example: local
|
||||
minLength: 1
|
||||
type: string
|
||||
CreateDefaultPeer:
|
||||
description: CreateDefaultPeer enables default peer creation for this interface.
|
||||
Defaults to false when omitted on create; preserves the current setting
|
||||
when omitted on update.
|
||||
example: false
|
||||
type: boolean
|
||||
Disabled:
|
||||
description: Disabled is a flag that specifies if the interface is enabled
|
||||
(up) or not (down). Disabled interfaces are not able to accept connections.
|
||||
@@ -755,8 +768,9 @@ paths:
|
||||
tags:
|
||||
- Interfaces
|
||||
put:
|
||||
description: This endpoint updates an existing interface with the provided data.
|
||||
All required fields must be filled (e.g. name, private key, public key, ...).
|
||||
description: |-
|
||||
This endpoint updates an existing interface with the provided data. All required fields must be filled (e.g. name, private key, public key, ...).
|
||||
Backend must be a configured backend ID. Omitted Backend and CreateDefaultPeer fields preserve their existing values. Server-managed metadata is preserved.
|
||||
operationId: interfaces_handleUpdatePut
|
||||
parameters:
|
||||
- description: The interface identifier.
|
||||
@@ -804,8 +818,9 @@ paths:
|
||||
- Interfaces
|
||||
/interface/new:
|
||||
post:
|
||||
description: This endpoint creates a new interface with the provided data. All
|
||||
required fields must be filled (e.g. name, private key, public key, ...).
|
||||
description: |-
|
||||
This endpoint creates a new interface with the provided data. All required fields must be filled (e.g. name, private key, public key, ...).
|
||||
Backend must be a configured backend ID. When omitted, the local backend is used. CreateDefaultPeer defaults to false when omitted, preserving legacy create behavior.
|
||||
operationId: interfaces_handleCreatePost
|
||||
parameters:
|
||||
- description: The interface data.
|
||||
|
||||
Reference in New Issue
Block a user