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.
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package store
|
|
|
|
import "time"
|
|
|
|
// PeerDiscoveryStatus values for bgp_peer_discovery.status.
|
|
const (
|
|
PeerDiscoveryPending = "pending"
|
|
PeerDiscoveryApproved = "approved"
|
|
PeerDiscoveryRejected = "rejected"
|
|
)
|
|
|
|
// BGPPeerDiscovery is a live-detected dynamic BGP session awaiting operator action.
|
|
type BGPPeerDiscovery struct {
|
|
ID string `json:"id"`
|
|
TenantID string `json:"tenant_id,omitempty"`
|
|
SpeakerID string `json:"speaker_id,omitempty"`
|
|
NeighborID string `json:"neighbor_id,omitempty"`
|
|
Neighbor string `json:"neighbor"`
|
|
RemoteASN int64 `json:"remote_asn"`
|
|
ProtocolName string `json:"protocol_name,omitempty"`
|
|
SessionState string `json:"session_state,omitempty"`
|
|
Status string `json:"status"`
|
|
FirstSeenAt time.Time `json:"first_seen_at"`
|
|
LastSeenAt time.Time `json:"last_seen_at"`
|
|
ApprovedPeerID string `json:"approved_peer_id,omitempty"`
|
|
}
|
|
|
|
// PeerDiscoveryUpsert is input for syncing a live dynamic session into the store.
|
|
type PeerDiscoveryUpsert struct {
|
|
SpeakerID string
|
|
NeighborID string
|
|
Neighbor string
|
|
RemoteASN int64
|
|
ProtocolName string
|
|
SessionState string
|
|
SeenAt time.Time
|
|
}
|
|
|
|
// PeerDiscoveryApproveInput optional fields when promoting a discovery to BGPPeer.
|
|
type PeerDiscoveryApproveInput struct {
|
|
Name string
|
|
SpeakerID *string
|
|
Enabled *bool
|
|
}
|