feat(network): implement peer discovery features and UI integration
CI / changes (push) Successful in 6s
CI / commitlint (push) Skipped
CI / openapi (push) Successful in 28s
CI / web (push) Successful in 52s
CI / go (push) Successful in 2m22s
CI / bird2 (push) Successful in 15s
CI / release (push) Successful in 4m36s
CI / changes (push) Successful in 6s
CI / commitlint (push) Skipped
CI / openapi (push) Successful in 28s
CI / web (push) Successful in 52s
CI / go (push) Successful in 2m22s
CI / bird2 (push) Successful in 15s
CI / release (push) Successful in 4m36s
Added functionality for peer discovery, including new API endpoints for listing, approving, and rejecting discovered peers. Updated the network queries and settings to support peer discovery configurations. Enhanced the UI to display discovered peers and integrated related settings in the tenant settings component. Updated OpenAPI documentation to reflect the new endpoints and parameters. This improves the network management capabilities by allowing dynamic peer discovery and management.
This commit is contained in:
@@ -1030,6 +1030,12 @@ components:
|
||||
type: string
|
||||
neighbor:
|
||||
type: string
|
||||
neighbor_as:
|
||||
type: integer
|
||||
description: Remote ASN from birdc (`Neighbor AS:`).
|
||||
neighbor_id:
|
||||
type: string
|
||||
description: BGP Identifier / Neighbor ID from birdc (`Neighbor ID:`).
|
||||
state:
|
||||
type: string
|
||||
additionalProperties: true
|
||||
@@ -1715,6 +1721,51 @@ components:
|
||||
type: string
|
||||
additionalProperties: true
|
||||
|
||||
BgpPeerDiscovery:
|
||||
type: object
|
||||
required: [id, neighbor, status]
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/ResourceId"
|
||||
speaker_id:
|
||||
type: ["string", "null"]
|
||||
neighbor_id:
|
||||
type: string
|
||||
description: BGP Identifier (Neighbor ID / router ID) from birdc.
|
||||
neighbor:
|
||||
type: string
|
||||
description: Neighbor IP address.
|
||||
remote_asn:
|
||||
type: integer
|
||||
protocol_name:
|
||||
type: string
|
||||
description: BIRD protocol name (evobgp_dyn_*).
|
||||
session_state:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
enum: [pending, approved, rejected]
|
||||
first_seen_at:
|
||||
type: string
|
||||
format: date-time
|
||||
last_seen_at:
|
||||
type: string
|
||||
format: date-time
|
||||
approved_peer_id:
|
||||
type: ["string", "null"]
|
||||
additionalProperties: true
|
||||
|
||||
BgpPeerDiscoveryApprove:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
bgp_speaker_id:
|
||||
type: ["string", "null"]
|
||||
enabled:
|
||||
type: boolean
|
||||
additionalProperties: false
|
||||
|
||||
BgpPeerCreate:
|
||||
type: object
|
||||
required: [neighbor, remote_asn]
|
||||
@@ -3100,6 +3151,90 @@ paths:
|
||||
default:
|
||||
$ref: "#/components/responses/DefaultProblem"
|
||||
|
||||
/v1/peers/discovered:
|
||||
get:
|
||||
tags: [Peers]
|
||||
summary: Список обнаруженных (неодобренных) пиров
|
||||
description: >
|
||||
Dynamic BGP-сессии (`evobgp_dyn_*`), которых ещё нет в `bgp_peer`.
|
||||
По умолчанию возвращает `status=pending`. При листинге выполняет live-опрос birdc/agent и upsert pending.
|
||||
operationId: listDiscoveredPeers
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TenantId"
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
enum: [pending, approved, rejected, all]
|
||||
default: pending
|
||||
responses:
|
||||
"200":
|
||||
description: Успешно.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [items]
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/BgpPeerDiscovery"
|
||||
default:
|
||||
$ref: "#/components/responses/DefaultProblem"
|
||||
|
||||
/v1/peers/discovered/{id}/approve:
|
||||
post:
|
||||
tags: [Peers]
|
||||
summary: Одобрить обнаруженного пира
|
||||
description: >
|
||||
Создаёт обычный `bgp_peer` из discovery-записи и запускает `peer_reconcile`.
|
||||
operationId: approveDiscoveredPeer
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TenantId"
|
||||
- $ref: "#/components/parameters/PeerId"
|
||||
- $ref: "#/components/parameters/IdempotencyKey"
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/BgpPeerDiscoveryApprove"
|
||||
responses:
|
||||
"200":
|
||||
description: Пир создан, discovery → approved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
peer:
|
||||
$ref: "#/components/schemas/BgpPeer"
|
||||
discovery:
|
||||
$ref: "#/components/schemas/BgpPeerDiscovery"
|
||||
default:
|
||||
$ref: "#/components/responses/DefaultProblem"
|
||||
|
||||
/v1/peers/discovered/{id}/reject:
|
||||
post:
|
||||
tags: [Peers]
|
||||
summary: Отклонить обнаруженного пира
|
||||
description: Помечает discovery как rejected; повторно не всплывает при sync.
|
||||
operationId: rejectDiscoveredPeer
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TenantId"
|
||||
- $ref: "#/components/parameters/PeerId"
|
||||
- $ref: "#/components/parameters/IdempotencyKey"
|
||||
responses:
|
||||
"200":
|
||||
description: Discovery → rejected.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/BgpPeerDiscovery"
|
||||
default:
|
||||
$ref: "#/components/responses/DefaultProblem"
|
||||
|
||||
/v1/peers/{id}:
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TenantId"
|
||||
|
||||
Reference in New Issue
Block a user