manta_shared/types/api/redfish_endpoints.rs
1//! Parameters for `GET`, `POST`, and `PUT` on `/redfish-endpoints`.
2
3/// Typed parameters for fetching Redfish endpoints.
4///
5/// All fields are optional filters; setting none returns every
6/// registered endpoint.
7pub struct GetRedfishEndpointsParams {
8 /// Exact endpoint ID (BMC xname).
9 pub id: Option<String>,
10 /// FQDN substring filter.
11 pub fqdn: Option<String>,
12 /// UUID exact match.
13 pub uuid: Option<String>,
14 /// MAC-address exact match (colon-separated hex).
15 pub macaddr: Option<String>,
16 /// IP-address exact match (IPv4 or IPv6).
17 pub ipaddress: Option<String>,
18}
19
20/// Typed parameters for adding or updating a Redfish endpoint.
21///
22/// Shared request body for **both** `POST /redfish-endpoints` (add a
23/// new endpoint) and `PUT /redfish-endpoints` (replace an existing
24/// one by `id`). PUT is a full replacement — every field is written,
25/// so partial updates require reading the existing endpoint first.
26//
27// The four bool fields (`enabled`, `use_ssdp`, `mac_required`,
28// `rediscover_on_update`) are independent BMC feature toggles defined
29// by the upstream HSM Redfish-endpoints API; there is no enum that
30// captures them as a single mode, so the `struct_excessive_bools` lint
31// is silenced here.
32#[allow(clippy::struct_excessive_bools)]
33#[derive(serde::Deserialize, serde::Serialize, utoipa::ToSchema)]
34pub struct UpdateRedfishEndpointParams {
35 /// Xname identifying the BMC (e.g. `x3000c0s1b0`).
36 pub id: String,
37 /// Optional human-readable name.
38 pub name: Option<String>,
39 /// Hostname portion of the BMC FQDN.
40 pub hostname: Option<String>,
41 /// Domain portion of the BMC FQDN.
42 pub domain: Option<String>,
43 /// Full FQDN; overrides hostname+domain when set.
44 pub fqdn: Option<String>,
45 /// Whether the endpoint is enabled for discovery.
46 pub enabled: bool,
47 /// BMC username for Redfish authentication.
48 pub user: Option<String>,
49 /// BMC password for Redfish authentication.
50 pub password: Option<String>,
51 /// Use SSDP for automatic endpoint discovery.
52 pub use_ssdp: bool,
53 /// Whether a MAC address is required for geolocation.
54 pub mac_required: bool,
55 /// BMC MAC address (colon-separated).
56 pub mac_addr: Option<String>,
57 /// BMC IP address (IPv4 or IPv6).
58 pub ip_address: Option<String>,
59 /// Trigger a rediscovery pass when the endpoint is updated.
60 pub rediscover_on_update: bool,
61 /// ID of a discovery template to apply.
62 pub template_id: Option<String>,
63}