mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-08 14:39:09 +02:00
* use libopenapi OpenAPI generator Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * added a handler for v1alpha1/peers Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * wire up request validator Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * wired up spec-based validation Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * use sync validation; set base url to v1alpha1 Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * moved stuff around, extracted runtime libopenapu deps into runtime_tooling Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * testing /peers path params Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fixed tests Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * added user schemas and paths Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * use api validation in tests Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * post-merge fixes Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * deleted tmp command used to test validator integration Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * require request body in post/put requests in order to force validation Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * making linter happy Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * switch to api/v1alpha1 Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * go mod tidy Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * keep the original order of middleware: metrics, cors, then auth Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * return 422 on validation errors Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * cleanups Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * more cleanups Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * v1alpha1 spec cleanups Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * no need for a double-pointer Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * more linter fixes Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * removed more double pointers Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * use di to inject api_v0 and api_v1 http routers Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * do not re-add middleware on repeated call to ApiHandler Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * calling ApiRouter() now also calls ApiV1Router() Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> --------- Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
94 lines
2.5 KiB
YAML
94 lines
2.5 KiB
YAML
get:
|
|
summary: Retrieve a Peer
|
|
description: Get information about a peer
|
|
tags: [ Peers ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
parameters:
|
|
- in: path
|
|
name: peerId
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The unique identifier of a peer
|
|
responses:
|
|
'200':
|
|
description: A Peer object
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: './components.yaml#/components/schemas/Peer'
|
|
'400':
|
|
"$ref": '../openapi.yaml#/components/responses/bad_request'
|
|
'401':
|
|
"$ref": '../openapi.yaml#/components/responses/requires_authentication'
|
|
'403':
|
|
"$ref": '../openapi.yaml#/components/responses/forbidden'
|
|
'500':
|
|
"$ref": '../openapi.yaml#/components/responses/internal_error'
|
|
put:
|
|
summary: Update a Peer
|
|
description: Update information about a peer
|
|
tags: [ Peers ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
parameters:
|
|
- in: path
|
|
name: peerId
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The unique identifier of a peer
|
|
requestBody:
|
|
description: update a peer
|
|
required: true
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: './components.yaml#/components/schemas/PeerRequest'
|
|
responses:
|
|
'200':
|
|
description: A Peer object
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: './components.yaml#/components/schemas/Peer'
|
|
'400':
|
|
"$ref": '../openapi.yaml#/components/responses/bad_request'
|
|
'401':
|
|
"$ref": '../openapi.yaml#/components/responses/requires_authentication'
|
|
'403':
|
|
"$ref": '../openapi.yaml#/components/responses/forbidden'
|
|
'422':
|
|
"$ref": "../openapi.yaml#/components/responses/unprocessable"
|
|
'500':
|
|
"$ref": '../openapi.yaml#/components/responses/internal_error'
|
|
delete:
|
|
summary: Delete a Peer
|
|
description: Delete a peer
|
|
tags: [ Peers ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
parameters:
|
|
- in: path
|
|
name: peerId
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The unique identifier of a peer
|
|
responses:
|
|
'200':
|
|
description: Delete status code
|
|
content: { }
|
|
'400':
|
|
"$ref": '../openapi.yaml#/components/responses/bad_request'
|
|
'401':
|
|
"$ref": '../openapi.yaml#/components/responses/requires_authentication'
|
|
'403':
|
|
"$ref": '../openapi.yaml#/components/responses/forbidden'
|
|
'500':
|
|
"$ref": '../openapi.yaml#/components/responses/internal_error'
|