Skip to content
  •  
  •  
  •  
39 changes: 37 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ members = [
"nexus/test-utils-macros",
"nexus/test-utils",
"nexus/types",
"nexus/types/versions",
"ntp-admin",
"ntp-admin/api",
"ntp-admin/types",
Expand Down Expand Up @@ -285,6 +286,7 @@ default-members = [
"nexus/test-utils-macros",
"nexus/test-utils",
"nexus/types",
"nexus/types/versions",
"ntp-admin",
"ntp-admin/api",
"ntp-admin/types",
Expand Down Expand Up @@ -610,6 +612,7 @@ nexus-test-interface = { path = "nexus/test-interface" }
nexus-test-utils-macros = { path = "nexus/test-utils-macros" }
nexus-test-utils = { path = "nexus/test-utils" }
nexus-types = { path = "nexus/types" }
nexus-types-versions = { path = "nexus/types/versions" }
nix = { version = "0.30", features = ["fs", "net"] }
nom = "7.1.3"
nonempty = "0.12.0"
Expand Down
4 changes: 2 additions & 2 deletions clients/nexus-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ impl TryFrom<types::ProducerEndpoint>
}
}

impl From<nexus_types::external_api::shared::Baseboard> for types::Baseboard {
fn from(value: nexus_types::external_api::shared::Baseboard) -> Self {
impl From<nexus_types::external_api::hardware::Baseboard> for types::Baseboard {
fn from(value: nexus_types::external_api::hardware::Baseboard) -> Self {
types::Baseboard {
part: value.part,
revision: value.revision,
Expand Down
12 changes: 6 additions & 6 deletions dev-tools/omdb/src/bin/omdb/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ use nexus_types::deployment::BlueprintZoneDisposition;
use nexus_types::deployment::BlueprintZoneType;
use nexus_types::deployment::DiskFilter;
use nexus_types::deployment::SledFilter;
use nexus_types::external_api::params;
use nexus_types::external_api::views::PhysicalDiskPolicy;
use nexus_types::external_api::views::PhysicalDiskState;
use nexus_types::external_api::views::SledPolicy;
use nexus_types::external_api::views::SledState;
use nexus_types::external_api::disk::BlockSize;
use nexus_types::external_api::physical_disk::{
PhysicalDiskPolicy, PhysicalDiskState,
};
use nexus_types::external_api::sled::{SledPolicy, SledState};
use nexus_types::identity::Resource;
use nexus_types::internal_api::params::DnsRecord;
use nexus_types::internal_api::params::Srv;
Expand Down Expand Up @@ -4086,7 +4086,7 @@ async fn cmd_db_dry_run_region_allocation(
};

let size: external::ByteCount = args.size.try_into()?;
let block_size: params::BlockSize = args.block_size.try_into()?;
let block_size: BlockSize = args.block_size.try_into()?;

let (blocks_per_extent, extent_count) = DataStore::get_crucible_allocation(
&block_size.try_into().unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/src/bin/omdb/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@ fn print_task_alert_dispatcher(details: &serde_json::Value) {
}
}
fn print_task_webhook_deliverator(details: &serde_json::Value) {
use nexus_types::external_api::views::WebhookDeliveryAttemptResult;
use nexus_types::external_api::alert::WebhookDeliveryAttemptResult;
use nexus_types::internal_api::background::WebhookDeliveratorStatus;
use nexus_types::internal_api::background::WebhookDeliveryFailure;
use nexus_types::internal_api::background::WebhookRxDeliveryStatus;
Expand Down
3 changes: 1 addition & 2 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ use nexus_types::deployment::{
};
use nexus_types::deployment::{OmicronZoneNic, TargetReleaseDescription};
use nexus_types::deployment::{PendingMgsUpdateSpDetails, PlanningInput};
use nexus_types::external_api::views::SledPolicy;
use nexus_types::external_api::views::SledProvisionPolicy;
use nexus_types::external_api::sled::{SledPolicy, SledProvisionPolicy};
use nexus_types::inventory::CollectionDisplayCliFilter;
use omicron_common::address::REPO_DEPOT_PORT;
use omicron_common::api::external::Generation;
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/reconfigurator-cli/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use nexus_types::deployment::Blueprint;
use nexus_types::deployment::BlueprintSource;
use nexus_types::deployment::ClickhousePolicy;
use nexus_types::deployment::PlanningInput;
use nexus_types::external_api::views::SledPolicy;
use nexus_types::external_api::sled::SledPolicy;
use nexus_types::inventory::Collection;
use omicron_uuid_kinds::SledUuid;
use slog::Logger;
Expand Down
2 changes: 1 addition & 1 deletion live-tests/tests/common/reconfigurator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use nexus_lockstep_client::types::{
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
use nexus_reconfigurator_planning::planner::PlannerRng;
use nexus_types::deployment::{Blueprint, BlueprintSource};
use nexus_types::external_api::views::SledState;
use nexus_types::external_api::sled::SledState;
use nexus_types::inventory::Collection;
use omicron_test_utils::dev::poll::{CondCheckError, wait_for_condition};
use omicron_uuid_kinds::GenericUuid;
Expand Down
1 change: 1 addition & 0 deletions nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ nexus-reconfigurator-planning.workspace = true
nexus-reconfigurator-preparation.workspace = true
nexus-reconfigurator-rendezvous.workspace = true
nexus-types.workspace = true
nexus-types-versions.workspace = true
omicron-common.workspace = true
omicron-passwords.workspace = true
oxide-tokio-rt.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions nexus/auth/src/authn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub use nexus_db_fixed_data::user_builtin::USER_SERVICE_BALANCER;
use crate::authz;
use chrono::{DateTime, Utc};
use nexus_db_fixed_data::silo::DEFAULT_SILO;
use nexus_types::external_api::shared::FleetRole;
use nexus_types::external_api::shared::SiloRole;
use nexus_types::external_api::policy::FleetRole;
use nexus_types::external_api::policy::SiloRole;
use nexus_types::identity::Asset;
use omicron_common::api::external::LookupType;
use omicron_uuid_kinds::BuiltInUserUuid;
Expand Down
2 changes: 1 addition & 1 deletion nexus/auth/src/authz/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::roles::RoleSet;
use crate::authn;
use crate::authz::SiloUser;
use nexus_db_model::DatabaseString;
use nexus_types::external_api::shared::FleetRole;
use nexus_types::external_api::policy::FleetRole;
use omicron_common::api::external::LookupType;
use omicron_common::api::external::ResourceType;
use uuid::Uuid;
Expand Down
2 changes: 1 addition & 1 deletion nexus/auth/src/authz/api_resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use authz_macros::authz_resource;
use futures::FutureExt;
use futures::future::BoxFuture;
use nexus_db_fixed_data::FLEET_ID;
use nexus_types::external_api::shared::{FleetRole, ProjectRole, SiloRole};
use nexus_types::external_api::policy::{FleetRole, ProjectRole, SiloRole};
use omicron_common::api::external::{Error, LookupType, ResourceType};
use oso::PolarClass;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-fixed-data/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use nexus_db_model as model;
use nexus_types::{external_api::params, silo::INTERNAL_SILO_ID};
use nexus_types::{external_api::project, silo::INTERNAL_SILO_ID};
use omicron_common::api::external::IdentityMetadataCreateParams;
use std::sync::LazyLock;

Expand All @@ -22,7 +22,7 @@ pub static SERVICES_PROJECT: LazyLock<model::Project> = LazyLock::new(|| {
model::Project::new_with_id(
*SERVICES_PROJECT_ID,
INTERNAL_SILO_ID,
params::ProjectCreate {
project::ProjectCreate {
identity: IdentityMetadataCreateParams {
name: SERVICES_DB_NAME.parse().unwrap(),
description: "Built-in project for Oxide Services".to_string(),
Expand Down
14 changes: 7 additions & 7 deletions nexus/db-fixed-data/src/silo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use nexus_db_model as model;
use nexus_types::{
external_api::{params, shared},
external_api::silo::{SiloCreate, SiloIdentityMode, SiloQuotasCreate},
silo::{
DEFAULT_SILO_ID, INTERNAL_SILO_ID, default_silo_name,
internal_silo_name,
Expand All @@ -20,16 +20,16 @@ use std::sync::LazyLock;
pub static DEFAULT_SILO: LazyLock<model::Silo> = LazyLock::new(|| {
model::Silo::new_with_id(
DEFAULT_SILO_ID,
params::SiloCreate {
SiloCreate {
identity: IdentityMetadataCreateParams {
name: default_silo_name().clone(),
description: "default silo".to_string(),
},
// This quota is actually _unused_ because the default silo
// isn't constructed in the same way a normal silo would be.
quotas: params::SiloQuotasCreate::empty(),
quotas: SiloQuotasCreate::empty(),
discoverable: false,
identity_mode: shared::SiloIdentityMode::LocalOnly,
identity_mode: SiloIdentityMode::LocalOnly,
admin_group_name: None,
tls_certificates: vec![],
mapped_fleet_roles: Default::default(),
Expand All @@ -43,15 +43,15 @@ pub static DEFAULT_SILO: LazyLock<model::Silo> = LazyLock::new(|| {
pub static INTERNAL_SILO: LazyLock<model::Silo> = LazyLock::new(|| {
model::Silo::new_with_id(
INTERNAL_SILO_ID,
params::SiloCreate {
SiloCreate {
identity: IdentityMetadataCreateParams {
name: internal_silo_name().clone(),
description: "Built-in internal Silo.".to_string(),
},
// The internal silo contains no virtual resources, so it has no allotted capacity.
quotas: params::SiloQuotasCreate::empty(),
quotas: SiloQuotasCreate::empty(),
discoverable: false,
identity_mode: shared::SiloIdentityMode::LocalOnly,
identity_mode: SiloIdentityMode::LocalOnly,
admin_group_name: None,
tls_certificates: vec![],
mapped_fleet_roles: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-fixed-data/src/vpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::project::SERVICES_DB_NAME;
use nexus_db_model as model;
use nexus_types::external_api::params;
use nexus_types::external_api::vpc;
use omicron_common::address::SERVICE_VPC_IPV6_PREFIX;
use omicron_common::api::external::IdentityMetadataCreateParams;
use std::sync::LazyLock;
Expand Down Expand Up @@ -53,7 +53,7 @@ pub static SERVICES_VPC: LazyLock<model::IncompleteVpc> = LazyLock::new(|| {
*SERVICES_VPC_ID,
*super::project::SERVICES_PROJECT_ID,
*SERVICES_VPC_ROUTER_ID,
params::VpcCreate {
vpc::VpcCreate {
identity: IdentityMetadataCreateParams {
name: SERVICES_DB_NAME.parse().unwrap(),
description: "Built-in VPC for Oxide Services".to_string(),
Expand Down
22 changes: 12 additions & 10 deletions nexus/db-model/src/affinity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use nexus_db_schema::schema::affinity_group;
use nexus_db_schema::schema::affinity_group_instance_membership;
use nexus_db_schema::schema::anti_affinity_group;
use nexus_db_schema::schema::anti_affinity_group_instance_membership;
use nexus_types::external_api::params;
use nexus_types::external_api::views;
use nexus_types::external_api::affinity;
use omicron_common::api::external;
use omicron_common::api::external::IdentityMetadata;
use omicron_uuid_kinds::AffinityGroupKind;
Expand Down Expand Up @@ -95,7 +94,10 @@ pub struct AffinityGroup {
}

impl AffinityGroup {
pub fn new(project_id: Uuid, params: params::AffinityGroupCreate) -> Self {
pub fn new(
project_id: Uuid,
params: affinity::AffinityGroupCreate,
) -> Self {
Self {
identity: AffinityGroupIdentity::new(
Uuid::new_v4(),
Expand All @@ -108,7 +110,7 @@ impl AffinityGroup {
}
}

impl From<AffinityGroup> for views::AffinityGroup {
impl From<AffinityGroup> for affinity::AffinityGroup {
fn from(group: AffinityGroup) -> Self {
let identity = IdentityMetadata {
id: group.identity.id,
Expand All @@ -135,8 +137,8 @@ pub struct AffinityGroupUpdate {
pub time_modified: DateTime<Utc>,
}

impl From<params::AffinityGroupUpdate> for AffinityGroupUpdate {
fn from(params: params::AffinityGroupUpdate) -> Self {
impl From<affinity::AffinityGroupUpdate> for AffinityGroupUpdate {
fn from(params: affinity::AffinityGroupUpdate) -> Self {
Self {
name: params.identity.name.map(Name),
description: params.identity.description,
Expand All @@ -160,7 +162,7 @@ pub struct AntiAffinityGroup {
impl AntiAffinityGroup {
pub fn new(
project_id: Uuid,
params: params::AntiAffinityGroupCreate,
params: affinity::AntiAffinityGroupCreate,
) -> Self {
Self {
identity: AntiAffinityGroupIdentity::new(
Expand All @@ -174,7 +176,7 @@ impl AntiAffinityGroup {
}
}

impl From<AntiAffinityGroup> for views::AntiAffinityGroup {
impl From<AntiAffinityGroup> for affinity::AntiAffinityGroup {
fn from(group: AntiAffinityGroup) -> Self {
let identity = IdentityMetadata {
id: group.identity.id,
Expand All @@ -201,8 +203,8 @@ pub struct AntiAffinityGroupUpdate {
pub time_modified: DateTime<Utc>,
}

impl From<params::AntiAffinityGroupUpdate> for AntiAffinityGroupUpdate {
fn from(params: params::AntiAffinityGroupUpdate) -> Self {
impl From<affinity::AntiAffinityGroupUpdate> for AntiAffinityGroupUpdate {
fn from(params: affinity::AntiAffinityGroupUpdate) -> Self {
Self {
name: params.identity.name.map(Name),
description: params.identity.description,
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-model/src/alert_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use super::impl_enum_type;
use nexus_types::external_api::views;
use nexus_types::external_api::alert;
use serde::de::{self, Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
use std::fmt;
Expand Down Expand Up @@ -123,7 +123,7 @@ impl std::str::FromStr for AlertClass {
}
}

impl From<AlertClass> for views::AlertClass {
impl From<AlertClass> for alert::AlertClass {
fn from(class: AlertClass) -> Self {
Self {
name: class.to_string(),
Expand Down
Loading
Loading