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
7 changes: 7 additions & 0 deletions gateway-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ enum Command {
/// Component to reset
component: String,
},

/// Get the ID for the switch this MGS instance is connected to.
LocalSwitchId {},
}

fn level_from_str(s: &str) -> Result<Level> {
Expand Down Expand Up @@ -607,6 +610,10 @@ async fn main_impl() -> Result<()> {
Command::ResetComponent { sp, component } => {
client.sp_component_reset(sp.type_, sp.slot, &component).await?;
}
Command::LocalSwitchId {} => {
let sp_id = client.sp_local_switch_id().await?.into_inner();
dumper.dump(&sp_id)?;
}
}

Ok(())
Expand Down
18 changes: 15 additions & 3 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,8 @@ source.packages = [
"xcvradm.tar.gz",
"omicron-omdb.tar.gz",
"zone-setup.tar.gz",
"zone-network-install.tar.gz"
"zone-network-install.tar.gz",
"gateway-cli.tar.gz"
]
output.type = "zone"

Expand All @@ -858,7 +859,8 @@ source.packages = [
"sp-sim-stub.tar.gz",
"omicron-omdb.tar.gz",
"zone-setup.tar.gz",
"zone-network-install.tar.gz"
"zone-network-install.tar.gz",
"gateway-cli.tar.gz"
]
output.type = "zone"

Expand All @@ -884,7 +886,8 @@ source.packages = [
"sp-sim-softnpu.tar.gz",
"omicron-omdb.tar.gz",
"zone-setup.tar.gz",
"zone-network-install.tar.gz"
"zone-network-install.tar.gz",
"gateway-cli.tar.gz"
]
output.type = "zone"

Expand Down Expand Up @@ -926,6 +929,15 @@ source.rust.release = true
output.type = "zone"
output.intermediate_only = true

[package.gateway-cli]
service_name = "gateway-cli"
only_for_targets.image = "standard"
source.type = "local"
source.rust.binary_names = ["gateway-cli"]
source.rust.release = true
output.type = "zone"
output.intermediate_only = true

[package.oxlog]
service_name = "oxlog"
only_for_targets.image = "standard"
Expand Down
2 changes: 1 addition & 1 deletion smf/profile/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typeset _hstc="$C_RED$HOSTNAME"
case "$_hst" in
oxz_switch)
# Try to determine which switch zone we are
_switchid=$(curl -H 'api-version: 1.0.0' -s http://localhost:12225/local/switch-id \
_switchid=$(gateway-cli --server "[::1]:12225" local-switch-id \
| /opt/ooce/bin/jq -r .slot)
if (( $? == 0 )) && [[ -n "$_switchid" ]]; then
_hst+="$_switchid"
Expand Down
2 changes: 1 addition & 1 deletion smf/profile/profile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH+=:/opt/ooce/bin
case "$HOSTNAME" in
oxz_switch)
# Add tools like xcvradm, swadm & ddmadm to the PATH by default
PATH+=:/opt/oxide/bin:/opt/oxide/dendrite/bin:/opt/oxide/mg-ddm/bin:/opt/oxide/omdb/bin:/opt/oxide/mgd/bin
PATH+=:/opt/oxide/bin:/opt/oxide/dendrite/bin:/opt/oxide/mg-ddm/bin:/opt/oxide/omdb/bin:/opt/oxide/mgd/bin:/opt/oxide/gateway-cli/bin
;;
oxz_cockroachdb*)
PATH+=:/opt/oxide/cockroachdb/bin
Expand Down
Loading