Files
EvoBGP/migrations/sqlite/000031_peer_discovery.up.sql
T
Denozordec 5fbe9c9b56
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
feat(network): implement peer discovery features and UI integration
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.
2026-07-30 22:31:59 +07:00

31 lines
1.5 KiB
SQL

-- Peer auto-discovery pending / rejected / approved records.
CREATE TABLE IF NOT EXISTS bgp_peer_discovery (
id TEXT PRIMARY KEY NOT NULL,
tenant_id TEXT NOT NULL REFERENCES tenant (id) ON DELETE CASCADE,
speaker_id TEXT REFERENCES bgp_speaker (id) ON DELETE SET NULL,
neighbor_id TEXT NOT NULL DEFAULT '',
neighbor TEXT NOT NULL,
remote_asn INTEGER NOT NULL DEFAULT 0,
protocol_name TEXT NOT NULL DEFAULT '',
session_state TEXT NOT NULL DEFAULT '',
status TEXT NOT NULL DEFAULT 'pending',
first_seen_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
last_seen_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
approved_peer_id TEXT REFERENCES bgp_peer (id) ON DELETE SET NULL,
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
CHECK (status IN ('pending', 'approved', 'rejected'))
);
CREATE INDEX IF NOT EXISTS idx_bgp_peer_discovery_tenant_status
ON bgp_peer_discovery (tenant_id, status);
CREATE UNIQUE INDEX IF NOT EXISTS idx_bgp_peer_discovery_tenant_neighbor_id
ON bgp_peer_discovery (tenant_id, neighbor_id)
WHERE neighbor_id != '';
CREATE UNIQUE INDEX IF NOT EXISTS idx_bgp_peer_discovery_tenant_neighbor_asn
ON bgp_peer_discovery (tenant_id, neighbor, remote_asn)
WHERE neighbor_id = '';