-
Notifications
You must be signed in to change notification settings - Fork 56
Various networking API & DB fixes #5701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/// The speed of a link. | ||
#[derive(Copy, Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum LinkSpeed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not net-new, it's moved from nexus/external_api/params.rs
to be used as a common data structure for PUT/POST and GET requests.
/// parameter is a reference to global BGP parameters. The `interface_name` | ||
/// indicates what interface the peer should be contacted on. | ||
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)] | ||
pub struct BgpPeer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not net-new, it's moved from nexus/external_api/params.rs
to be used as a common data structure for PUT/POST and GET requests.
use uuid::Uuid; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct BgpPeerConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data structure is mostly the same as the underlying db-model data structure, but includes list data members (allowed_import
, allowed_export
, communities
) which are not in the db-model structure as they've been normalized out into separate tables and thus have their own data structures. This makes it so we can provide a complete view of the underlying BGP peer config to calling clients through this type.
/// The forward error correction mode of a link. | ||
#[derive(Copy, Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum LinkFec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not net-new, it's moved from nexus/external_api/params.rs to be used as a common data structure for PUT/POST and GET requests.
I've been testing this with some new
If interested in looking that the source, the command lives here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a minor typo fix, but I'll leave it as approved so it can be merged as soon as possible
common/src/api/external/mod.rs
Outdated
/// The address of the host to peer with. | ||
pub addr: IpAddr, | ||
|
||
/// How long to hold peer connections between keppalives (seconds). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// How long to hold peer connections between keppalives (seconds). | |
/// How long to hold peer connections between keepalives (seconds). |
From the Nexus API endpoint
networking_switch_port_settings_view
there were several things missingThis means that these properties are unobservable to operators.
There was also some missing pluming for bgp communities and import/export allow lists during port settings creation where these elements were not making it into the database.
This is all addressed in this PR.
A good chunk of the diff in this PR is moving data structures around to be shared by PUT/POST and GET API calls, as noted inline in the code below.