diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 0efc877e98..b007cc6217 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -225,7 +225,7 @@ pub(crate) fn external_api() -> NexusApiDescription { api.register(rack_view)?; api.register(sled_list)?; api.register(sled_view)?; - api.register(sled_set_provision_state)?; + api.register(sled_set_provision_policy)?; api.register(sled_instance_list)?; api.register(sled_physical_disk_list)?; api.register(physical_disk_list)?; @@ -5166,13 +5166,13 @@ async fn sled_view( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } -/// Set sled provision state +/// Set sled provision policy #[endpoint { method = PUT, - path = "/v1/system/hardware/sleds/{sled_id}/provision-state", + path = "/v1/system/hardware/sleds/{sled_id}/provision-policy", tags = ["system/hardware"], }] -async fn sled_set_provision_state( +async fn sled_set_provision_policy( rqctx: RequestContext>, path_params: Path, new_provision_state: TypedBody, diff --git a/nexus/tests/integration_tests/endpoints.rs b/nexus/tests/integration_tests/endpoints.rs index 93cc9d1db9..81f2a02b31 100644 --- a/nexus/tests/integration_tests/endpoints.rs +++ b/nexus/tests/integration_tests/endpoints.rs @@ -22,6 +22,7 @@ use nexus_types::external_api::params; use nexus_types::external_api::shared; use nexus_types::external_api::shared::IpRange; use nexus_types::external_api::shared::Ipv4Range; +use nexus_types::external_api::views::SledProvisionPolicy; use omicron_common::api::external::AddressLotKind; use omicron_common::api::external::ByteCount; use omicron_common::api::external::IdentityMetadataCreateParams; @@ -45,14 +46,12 @@ pub const HARDWARE_UNINITIALIZED_SLEDS: &'static str = "/v1/system/hardware/sleds-uninitialized"; pub static HARDWARE_SLED_URL: Lazy = Lazy::new(|| format!("/v1/system/hardware/sleds/{}", SLED_AGENT_UUID)); -pub static HARDWARE_SLED_PROVISION_STATE_URL: Lazy = Lazy::new(|| { - format!("/v1/system/hardware/sleds/{}/provision-state", SLED_AGENT_UUID) +pub static HARDWARE_SLED_PROVISION_POLICY_URL: Lazy = Lazy::new(|| { + format!("/v1/system/hardware/sleds/{}/provision-policy", SLED_AGENT_UUID) }); -pub static DEMO_SLED_PROVISION_STATE: Lazy = - Lazy::new(|| { - params::SledProvisionPolicyParams { - state: nexus_types::external_api::views::SledProvisionPolicy::NonProvisionable, - } +pub static DEMO_SLED_PROVISION_POLICY: Lazy = + Lazy::new(|| params::SledProvisionPolicyParams { + state: SledProvisionPolicy::NonProvisionable, }); pub static HARDWARE_SWITCH_URL: Lazy = @@ -1911,11 +1910,11 @@ pub static VERIFY_ENDPOINTS: Lazy> = Lazy::new(|| { }, VerifyEndpoint { - url: &HARDWARE_SLED_PROVISION_STATE_URL, + url: &HARDWARE_SLED_PROVISION_POLICY_URL, visibility: Visibility::Protected, unprivileged_access: UnprivilegedAccess::None, allowed_methods: vec![AllowedMethod::Put( - serde_json::to_value(&*DEMO_SLED_PROVISION_STATE).unwrap() + serde_json::to_value(&*DEMO_SLED_PROVISION_POLICY).unwrap() )], }, diff --git a/nexus/tests/output/nexus_tags.txt b/nexus/tests/output/nexus_tags.txt index 7ed73fd30a..adb36a24af 100644 --- a/nexus/tests/output/nexus_tags.txt +++ b/nexus/tests/output/nexus_tags.txt @@ -133,7 +133,7 @@ sled_instance_list GET /v1/system/hardware/sleds/{sle sled_list GET /v1/system/hardware/sleds sled_list_uninitialized GET /v1/system/hardware/sleds-uninitialized sled_physical_disk_list GET /v1/system/hardware/sleds/{sled_id}/disks -sled_set_provision_state PUT /v1/system/hardware/sleds/{sled_id}/provision-state +sled_set_provision_policy PUT /v1/system/hardware/sleds/{sled_id}/provision-policy sled_view GET /v1/system/hardware/sleds/{sled_id} switch_list GET /v1/system/hardware/switches switch_view GET /v1/system/hardware/switches/{switch_id} diff --git a/nexus/types/src/external_api/params.rs b/nexus/types/src/external_api/params.rs index e8caefe1bc..07eeb9b679 100644 --- a/nexus/types/src/external_api/params.rs +++ b/nexus/types/src/external_api/params.rs @@ -96,14 +96,14 @@ pub struct SledSelector { pub sled: Uuid, } -/// Parameters for `sled_set_provision_state`. +/// Parameters for `sled_set_provision_policy`. #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] pub struct SledProvisionPolicyParams { /// The provision state. pub state: super::views::SledProvisionPolicy, } -/// Response to `sled_set_provision_state`. +/// Response to `sled_set_provision_policy`. #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] pub struct SledProvisionPolicyResponse { /// The old provision state. diff --git a/openapi/nexus.json b/openapi/nexus.json index 8f0fd997ca..cc8edec51d 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -4221,13 +4221,13 @@ } } }, - "/v1/system/hardware/sleds/{sled_id}/provision-state": { + "/v1/system/hardware/sleds/{sled_id}/provision-policy": { "put": { "tags": [ "system/hardware" ], - "summary": "Set sled provision state", - "operationId": "sled_set_provision_state", + "summary": "Set sled provision policy", + "operationId": "sled_set_provision_policy", "parameters": [ { "in": "path", @@ -15044,7 +15044,7 @@ ] }, "SledProvisionPolicyParams": { - "description": "Parameters for `sled_set_provision_state`.", + "description": "Parameters for `sled_set_provision_policy`.", "type": "object", "properties": { "state": { @@ -15061,7 +15061,7 @@ ] }, "SledProvisionPolicyResponse": { - "description": "Response to `sled_set_provision_state`.", + "description": "Response to `sled_set_provision_policy`.", "type": "object", "properties": { "new_state": {