diff --git a/Cargo.lock b/Cargo.lock index 4c99c8fc6d..ef053f3e3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "dropshot" version = "0.10.2-dev" -source = "git+https://github.com/oxidecomputer/dropshot?branch=main#6a3f84ca5fd8d0c5c010cfe837efbe6b5d117d9d" +source = "git+https://github.com/oxidecomputer/dropshot?branch=main#9fef3961c0b89aa8ab8e186dc0c89f8f4f811eea" dependencies = [ "async-stream", "async-trait", @@ -2074,7 +2074,7 @@ dependencies = [ [[package]] name = "dropshot_endpoint" version = "0.10.2-dev" -source = "git+https://github.com/oxidecomputer/dropshot?branch=main#6a3f84ca5fd8d0c5c010cfe837efbe6b5d117d9d" +source = "git+https://github.com/oxidecomputer/dropshot?branch=main#9fef3961c0b89aa8ab8e186dc0c89f8f4f811eea" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4026,7 +4026,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] diff --git a/cockroach-admin/src/http_entrypoints.rs b/cockroach-admin/src/http_entrypoints.rs index 1c02d23ae2..45957df0df 100644 --- a/cockroach-admin/src/http_entrypoints.rs +++ b/cockroach-admin/src/http_entrypoints.rs @@ -6,6 +6,7 @@ use crate::cockroach_cli::NodeDecommission; use crate::cockroach_cli::NodeStatus; use crate::context::ServerContext; use dropshot::endpoint; +use dropshot::ApiDescriptionRegisterError; use dropshot::HttpError; use dropshot::HttpResponseOk; use dropshot::RequestContext; @@ -19,7 +20,9 @@ use std::sync::Arc; type CrdbApiDescription = dropshot::ApiDescription>; pub fn api() -> CrdbApiDescription { - fn register_endpoints(api: &mut CrdbApiDescription) -> Result<(), String> { + fn register_endpoints( + api: &mut CrdbApiDescription, + ) -> Result<(), ApiDescriptionRegisterError> { api.register(local_node_id)?; api.register(node_status)?; api.register(node_decommission)?; diff --git a/gateway/src/http_entrypoints.rs b/gateway/src/http_entrypoints.rs index 7e1c8a991e..fa91bcebf5 100644 --- a/gateway/src/http_entrypoints.rs +++ b/gateway/src/http_entrypoints.rs @@ -17,6 +17,7 @@ use crate::ServerContext; use base64::Engine; use dropshot::endpoint; use dropshot::ApiDescription; +use dropshot::ApiDescriptionRegisterError; use dropshot::HttpError; use dropshot::HttpResponseOk; use dropshot::HttpResponseUpdatedNoContent; @@ -1677,7 +1678,7 @@ type GatewayApiDescription = ApiDescription>; pub fn api() -> GatewayApiDescription { fn register_endpoints( api: &mut GatewayApiDescription, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { api.register(sp_get)?; api.register(sp_startup_options_get)?; api.register(sp_startup_options_set)?; diff --git a/installinator-artifactd/src/http_entrypoints.rs b/installinator-artifactd/src/http_entrypoints.rs index 8360fc9e35..13163e007b 100644 --- a/installinator-artifactd/src/http_entrypoints.rs +++ b/installinator-artifactd/src/http_entrypoints.rs @@ -5,9 +5,9 @@ // Copyright 2022 Oxide Computer Company use dropshot::{ - endpoint, ApiDescription, FreeformBody, HttpError, HttpResponseHeaders, - HttpResponseOk, HttpResponseUpdatedNoContent, Path, RequestContext, - TypedBody, + endpoint, ApiDescription, ApiDescriptionRegisterError, FreeformBody, + HttpError, HttpResponseHeaders, HttpResponseOk, + HttpResponseUpdatedNoContent, Path, RequestContext, TypedBody, }; use hyper::{header, Body, StatusCode}; use installinator_common::EventReport; @@ -24,7 +24,7 @@ type ArtifactServerApiDesc = ApiDescription; pub fn api() -> ArtifactServerApiDesc { fn register_endpoints( api: &mut ArtifactServerApiDesc, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { api.register(get_artifact_by_hash)?; api.register(report_progress)?; Ok(()) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 1e11004191..1f185ae820 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -14,7 +14,6 @@ use super::{ }, }; use crate::{context::ApiContext, external_api::shared}; -use dropshot::HttpError; use dropshot::HttpResponseAccepted; use dropshot::HttpResponseCreated; use dropshot::HttpResponseDeleted; @@ -32,6 +31,7 @@ use dropshot::{ channel, endpoint, WebsocketChannelResult, WebsocketConnection, }; use dropshot::{ApiDescription, StreamingBody}; +use dropshot::{ApiDescriptionRegisterError, HttpError}; use dropshot::{ApiEndpoint, EmptyScanParams}; use ipnetwork::IpNetwork; use nexus_db_queries::db; @@ -100,7 +100,9 @@ type NexusApiDescription = ApiDescription; /// Returns a description of the external nexus API pub(crate) fn external_api() -> NexusApiDescription { - fn register_endpoints(api: &mut NexusApiDescription) -> Result<(), String> { + fn register_endpoints( + api: &mut NexusApiDescription, + ) -> Result<(), ApiDescriptionRegisterError> { api.register(ping)?; api.register(system_policy_view)?; @@ -368,7 +370,7 @@ pub(crate) fn external_api() -> NexusApiDescription { fn register_experimental( api: &mut NexusApiDescription, endpoint: T, - ) -> Result<(), String> + ) -> Result<(), ApiDescriptionRegisterError> where T: Into>, { @@ -381,7 +383,7 @@ pub(crate) fn external_api() -> NexusApiDescription { fn register_experimental_endpoints( api: &mut NexusApiDescription, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { register_experimental(api, probe_list)?; register_experimental(api, probe_view)?; register_experimental(api, probe_create)?; diff --git a/nexus/src/internal_api/http_entrypoints.rs b/nexus/src/internal_api/http_entrypoints.rs index 582f7cb608..8e7b39c111 100644 --- a/nexus/src/internal_api/http_entrypoints.rs +++ b/nexus/src/internal_api/http_entrypoints.rs @@ -8,6 +8,7 @@ use super::params::{OximeterInfo, RackInitializationRequest}; use crate::context::ApiContext; use dropshot::endpoint; use dropshot::ApiDescription; +use dropshot::ApiDescriptionRegisterError; use dropshot::FreeformBody; use dropshot::HttpError; use dropshot::HttpResponseCreated; @@ -68,7 +69,9 @@ type NexusApiDescription = ApiDescription; /// Returns a description of the internal nexus API pub(crate) fn internal_api() -> NexusApiDescription { - fn register_endpoints(api: &mut NexusApiDescription) -> Result<(), String> { + fn register_endpoints( + api: &mut NexusApiDescription, + ) -> Result<(), ApiDescriptionRegisterError> { api.register(sled_agent_get)?; api.register(sled_agent_put)?; api.register(sled_firewall_rules_request)?; diff --git a/sled-agent/src/bootstrap/http_entrypoints.rs b/sled-agent/src/bootstrap/http_entrypoints.rs index 68098f431e..2fa0b83f1d 100644 --- a/sled-agent/src/bootstrap/http_entrypoints.rs +++ b/sled-agent/src/bootstrap/http_entrypoints.rs @@ -15,6 +15,7 @@ use crate::bootstrap::rack_ops::{RackInitId, RackResetId}; use crate::updates::ConfigUpdates; use crate::updates::{Component, UpdateManager}; use bootstore::schemes::v0 as bootstore; +use dropshot::ApiDescriptionRegisterError; use dropshot::{ endpoint, ApiDescription, HttpError, HttpResponseOk, HttpResponseUpdatedNoContent, RequestContext, TypedBody, @@ -63,7 +64,7 @@ type BootstrapApiDescription = ApiDescription; pub(crate) fn api() -> BootstrapApiDescription { fn register_endpoints( api: &mut BootstrapApiDescription, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { api.register(baseboard_get)?; api.register(components_get)?; api.register(rack_initialization_status)?; diff --git a/sled-agent/src/http_entrypoints.rs b/sled-agent/src/http_entrypoints.rs index 2d41e2860a..a21c278699 100644 --- a/sled-agent/src/http_entrypoints.rs +++ b/sled-agent/src/http_entrypoints.rs @@ -20,10 +20,10 @@ use bootstore::schemes::v0::NetworkConfig; use camino::Utf8PathBuf; use display_error_chain::DisplayErrorChain; use dropshot::{ - endpoint, ApiDescription, FreeformBody, HttpError, HttpResponseCreated, - HttpResponseDeleted, HttpResponseHeaders, HttpResponseOk, - HttpResponseUpdatedNoContent, Path, Query, RequestContext, StreamingBody, - TypedBody, + endpoint, ApiDescription, ApiDescriptionRegisterError, FreeformBody, + HttpError, HttpResponseCreated, HttpResponseDeleted, HttpResponseHeaders, + HttpResponseOk, HttpResponseUpdatedNoContent, Path, Query, RequestContext, + StreamingBody, TypedBody, }; use illumos_utils::opte::params::VirtualNetworkInterfaceHost; use installinator_common::M2Slot; @@ -46,7 +46,9 @@ type SledApiDescription = ApiDescription; /// Returns a description of the sled agent API pub fn api() -> SledApiDescription { - fn register_endpoints(api: &mut SledApiDescription) -> Result<(), String> { + fn register_endpoints( + api: &mut SledApiDescription, + ) -> Result<(), ApiDescriptionRegisterError> { api.register(disk_put)?; api.register(cockroachdb_init)?; api.register(instance_issue_disk_snapshot_request)?; diff --git a/sled-agent/src/sim/http_entrypoints.rs b/sled-agent/src/sim/http_entrypoints.rs index cfafaeea22..78d48be0ff 100644 --- a/sled-agent/src/sim/http_entrypoints.rs +++ b/sled-agent/src/sim/http_entrypoints.rs @@ -12,7 +12,6 @@ use crate::params::{ InstancePutStateResponse, InstanceUnregisterResponse, Inventory, OmicronPhysicalDisksConfig, OmicronZonesConfig, VpcFirewallRulesEnsureBody, }; -use dropshot::endpoint; use dropshot::ApiDescription; use dropshot::HttpError; use dropshot::HttpResponseOk; @@ -20,6 +19,7 @@ use dropshot::HttpResponseUpdatedNoContent; use dropshot::Path; use dropshot::RequestContext; use dropshot::TypedBody; +use dropshot::{endpoint, ApiDescriptionRegisterError}; use illumos_utils::opte::params::VirtualNetworkInterfaceHost; use omicron_common::api::internal::nexus::DiskRuntimeState; use omicron_common::api::internal::nexus::SledInstanceState; @@ -40,7 +40,9 @@ type SledApiDescription = ApiDescription>; /// Returns a description of the sled agent API pub fn api() -> SledApiDescription { - fn register_endpoints(api: &mut SledApiDescription) -> Result<(), String> { + fn register_endpoints( + api: &mut SledApiDescription, + ) -> Result<(), ApiDescriptionRegisterError> { api.register(instance_put_migration_ids)?; api.register(instance_put_state)?; api.register(instance_get_state)?; diff --git a/sled-agent/src/sim/http_entrypoints_pantry.rs b/sled-agent/src/sim/http_entrypoints_pantry.rs index 13882deabc..a93cb6fca9 100644 --- a/sled-agent/src/sim/http_entrypoints_pantry.rs +++ b/sled-agent/src/sim/http_entrypoints_pantry.rs @@ -5,8 +5,9 @@ //! HTTP entrypoint functions for simulating the crucible pantry API. use dropshot::{ - endpoint, ApiDescription, HttpError, HttpResponseDeleted, HttpResponseOk, - HttpResponseUpdatedNoContent, Path as TypedPath, RequestContext, TypedBody, + endpoint, ApiDescription, ApiDescriptionRegisterError, HttpError, + HttpResponseDeleted, HttpResponseOk, HttpResponseUpdatedNoContent, + Path as TypedPath, RequestContext, TypedBody, }; use propolis_client::types::VolumeConstructionRequest; use schemars::JsonSchema; @@ -21,7 +22,7 @@ type CruciblePantryApiDescription = ApiDescription>; pub fn api() -> CruciblePantryApiDescription { fn register_endpoints( api: &mut CruciblePantryApiDescription, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { api.register(attach)?; api.register(is_job_finished)?; api.register(job_result_ok)?; diff --git a/sled-agent/src/sim/http_entrypoints_storage.rs b/sled-agent/src/sim/http_entrypoints_storage.rs index dcc449b61a..99817755bf 100644 --- a/sled-agent/src/sim/http_entrypoints_storage.rs +++ b/sled-agent/src/sim/http_entrypoints_storage.rs @@ -9,8 +9,9 @@ use crucible_agent_client::types::{ Snapshot, }; use dropshot::{ - endpoint, ApiDescription, HttpError, HttpResponseDeleted, HttpResponseOk, - Path as TypedPath, RequestContext, TypedBody, + endpoint, ApiDescription, ApiDescriptionRegisterError, HttpError, + HttpResponseDeleted, HttpResponseOk, Path as TypedPath, RequestContext, + TypedBody, }; use schemars::JsonSchema; use serde::Deserialize; @@ -24,7 +25,7 @@ type CrucibleAgentApiDescription = ApiDescription>; pub fn api() -> CrucibleAgentApiDescription { fn register_endpoints( api: &mut CrucibleAgentApiDescription, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { api.register(region_list)?; api.register(region_create)?; api.register(region_get)?; diff --git a/wicketd/src/http_entrypoints.rs b/wicketd/src/http_entrypoints.rs index 001974e085..4a4374b312 100644 --- a/wicketd/src/http_entrypoints.rs +++ b/wicketd/src/http_entrypoints.rs @@ -18,6 +18,7 @@ use bootstrap_agent_client::types::RackOperationStatus; use bootstrap_agent_client::types::RackResetId; use dropshot::endpoint; use dropshot::ApiDescription; +use dropshot::ApiDescriptionRegisterError; use dropshot::HttpError; use dropshot::HttpResponseOk; use dropshot::HttpResponseUpdatedNoContent; @@ -59,7 +60,7 @@ type WicketdApiDescription = ApiDescription; pub fn api() -> WicketdApiDescription { fn register_endpoints( api: &mut WicketdApiDescription, - ) -> Result<(), String> { + ) -> Result<(), ApiDescriptionRegisterError> { api.register(get_bootstrap_sleds)?; api.register(get_rss_config)?; api.register(put_rss_config)?;