Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 185 additions & 56 deletions openapi/wicketd.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,56 @@
}
}
},
"/rack-setup/config/multirack": {
"get": {
"summary": "Get the current status of the multirack join configuration.",
"operationId": "get_multirack_join_config",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CurrentMultirackJoinUserConfig"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
"put": {
"summary": "Upload a configuration for joining this rack into an existing regional",
"description": "cluster.\n\nA multirack join configuration is mutually exclusive with an RSS config.",
"operationId": "put_multirack_join_config",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MultirackJoinConfigBaseUserInput"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "resource updated"
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/rack-setup/config/recovery-user-password-hash": {
"put": {
"summary": "Update the RSS config recovery silo user password hash.",
Expand Down Expand Up @@ -1585,6 +1635,34 @@
"tx_output_status"
]
},
"CurrentMultirackJoinUserConfig": {
"description": "A version of the multirack join configuration which contains learned bootstrap sleds and a redacted form of BGP auth keys if they exist.\n\nThis is returned to the user via wicketd and displayed in wicket.\n\nNote that there are no optional fields here unlike in `CurrentRssUserConfigInsensitive`. This is because wicketd defaults to filling in an empty RSS config for backwards compatibility and allows uploading BGP auth keys before actually uploading the RSS config. However, since we never default to an empty version of the `CurrentMultirackJoinConfig`, we can only fill in the BGP auth keys for this structure after the `MultirackJoinConfigBaseUserInput` is uploaded from a user.",
"type": "object",
"properties": {
"allowed_source_ips": {
"$ref": "#/components/schemas/AllowedSourceIps"
},
"bgp_auth_keys": {
"$ref": "#/components/schemas/GetBgpAuthKeyInfoResponse"
},
"bootstrap_sleds": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BootstrapSledDescription"
},
"uniqueItems": true
},
"rack_network_config": {
"$ref": "#/components/schemas/UserSpecifiedRackNetworkConfig"
}
},
"required": [
"allowed_source_ips",
"bgp_auth_keys",
"bootstrap_sleds",
"rack_network_config"
]
},
"CurrentRssUserConfig": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2543,6 +2621,33 @@
}
}
},
"MultirackJoinConfigBaseUserInput": {
"description": "Input from a user for adopting an uninitialized rack into an existing regional cluster.\n\nThis type is provided in the form of a TOML file uploaded via the wicket CLI. It does not contain sensitive user input such as BGP keys. Those are input separately.",
"type": "object",
"properties": {
"allowed_source_ips": {
"$ref": "#/components/schemas/AllowedSourceIps"
},
"bootstrap_slots": {
"description": "List of slot numbers only.",
"type": "array",
"items": {
"type": "integer",
"format": "uint16",
"minimum": 0
},
"uniqueItems": true
},
"rack_network_config": {
"$ref": "#/components/schemas/UserSpecifiedRackNetworkConfig"
}
},
"required": [
"allowed_source_ips",
"bootstrap_slots",
"rack_network_config"
]
},
"Name": {
"title": "A name unique within the parent collection",
"description": "Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end with a '-'. Names cannot be a UUID, but they may contain a UUID. They can be at most 63 characters long.",
Expand Down Expand Up @@ -7801,68 +7906,92 @@
}
},
"UserSpecifiedPortConfig": {
"description": "User-specified version of `PortConfig`.\n\nAll of `PortConfig` is user-specified. But we expect the port name to be a key, rather than a field as in `PortConfig`. So this has all of the fields other than the port name.",
"type": "object",
"properties": {
"addresses": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserSpecifiedUplinkAddressConfig"
}
},
"autoneg": {
"type": "boolean"
},
"bgp_peers": {
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/UserSpecifiedBgpPeerConfig"
}
},
"lldp": {
"nullable": true,
"default": null,
"allOf": [
{
"$ref": "#/components/schemas/LldpPortConfig"
}
]
},
"routes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RouteConfig"
}
},
"tx_eq": {
"nullable": true,
"default": null,
"allOf": [
{
"$ref": "#/components/schemas/TxEqConfig"
"oneOf": [
{
"description": "User-specified version of `PortConfig`.\n\nAll of `PortConfig` is user-specified. But we expect the port name to be a key, rather than a field as in `PortConfig`. So this has all of the fields other than the port name.",
"type": "object",
"properties": {
"addresses": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserSpecifiedUplinkAddressConfig"
}
},
"autoneg": {
"type": "boolean"
},
"bgp_peers": {
"default": [],
"type": "array",
"items": {
"$ref": "#/components/schemas/UserSpecifiedBgpPeerConfig"
}
},
"lldp": {
"nullable": true,
"default": null,
"allOf": [
{
"$ref": "#/components/schemas/LldpPortConfig"
}
]
},
"routes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RouteConfig"
}
},
"tx_eq": {
"nullable": true,
"default": null,
"allOf": [
{
"$ref": "#/components/schemas/TxEqConfig"
}
]
},
"type": {
"type": "string",
"enum": [
"manual"
]
},
"uplink_port_fec": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/LinkFec"
}
]
},
"uplink_port_speed": {
"$ref": "#/components/schemas/LinkSpeed"
}
},
"required": [
"addresses",
"autoneg",
"routes",
"type",
"uplink_port_speed"
]
},
"uplink_port_fec": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/LinkFec"
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ddm_auto_port_config"
]
}
},
"required": [
"type"
]
},
"uplink_port_speed": {
"$ref": "#/components/schemas/LinkSpeed"
}
},
"required": [
"addresses",
"autoneg",
"routes",
"uplink_port_speed"
],
"additionalProperties": false
]
},
"UserSpecifiedRackNetworkConfig": {
"description": "User-specified parts of `RackNetworkConfig`.",
Expand Down
20 changes: 12 additions & 8 deletions wicket-common/src/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ use crate::{
inventory::SpIdentifier,
rack_setup::{
BgpAuthKeyId, BootstrapSledDescription,
CurrentRssUserConfigInsensitive, PutRssUserConfigInsensitive,
UserSpecifiedBgpPeerConfig, UserSpecifiedImportExportPolicy,
UserSpecifiedPortConfig, UserSpecifiedRackNetworkConfig,
UserSpecifiedRouterPeerAddr, UserSpecifiedUplinkAddressConfig,
CurrentRssUserConfigInsensitive, ManualPortConfig,
PutRssUserConfigInsensitive, UserSpecifiedBgpPeerConfig,
UserSpecifiedImportExportPolicy, UserSpecifiedPortConfig,
UserSpecifiedRackNetworkConfig, UserSpecifiedRouterPeerAddr,
UserSpecifiedUplinkAddressConfig,
},
};

Expand Down Expand Up @@ -212,7 +213,7 @@ impl ExampleRackSetupData {
infra_ip_last: "172.30.0.10".parse().unwrap(),
#[rustfmt::skip]
switch0: btreemap! {
"port0".to_owned() => UserSpecifiedPortConfig {
"port0".to_owned() => UserSpecifiedPortConfig::Manual(ManualPortConfig {
addresses: vec![UserSpecifiedUplinkAddressConfig {
address: UplinkAddress::AddrConf,
vlan_id: Some(1),
Expand All @@ -229,13 +230,13 @@ impl ExampleRackSetupData {
lldp: switch0_port0_lldp,
tx_eq,
autoneg: true,
},
}),
},
#[rustfmt::skip]
switch1: btreemap! {
// Use the same port name as in switch0 to test that it doesn't
// collide.
"port0".to_owned() => UserSpecifiedPortConfig {
"port0".to_owned() => UserSpecifiedPortConfig::Manual(ManualPortConfig {
addresses: vec![UserSpecifiedUplinkAddressConfig::without_vlan(
"172.30.0.1/24".parse().unwrap(),
)],
Expand All @@ -251,7 +252,7 @@ impl ExampleRackSetupData {
lldp: switch1_port0_lldp,
tx_eq,
autoneg: true,
},
}),
},
bgp: vec![BgpConfig {
asn: 47,
Expand Down Expand Up @@ -333,6 +334,9 @@ fn apply_tweak(
let rnc = current_insensitive.rack_network_config.as_mut().unwrap();
for (_, _, port) in rnc.iter_uplinks_mut() {
// Remove all but the first BGP peer.
let UserSpecifiedPortConfig::Manual(port) = port else {
unimplemented!("DdmAutoPortConfig currently unsupported")
};
port.bgp_peers.drain(1..);
}
}
Expand Down
Loading
Loading