feat(api): add endpoint to list community prefixes with pagination
Introduced a new GET endpoint `/v1/communities/{id}/prefixes` to retrieve unique prefixes associated with a community, including pagination support via cursor and limit parameters. Updated OpenAPI documentation to reflect this addition. Implemented backend logic in both PostgreSQL and in-memory storage to handle the new functionality, ensuring proper authorization checks and response formatting.
This commit is contained in:
@@ -60,6 +60,8 @@ type Backend interface {
|
||||
CreateCommunity(tenantID string, in *Community) (*Community, error)
|
||||
UpdateCommunity(tenantID, id string, patch *CommunityPatch) (*Community, error)
|
||||
DeleteCommunity(tenantID, id string) error
|
||||
// ListCommunityPrefixes returns unique prefixes tagged with community from latest revision per module.
|
||||
ListCommunityPrefixes(tenantID, communityID, cursor string, limit int) (prefixes []PrefixRow, nextCursor string, hasMore bool, err error)
|
||||
|
||||
// ListPeers returns all BGP peers for a tenant (control plane may paginate in httpapi).
|
||||
ListPeers(tenantID string) []*BGPPeer
|
||||
|
||||
Reference in New Issue
Block a user