Applying a new BGP config requires maps of numbered and unnumbered peers keyed by "peer group":
|
/// Lists of peers indexed by peer group. |
|
pub peers: HashMap<String, Vec<BgpPeerConfig>>, |
|
/// Lists of unnumbered peers indexed by peer group. |
|
#[serde(default)] |
|
pub unnumbered_peers: HashMap<String, Vec<UnnumberedBgpPeerConfig>>, |
After a brief chat with @taspelund (but if there are any incorrect bits here, it's definitely my lack of context), my understanding is that a peer group in the BGP sense is a set of BGP peer configs that share some common settings. But:
- That isn't consistent with the shape of this API; each item in the maps' values'
Vecs contains a full set of configuration that can be entirely different from other configs in the same vec
- Nexus doesn't have a concept of peer groups at all; it builds these maps by using the switch port name as the keys:
Would Nexus be just as correct to send a HashMap with a single (arbitrary) key and all the configs in a single Vec value? If so, would it make sense to squish this API down to Vec<_>s instead of HashMap<String, Vec<_>>s?
Applying a new BGP config requires maps of numbered and unnumbered peers keyed by "peer group":
maghemite/mg-api-types/versions/src/bgp_src_addr/bgp/config.rs
Lines 118 to 122 in a31a86e
After a brief chat with @taspelund (but if there are any incorrect bits here, it's definitely my lack of context), my understanding is that a peer group in the BGP sense is a set of BGP peer configs that share some common settings. But:
Vecs contains a full set of configuration that can be entirely different from other configs in the same vecWould Nexus be just as correct to send a
HashMapwith a single (arbitrary) key and all the configs in a singleVecvalue? If so, would it make sense to squish this API down toVec<_>s instead ofHashMap<String, Vec<_>>s?