StaticBackendDispatcher

Enum StaticBackendDispatcher 

Source
pub enum StaticBackendDispatcher {
    CSM(ShastaClient),
    OCHAMI(Ochami),
}
Expand description

Routes API calls to either a CSM or OCHAMI backend.

Every backend trait (e.g. CfsTrait, GroupTrait, BootParametersTrait) is implemented for this enum under crate::backend_dispatcher. The impls use the dispatch! macro to forward the call to the wrapped client; both variants implement the same trait surface so service code never branches on backend kind.

Cloning is cheap — both inner clients are Arc-shaped internally. Service helpers that need to move the dispatcher into a 'static spawned task call InfraContext::backend_clone() (see crate::service::infra_backend).

Variants§

§

CSM(ShastaClient)

HPE Cray System Management (CSM) backend, used by Alps-style deployments. Wraps a csm-rs HTTP client (ShastaClient).

§

OCHAMI(Ochami)

OpenCHAMI backend, used by sites running the open-source CSM alternative. Wraps an ochami-rs HTTP client.

Implementations§

Source§

impl StaticBackendDispatcher

Source

pub fn backend_kind(&self) -> &'static str

Returns "csm" or "ochami" for the currently-selected variant. Cheap, infallible — intended for use as a structured tracing field.

Source

pub fn new( backend_type: &str, base_url: &str, root_cert: &[u8], socks5_proxy: Option<&str>, ) -> Result<Self, Error>

Create a new dispatcher for the given backend type.

backend_type must be "csm" or "ochami" (matching crate::config::BackendTechnology::as_str); any other value returns [Error::UnsupportedBackend]. root_cert is the PEM bytes of the backend’s root CA — used to verify TLS to base_url. socks5_proxy is an optional SOCKS5 URL applied to every outbound request.

Called once per configured site during server startup.

§Errors
  • [Error::UnsupportedBackend] when backend_type is not "csm" or "ochami".
  • Any error surfaced by ShastaClient::new (CSM variant) when the supplied cert or proxy URL is unusable.

Trait Implementations§

Source§

impl ApplyHwClusterPin for StaticBackendDispatcher

Source§

async fn apply_hw_cluster_pin( &self, token: &str, target_group_name: &str, parent_group_name: &str, pattern: &str, nodryrun: bool, create_target_group: bool, delete_empty_parent_group: bool, ) -> Result<(), Error>

Pin nodes matching pattern from parent_group_name into target_group_name.

Forwards to the backend’s apply_hw_cluster_pin. When nodryrun is false the backend short-circuits before any HSM mutation. create_target_group controls whether the target is created when missing; delete_empty_parent_group removes the source after migration when it is empty.

§Errors

Returns [Error::InvalidPattern] when pattern does not match the backend’s pattern grammar, [Error::InsufficientResources] when the pattern selects fewer nodes than required, [Error::CsmError] / [Error::RequestError] for HSM call failures, and the Ochami default [Error::Message] for the unsupported backend.

Source§

impl ApplySessionTrait for StaticBackendDispatcher

Source§

async fn apply_session( &self, gitea_token: &str, gitea_base_url: &str, token: &str, cfs_conf_sess_name: Option<&str>, playbook_yaml_file_name_opt: Option<&str>, group_name: Option<&str>, repos_name_vec: &[&str], repos_last_commit_id_vec: &[&str], ansible_limit: Option<&str>, ansible_verbosity: Option<&str>, ansible_passthrough: Option<&str>, ) -> Result<(String, String), Error>

Build a CFS configuration from repos_name_vec / repos_last_commit_id_vec and run an Ansible session against it.

Returns (cfs_configuration_name, cfs_session_name) — the names of the artifacts created on the backend.

§Errors

Forwards backend errors verbatim: [Error::CsmError] on CFS rejection (e.g. duplicate configuration name when the helper retries), [Error::LocalGitError] when Gitea metadata lookup fails, [Error::Message] on Ochami.

Source§

impl AuthenticationTrait for StaticBackendDispatcher

Source§

async fn get_api_token( &self, username: &str, password: &str, ) -> Result<String, Error>

Exchange username / password for an API bearer token.

§Errors

Returns [Error::NetError] / [Error::RequestError] when the IdP is unreachable, [Error::CsmError] / [Error::BadRequest] on rejection (bad credentials, MFA challenge, locked account), and [Error::Message] for backend-specific failures.

Source§

async fn validate_api_token(&self, auth_token: &str) -> Result<(), Error>

Validate auth_token against the IdP / introspection endpoint.

Ok(()) means the token is currently accepted by the backend; no claims are returned through this trait.

Source§

impl BootParametersTrait for StaticBackendDispatcher

Source§

async fn get_all_bootparameters( &self, auth_token: &str, ) -> Result<Vec<BootParameters>, Error>

GET /bootparameters — every entry in BSS.

Source§

async fn get_bootparameters( &self, auth_token: &str, nodes: &[String], ) -> Result<Vec<BootParameters>, Error>

GET /bootparameters?hosts=... — entries scoped to nodes.

Source§

async fn add_bootparameters( &self, auth_token: &str, boot_parameters: &BootParameters, ) -> Result<(), Error>

POST /bootparameters — create a new entry.

Source§

async fn update_bootparameters( &self, auth_token: &str, boot_parameters: &BootParameters, ) -> Result<(), Error>

PATCH /bootparameters — merge boot_parameters into the existing entry for its hosts.

Source§

async fn delete_bootparameters( &self, auth_token: &str, boot_parameters: &BootParameters, ) -> Result<String, Error>

DELETE /bootparameters — remove the entry. Returns the backend’s response body verbatim.

Source§

impl CfsTrait for StaticBackendDispatcher

Source§

type T = Pin<Box<dyn AsyncBufRead + Send>>

Associated buffered reader type returned by the session-log streaming methods. Pin-boxed and Send so it can cross await points and be fed straight into the HTTP layer.

Source§

async fn get_cfs_health(&self) -> Result<(), Error>

GET /cfs/healthz — liveness probe.

Source§

async fn get_session_logs_stream( &self, token: &str, site_name: &str, cfs_session_name: &str, timestamps: bool, k8s: &K8sDetails, ) -> Result<Pin<Box<dyn AsyncBufRead + Send>>, Error>

Tail the Ansible-container log of cfs_session_name. Opens a kubectl logs --follow style stream against the session pod in the CSM services namespace via the supplied k8s context.

Source§

async fn get_session_logs_stream_by_xname( &self, auth_token: &str, site_name: &str, xname: &str, timestamps: bool, k8s: &K8sDetails, ) -> Result<Pin<Box<dyn AsyncBufRead + Send>>, Error>

Resolve xname to its most recent CFS session and tail that session’s pod log. Convenience for “what is happening on this node right now”; otherwise identical to get_session_logs_stream.

Source§

async fn post_session( &self, token: &str, session: &CfsSessionPostRequest, ) -> Result<CfsSessionGetResponse, Error>

POST /cfs/v3/sessions — submit session for execution. Returns the backend’s representation of the created session.

Source§

async fn get_sessions( &self, auth_token: &str, session_name_opt: Option<&String>, limit_opt: Option<u8>, after_id_opt: Option<String>, min_age_opt: Option<String>, max_age_opt: Option<String>, status_opt: Option<String>, name_contains_opt: Option<String>, is_succeded_opt: Option<bool>, tags_opt: Option<String>, ) -> Result<Vec<CfsSessionGetResponse>, Error>

GET /cfs/v3/sessions — server-side filtered list. Filters match CFS v3 query parameters verbatim (name, limit, after_id, min_age, max_age, status, name_contains, succeeded, tags).

Source§

async fn get_and_filter_sessions( &self, token: &str, group_name_vec: Vec<String>, xname_vec: Vec<&str>, min_age_opt: Option<&String>, max_age_opt: Option<&String>, type_opt: Option<&String>, status_opt: Option<&String>, cfs_session_name_opt: Option<&String>, limit_number_opt: Option<&u8>, is_succeded_opt: Option<bool>, ) -> Result<Vec<CfsSessionGetResponse>, Error>

Fetch sessions and apply client-side group/xname filtering that CFS doesn’t natively support. The backend issues the broadest query CFS allows, then narrows the result set in-process to group_name_vec / xname_vec / type_opt.

Source§

async fn delete_and_cancel_session( &self, token: &str, group_available_vec: &[Group], cfs_session: &CfsSessionGetResponse, cfs_component_vec: &[CfsComponent], bss_bootparameter_vec: &[BootParameters], dry_run: bool, ) -> Result<(), Error>

Cancel an in-flight session (PATCH status=cancelled) and then delete it along with derived BSS/CFS-component state, gated by group_available_vec (RBAC) and dry_run. The backend validates cfs_session against the supplied components and bootparameters before mutating anything.

Source§

async fn create_configuration_from_repos( &self, gitea_token: &str, gitea_base_url: &str, repo_name_vec: &[&str], local_git_commit_vec: &[&str], playbook_file_name_opt: Option<&str>, ) -> Result<CfsConfigurationRequest, Error>

Build (but do not POST) a CfsConfigurationRequest from Gitea repos pinned to specific commit ids. Used by callers that want to inspect or further edit the configuration before applying it.

Source§

async fn get_configuration( &self, auth_token: &str, cfs_configuration_name_opt: Option<&String>, ) -> Result<Vec<CfsConfigurationResponse>, Error>

GET /cfs/v3/configurations — single configuration when cfs_configuration_name_opt is Some, otherwise the full list.

Source§

async fn get_and_filter_configuration( &self, auth_token: &str, configuration_name: Option<&str>, configuration_name_pattern: Option<&str>, group_name_vec: &[String], since_opt: Option<NaiveDateTime>, until_opt: Option<NaiveDateTime>, limit_number_opt: Option<&u8>, ) -> Result<Vec<CfsConfigurationResponse>, Error>

List configurations, optionally narrowed by exact name, regex, the groups the caller can see, a date window, and a result count cap. Name/group filtering happens server-side where CFS supports it and client-side otherwise.

Source§

async fn get_configuration_layer_details( &self, gitea_base_url: &str, gitea_token: &str, layer: Layer, site_name: &str, ) -> Result<LayerDetails, Error>

Resolve a single configuration Layer (Gitea repo + commit or branch + playbook) to its enriched LayerDetails — adds the most recent commit metadata, the resolved commit when only a branch was given, and any tag the commit carries.

Source§

async fn update_runtime_configuration( &self, auth_token: &str, xnames: &[String], desired_configuration: &str, enabled: bool, ) -> Result<(), Error>

PATCH /cfs/v3/components — set desired_configuration on each xnames[] entry and toggle the component enabled flag. This is the per-node “runtime reconfigure” knob (next CFS pass picks the change up).

Source§

async fn put_configuration( &self, token: &str, configuration: &CfsConfigurationRequest, configuration_name: &str, overwrite: bool, ) -> Result<CfsConfigurationResponse, Error>

PUT /cfs/v3/configurations/{name} — create or replace configuration_name. When overwrite is false and the configuration already exists, the backend returns [Error::ConfigurationAlreadyExistsError].

Source§

async fn get_derivatives( &self, auth_token: &str, configuration_name: &str, ) -> Result<(Option<Vec<CfsSessionGetResponse>>, Option<Vec<BosSessionTemplate>>, Option<Vec<Image>>), Error>

Find every artifact that references configuration_name: sessions that ran against it, BOS templates that pin it, and IMS images stamped with it. Each tuple slot is None when the corresponding lookup returned an empty result so callers can distinguish “no derivatives” from “lookup not performed”.

Source§

async fn get_cfs_components( &self, token: &str, configuration_name: Option<&str>, components_ids: Option<&str>, status: Option<&str>, ) -> Result<Vec<CfsComponent>, Error>

GET /cfs/v3/components — per-xname CFS state filtered by configuration_name, an ids= xname list, and/or status (e.g. pending, failed, configured).

Source§

impl Clone for StaticBackendDispatcher

Source§

fn clone(&self) -> StaticBackendDispatcher

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ClusterSessionTrait for StaticBackendDispatcher

Source§

async fn post_template_session( &self, token: &str, bos_session: BosSession, ) -> Result<BosSession, Error>

Submit a BOS session derived from an existing template. Returns the persisted [BosSession] (the backend assigns the id).

Source§

impl ClusterTemplateTrait for StaticBackendDispatcher

Source§

async fn get_template( &self, token: &str, bos_session_template_id_opt: Option<&str>, ) -> Result<Vec<BosSessionTemplate>, Error>

GET /sessiontemplates/{id} when an id is supplied, otherwise the full list. Returned as a Vec for shape parity with the list call; a single-id lookup yields a one-element vector.

Source§

async fn get_and_filter_templates( &self, token: &str, group_name_vec: &[String], group_member_vec: &[String], bos_sessiontemplate_name_opt: Option<&str>, limit_number_opt: Option<&u8>, ) -> Result<Vec<BosSessionTemplate>, Error>

Fetch templates and apply client-side filtering by visible group names, observed xname members, an exact template name, and a max result count. BOS does not support these as native query params, so the backend over-fetches and narrows in-process.

Source§

async fn get_all_templates( &self, token: &str, ) -> Result<Vec<BosSessionTemplate>, Error>

GET /sessiontemplates — every template (unfiltered).

Source§

async fn put_template( &self, token: &str, bos_template: &BosSessionTemplate, bos_template_name: &str, ) -> Result<BosSessionTemplate, Error>

PUT /sessiontemplates/{name} — create-or-replace. Returns the persisted template (with backend-assigned timestamps).

Source§

async fn delete_template( &self, token: &str, bos_template_id: &str, ) -> Result<(), Error>

DELETE /sessiontemplates/{id}.

Source§

impl ComponentEthernetInterfaceTrait for StaticBackendDispatcher

Source§

async fn get_all_component_ethernet_interfaces( &self, auth_token: &str, ) -> Result<Vec<ComponentEthernetInterface>, Error>

GET /Inventory/EthernetInterfaces — every interface.

Source§

async fn get_component_ethernet_interface( &self, auth_token: &str, eth_interface_id: &str, ) -> Result<ComponentEthernetInterface, Error>

GET /Inventory/EthernetInterfaces/{id} — one interface.

Source§

async fn add_component_ethernet_interface( &self, auth_token: &str, component_ethernet_interface: &ComponentEthernetInterface, ) -> Result<(), Error>

POST /Inventory/EthernetInterfaces — create.

Source§

async fn update_component_ethernet_interface( &self, auth_token: &str, eth_interface_id: &str, description: Option<&str>, ip_address_mapping: (&str, &str), ) -> Result<Value, Error>

PATCH /Inventory/EthernetInterfaces/{id} — update description and/or the (current_ip, new_ip) mapping. Returns HSM’s raw JSON response.

Source§

async fn delete_all_component_ethernet_interfaces( &self, auth_token: &str, ) -> Result<Value, Error>

DELETE /Inventory/EthernetInterfaces — wipe the collection. Returns HSM’s action-summary JSON.

Source§

async fn delete_component_ethernet_interface( &self, auth_token: &str, eth_interface_id: &str, ) -> Result<Value, Error>

DELETE /Inventory/EthernetInterfaces/{id}.

Source§

impl ComponentTrait for StaticBackendDispatcher

Source§

async fn get_all_nodes( &self, auth_token: &str, nid_only: Option<&str>, ) -> Result<NodeMetadataArray, Error>

GET /State/Components?type=Node — every node in HSM. When nid_only is set, the backend forwards nid_only=true to the HSM which limits the returned representation to the NID field.

Source§

async fn get_node_metadata_available( &self, auth_token: &str, ) -> Result<Vec<Component>, Error>

RBAC-aware node listing: HSM filtered to the components the caller’s groups grant access to. Used to populate the user’s visible inventory after auth.

Source§

async fn get( &self, auth_token: &str, id: Option<&str>, type: Option<&str>, state: Option<&str>, flag: Option<&str>, role: Option<&str>, subrole: Option<&str>, enabled: Option<&str>, software_status: Option<&str>, subtype: Option<&str>, arch: Option<&str>, class: Option<&str>, nid: Option<&str>, nid_start: Option<&str>, nid_end: Option<&str>, partition: Option<&str>, group: Option<&str>, state_only: Option<&str>, flag_only: Option<&str>, role_only: Option<&str>, nid_only: Option<&str>, ) -> Result<NodeMetadataArray, Error>

GET /State/Components with the full HSM filter set forwarded verbatim. Every Option<&str> maps 1:1 to a query parameter on the upstream endpoint; the *_only parameters restrict the returned fields (HSM’s “lite” projections).

Source§

async fn post_nodes( &self, auth_token: &str, component: ComponentArrayPostArray, ) -> Result<(), Error>

POST /State/Components — bulk-create node components.

Source§

async fn delete_node( &self, auth_token: &str, id: &str, ) -> Result<HsmActionResponse, Error>

DELETE /State/Components/{id} — remove a single component (typically an xname). The returned HsmActionResponse reports how many records were affected.

Source§

async fn nid_to_xname( &self, auth_token: &str, user_input_nid: &str, is_regex: bool, ) -> Result<Vec<String>, Error>

Resolve a NID expression (single id, range, or regex when is_regex) to xnames by scanning HSM nodes. The matching logic runs client-side because HSM’s NID query parameter does not support ranges or patterns.

Source§

impl ConsoleTrait for StaticBackendDispatcher

Source§

async fn attach_to_node_console( &self, token: &str, site_name: &str, xname: &str, initial_size: TermSize, k8s: &K8sDetails, ) -> Result<ConsoleAttachment, Error>

Attach to xname’s console. Returns the stdin/stdout/resize handle; the caller drives the lifetime by dropping the channels.

Source§

async fn attach_to_session_console( &self, token: &str, site_name: &str, session_name: &str, initial_size: TermSize, k8s: &K8sDetails, ) -> Result<ConsoleAttachment, Error>

Attach to the Ansible-container console of a running CFS session, identified by session_name. Same handle shape as attach_to_node_console.

Source§

impl Debug for StaticBackendDispatcher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeleteConfigurationsAndDataRelatedTrait for StaticBackendDispatcher

Source§

async fn get_data_to_delete( &self, token: &str, group_name_available_vec: &[String], configuration_name_pattern_opt: Option<&str>, since_opt: Option<NaiveDateTime>, until_opt: Option<NaiveDateTime>, ) -> Result<(Vec<CfsSessionGetResponse>, Vec<(String, String, String)>, Vec<String>, Vec<String>, Vec<(String, String, String)>, Vec<CfsConfigurationResponse>), Error>

Dry-run inventory: enumerate every artifact that would be touched by a matching delete call without actually deleting anything. Returns (sessions, image_refs, configuration_names, session_template_names, template_refs, configurations) where the (String, String, String) triples carry id/name/derived-id triples ready to be shown to the operator before they confirm.

Source§

async fn delete( &self, token: &str, cfs_configuration_name_vec: &[String], image_id_vec: &[String], cfs_session_name_vec: &[String], bos_sessiontemplate_name_vec: &[String], ) -> Result<(), Error>

Execute the cascade: delete BOS templates, CFS sessions, IMS images, and finally the CFS configurations themselves, in that order so foreign-key-like references are gone before the configurations they point at. Each input slice is the exact set of names/ids to delete — typically the output of get_data_to_delete.

Source§

impl GetImagesAndDetailsTrait for StaticBackendDispatcher

Source§

async fn get_images_and_details( &self, token: &str, group_group_name_vec: &[String], id_opt: Option<&str>, limit_number: Option<&u8>, ) -> Result<Vec<(Image, String, String, bool)>, Error>

Return up to limit_number images visible to group_group_name_vec, optionally narrowed by id_opt. Each tuple is (image, cfs_configuration_name, bos_template_name, is_bootable); the strings are empty when the corresponding derivative is absent.

Source§

impl GroupTrait for StaticBackendDispatcher

Source§

async fn get_group_available( &self, auth_token: &str, ) -> Result<Vec<Group>, Error>

RBAC-filtered group listing: the subset of HSM groups the caller’s JWT roles grant access to. Returns full Group objects.

Source§

async fn get_group_name_available( &self, jwt_token: &str, ) -> Result<Vec<String>, Error>

RBAC-filtered group listing, names only — faster path used when the caller only needs the group label set (e.g. to validate a filter argument).

Source§

async fn add_group( &self, auth_token: &str, group_name: Group, ) -> Result<Group, Error>

POST /groups — create a group. Returns the persisted group echoed back by HSM.

Source§

async fn get_member_vec_from_group_name_vec( &self, auth_token: &str, group_name_vec: &[String], ) -> Result<Vec<String>, Error>

Union of /groups/{name}/members across group_name_vec, deduplicated.

Source§

async fn get_group_map_and_filter_by_group_vec( &self, auth_token: &str, group_name_vec: &[&str], ) -> Result<HashMap<String, Vec<String>>, Error>

Map of group_name -> [member xnames] restricted to the groups named in group_name_vec. One HSM call per group plus a merge.

Source§

async fn get_group_map_and_filter_by_member_vec( &self, auth_token: &str, member_vec: &[&str], ) -> Result<HashMap<String, Vec<String>>, Error>

Map of group_name -> [member xnames] restricted to groups that contain any xname in member_vec. The dual of get_group_map_and_filter_by_group_vec.

Source§

async fn get_group( &self, auth_token: &str, group_name: &str, ) -> Result<Group, Error>

GET /groups/{name} — one group by exact label.

Source§

async fn get_groups( &self, auth_token: &str, group_name_vec: Option<&[String]>, ) -> Result<Vec<Group>, Error>

GET /groups — every group when group_name_vec is None, otherwise the named subset.

Source§

async fn delete_group( &self, auth_token: &str, group_name: &str, ) -> Result<HsmActionResponse, Error>

DELETE /groups/{name}. Returns HSM’s action-summary (records affected).

Source§

async fn get_group_map_and_filter_by_group_name_vec( &self, auth_token: &str, group_name_vec: &[&str], ) -> Result<HashMap<String, Vec<String>>, Error>

Alias for get_group_map_and_filter_by_group_vec kept for upstream-trait shape compatibility.

Source§

async fn post_member( &self, auth_token: &str, group_name: &str, xname: &str, ) -> Result<HsmActionResponse, Error>

POST /groups/{name}/members — add one xname.

Source§

async fn add_members_to_group( &self, auth_token: &str, group_name: &str, xnames: &[&str], ) -> Result<Vec<String>, Error>

Batched post_member. Returns the xnames the backend reported as successfully added (some entries may be skipped if already members).

Source§

async fn delete_member_from_group( &self, auth_token: &str, group_name: &str, xname: &str, ) -> Result<(), Error>

DELETE /groups/{name}/members/{xname}.

Source§

async fn migrate_group_members( &self, auth_token: &str, target_group_name: &str, parent_group_name: &str, new_target_group_members: &[&str], dryrun: bool, ) -> Result<(Vec<String>, Vec<String>), Error>

Move new_target_group_members from parent_group_name into target_group_name. Returns (added, removed) xname lists. When dryrun the backend computes the diff without mutating either group.

Source§

async fn update_group_members( &self, auth_token: &str, group_name: &str, members_to_remove: &[&str], members_to_add: &[&str], ) -> Result<(), Error>

In-place edit of a single group’s membership — applies members_to_remove then members_to_add to group_name as two HSM calls. Used by the manta group set-members path where the caller has pre-computed the diff.

Source§

impl HardwareInventory for StaticBackendDispatcher

Source§

async fn get_inventory_hardware( &self, auth_token: &str, xname: &str, ) -> Result<NodeSummary, Error>

GET /Inventory/Hardware/Query/{xname} projected to a NodeSummary (CPU model count, memory, accelerator count, …). The thin per-node view used by listings.

Source§

async fn get_inventory_hardware_query( &self, auth_token: &str, xname: &str, type: Option<&str>, children: Option<bool>, parents: Option<bool>, partition: Option<&str>, format: Option<&str>, ) -> Result<HWInventory, Error>

GET /Inventory/Hardware/Query/{xname} with the full HSM query parameter set — type, children, parents, partition, format. Returns the raw [HWInventory] tree.

Source§

async fn post_inventory_hardware( &self, auth_token: &str, hardware: HWInventoryByLocationList, ) -> Result<HsmActionResponse, Error>

POST /Inventory/Hardware — push a hardware-by-location list into HSM (used by discovery / restore flows). The returned HsmActionResponse reports how many records were inserted or updated.

Source§

impl ImsTrait for StaticBackendDispatcher

Source§

async fn get_images( &self, token: &str, image_id_opt: Option<&str>, ) -> Result<Vec<Image>, Error>

GET /images/{id} when image_id_opt is Some, otherwise the full image list. Returned as Vec<Image> for shape consistency with the list path.

Source§

async fn get_all_images(&self, token: &str) -> Result<Vec<Image>, Error>

GET /images — every image visible to the bearer.

Source§

fn filter_images(&self, image_vec: &mut Vec<Image>) -> Result<(), Error>

In-place client-side filter applied to image_vec (the only sync method on this trait). The backend strips images the caller cannot see or that fail a per-backend visibility rule.

Source§

async fn update_image( &self, token: &str, image_id: &str, image: &PatchImage, ) -> Result<(), Error>

PATCH /images/{id} — apply image as a partial update.

Source§

async fn delete_image(&self, token: &str, image_id: &str) -> Result<(), Error>

DELETE /images/{id}.

Source§

impl MigrateBackupTrait for StaticBackendDispatcher

Source§

async fn migrate_backup( &self, token: &str, bos: Option<&str>, destination: Option<&str>, ) -> Result<(), Error>

Dump the state derived from BOS session template bos (when Some, otherwise every visible template) into destination. destination = None resolves to the backend’s default output directory.

Source§

impl MigrateRestoreTrait for StaticBackendDispatcher

Source§

async fn migrate_restore( &self, token: &str, bos_file: Option<&str>, cfs_file: Option<&str>, group_file: Option<&str>, ims_file: Option<&str>, image_dir: Option<&str>, overwrite_group: bool, overwrite_configuration: bool, overwrite_image: bool, overwrite_template: bool, ) -> Result<(), Error>

Re-create artifacts from the supplied dump files. Each *_file is optional so callers can restore a subset (e.g. just IMS images). image_dir points at the on-disk IMS payload directory backed up alongside ims_file.

Source§

impl PCSTrait for StaticBackendDispatcher

Source§

async fn power_status( &self, auth_token: &str, nodes: &[String], power_status_filter: Option<&str>, management_state_filter: Option<&str>, ) -> Result<PowerStatusAll, Error>

GET /power-status?xname=... — current power state for each nodes entry. power_status_filter and management_state_filter map to the upstream powerStatusFilter / managementStateFilter query parameters.

Source§

async fn pcs_transitions_post( &self, auth_token: &str, operation: &str, nodes: &[String], ) -> Result<TransitionStartOutput, Error>

POST /transitions — start a power operation (e.g. on, off, soft-restart) against nodes. Returns the transition id; the caller polls pcs_transitions_get for the outcome.

Source§

async fn pcs_transitions_get( &self, auth_token: &str, transition_id: &str, ) -> Result<TransitionResponse, Error>

GET /transitions/{id} — single transition’s progress / final status. Polled by the CLI to drive the power-op wait loop.

Source§

impl RedfishEndpointTrait for StaticBackendDispatcher

Source§

async fn get_all_redfish_endpoints( &self, auth_token: &str, ) -> Result<RedfishEndpointArray, Error>

GET /RedfishEndpoints — every registered BMC endpoint.

Source§

async fn get_redfish_endpoints( &self, auth_token: &str, id: Option<&str>, fqdn: Option<&str>, type: Option<&str>, uuid: Option<&str>, macaddr: Option<&str>, ip_address: Option<&str>, last_status: Option<&str>, ) -> Result<RedfishEndpointArray, Error>

GET /RedfishEndpoints with the full HSM filter set (id, fqdn, type, uuid, macaddr, ip_address, last_status).

Source§

async fn add_redfish_endpoint( &self, auth_token: &str, redfish_endpoint: &RedfishEndpointArray, ) -> Result<(), Error>

POST /RedfishEndpoints — bulk-register endpoints.

Source§

async fn update_redfish_endpoint( &self, auth_token: &str, redfish_endpoint: &RedfishEndpoint, ) -> Result<(), Error>

PUT /RedfishEndpoints/{id} — replace a single endpoint’s record.

Source§

async fn delete_redfish_endpoint( &self, auth_token: &str, id: &str, ) -> Result<Value, Error>

DELETE /RedfishEndpoints/{id}. Returns HSM’s raw JSON action summary.

Source§

impl SatTrait for StaticBackendDispatcher

Source§

async fn apply_sat_file( &self, params: ApplySatFileParams<'_>, ) -> Result<(Vec<CfsConfigurationResponse>, Vec<Image>, Vec<BosSessionTemplate>, Vec<BosSession>), Error>

Apply an entire SAT file (configurations, images, session_templates, optional sessions) in one call. Returns the tuple (configurations, images, session_templates, sessions) of what was created — empty vectors when a section is absent.

Source§

async fn validate_sat_file( &self, params: ValidateSatFileParams<'_>, ) -> Result<(), Error>

Pre-flight check: validate params against live backend state without mutating anything. Returns Ok(()) if the SAT file would apply cleanly, fail-fast on the first detected mismatch.

Source§

async fn apply_configuration( &self, params: ApplyConfigurationParams<'_>, ) -> Result<CfsConfigurationResponse, Error>

Apply a single SAT configurations[] entry — resolve any product:/git: layers, POST the resulting CfsConfigurationRequest to CFS, return the persisted configuration (or a mock in params.dry_run).

Source§

async fn apply_image( &self, params: ApplyImageParams<'_>, ) -> Result<Image, Error>

Apply a single SAT images[] entry synchronously: kick off the CFS image-build session and wait for it to complete, stamping manta.image_session.* provenance metadata onto the produced IMS image before returning. For non-blocking flow, drive apply_sat_image_create_session and apply_sat_image_stamp_from_session directly.

Source§

async fn apply_sat_image_create_session( &self, params: ApplyImageCreateSessionParams<'_>, ) -> Result<CfsSessionGetResponse, Error>

First half of the split image-apply flow: validate, resolve base.image_ref, POST the CFS image-build session. Returns the created session record without waiting for it to finish.

Source§

async fn apply_sat_image_stamp_from_session( &self, params: ApplyImageStampParams<'_>, ) -> Result<Image, Error>

Second half of the split image-apply flow: read the (assumed completed) CFS session referenced by params, locate the IMS image it produced, stamp manta.image_session.* provenance metadata, and return the stamped image.

Source§

async fn apply_session_template( &self, params: ApplySessionTemplateParams<'_>, ) -> Result<(BosSessionTemplate, Option<BosSession>), Error>

Apply a single SAT session_templates[] entry — PUT the BOS session template, then (when params.reboot is true) POST a BOS session derived from it. Returns (persisted_template, Some(session)) when a reboot session was kicked off, (persisted_template, None) otherwise.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,