manta_server/backend_dispatcher/
boot_parameters.rs

1//! [`BootParametersTrait`] impl for [`StaticBackendDispatcher`].
2//!
3//! Forwards to the BSS (Boot Script Service) bootparameters API:
4//! `GET/POST/PATCH/DELETE /apis/bss/boot/v1/bootparameters`. Both CSM
5//! and Ochami implement these methods natively; no Ochami branch
6//! returns the trait default.
7
8use super::*;
9
10impl BootParametersTrait for StaticBackendDispatcher {
11  /// `GET /bootparameters` — every entry in BSS.
12  async fn get_all_bootparameters(
13    &self,
14    auth_token: &str,
15  ) -> Result<Vec<BootParameters>, Error> {
16    dispatch!(self, get_all_bootparameters, auth_token)
17  }
18
19  /// `GET /bootparameters?hosts=...` — entries scoped to `nodes`.
20  async fn get_bootparameters(
21    &self,
22    auth_token: &str,
23    nodes: &[String],
24  ) -> Result<Vec<BootParameters>, Error> {
25    dispatch!(self, get_bootparameters, auth_token, nodes)
26  }
27
28  /// `POST /bootparameters` — create a new entry.
29  async fn add_bootparameters(
30    &self,
31    auth_token: &str,
32    boot_parameters: &BootParameters,
33  ) -> Result<(), Error> {
34    dispatch!(self, add_bootparameters, auth_token, boot_parameters)
35  }
36
37  /// `PATCH /bootparameters` — merge `boot_parameters` into the
38  /// existing entry for its hosts.
39  async fn update_bootparameters(
40    &self,
41    auth_token: &str,
42    boot_parameters: &BootParameters,
43  ) -> Result<(), Error> {
44    dispatch!(self, update_bootparameters, auth_token, boot_parameters)
45  }
46
47  /// `DELETE /bootparameters` — remove the entry. Returns the
48  /// backend's response body verbatim.
49  async fn delete_bootparameters(
50    &self,
51    auth_token: &str,
52    boot_parameters: &BootParameters,
53  ) -> Result<String, Error> {
54    dispatch!(self, delete_bootparameters, auth_token, boot_parameters)
55  }
56}