pub enum StaticBackendDispatcher {
CSM(ShastaClient),
OCHAMI(Ochami),
}Expand description
Routes API calls to either a CSM or OCHAMI backend.
All backend-specific trait methods are dispatched via
the dispatch! macro defined in the
crate::backend_dispatcher module.
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
impl StaticBackendDispatcher
Sourcepub fn backend_kind(&self) -> &'static str
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.
Trait Implementations§
Source§impl ApplyHwClusterPin for StaticBackendDispatcher
impl ApplyHwClusterPin for StaticBackendDispatcher
Source§impl ApplySessionTrait for StaticBackendDispatcher
impl ApplySessionTrait for StaticBackendDispatcher
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>
Source§impl AuthenticationTrait for StaticBackendDispatcher
impl AuthenticationTrait for StaticBackendDispatcher
Source§impl BootParametersTrait for StaticBackendDispatcher
impl BootParametersTrait for StaticBackendDispatcher
async fn get_all_bootparameters( &self, auth_token: &str, ) -> Result<Vec<BootParameters>, Error>
async fn get_bootparameters( &self, auth_token: &str, nodes: &[String], ) -> Result<Vec<BootParameters>, Error>
async fn add_bootparameters( &self, auth_token: &str, boot_parameters: &BootParameters, ) -> Result<(), Error>
async fn update_bootparameters( &self, auth_token: &str, boot_parameters: &BootParameters, ) -> Result<(), Error>
async fn delete_bootparameters( &self, auth_token: &str, boot_parameters: &BootParameters, ) -> Result<String, Error>
Source§impl CfsTrait for StaticBackendDispatcher
impl CfsTrait for StaticBackendDispatcher
type T = Pin<Box<dyn AsyncBufRead + Send>>
async fn get_cfs_health(&self) -> Result<(), Error>
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>
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>
async fn post_session( &self, token: &str, session: &CfsSessionPostRequest, ) -> Result<CfsSessionGetResponse, Error>
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>
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>
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>
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>
async fn get_configuration( &self, auth_token: &str, cfs_configuration_name_opt: Option<&String>, ) -> Result<Vec<CfsConfigurationResponse>, Error>
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>
async fn get_configuration_layer_details( &self, gitea_base_url: &str, gitea_token: &str, layer: Layer, site_name: &str, ) -> Result<LayerDetails, Error>
async fn update_runtime_configuration( &self, auth_token: &str, xnames: &[String], desired_configuration: &str, enabled: bool, ) -> Result<(), Error>
async fn put_configuration( &self, token: &str, configuration: &CfsConfigurationRequest, configuration_name: &str, overwrite: bool, ) -> Result<CfsConfigurationResponse, Error>
async fn get_derivatives( &self, auth_token: &str, configuration_name: &str, ) -> Result<(Option<Vec<CfsSessionGetResponse>>, Option<Vec<BosSessionTemplate>>, Option<Vec<Image>>), Error>
async fn get_cfs_components( &self, token: &str, configuration_name: Option<&str>, components_ids: Option<&str>, status: Option<&str>, ) -> Result<Vec<CfsComponent>, Error>
Source§impl Clone for StaticBackendDispatcher
impl Clone for StaticBackendDispatcher
Source§fn clone(&self) -> StaticBackendDispatcher
fn clone(&self) -> StaticBackendDispatcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ClusterSessionTrait for StaticBackendDispatcher
impl ClusterSessionTrait for StaticBackendDispatcher
async fn post_template_session( &self, token: &str, bos_session: BosSession, ) -> Result<BosSession, Error>
Source§impl ClusterTemplateTrait for StaticBackendDispatcher
impl ClusterTemplateTrait for StaticBackendDispatcher
async fn get_template( &self, token: &str, bos_session_template_id_opt: Option<&str>, ) -> Result<Vec<BosSessionTemplate>, Error>
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>
async fn get_all_templates( &self, token: &str, ) -> Result<Vec<BosSessionTemplate>, Error>
async fn put_template( &self, token: &str, bos_template: &BosSessionTemplate, bos_template_name: &str, ) -> Result<BosSessionTemplate, Error>
async fn delete_template( &self, token: &str, bos_template_id: &str, ) -> Result<(), Error>
Source§impl ComponentEthernetInterfaceTrait for StaticBackendDispatcher
impl ComponentEthernetInterfaceTrait for StaticBackendDispatcher
async fn get_all_component_ethernet_interfaces( &self, auth_token: &str, ) -> Result<Vec<ComponentEthernetInterface>, Error>
async fn get_component_ethernet_interface( &self, auth_token: &str, eth_interface_id: &str, ) -> Result<ComponentEthernetInterface, Error>
async fn add_component_ethernet_interface( &self, auth_token: &str, component_ethernet_interface: &ComponentEthernetInterface, ) -> Result<(), Error>
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>
async fn delete_all_component_ethernet_interfaces( &self, auth_token: &str, ) -> Result<Value, Error>
async fn delete_component_ethernet_interface( &self, auth_token: &str, eth_interface_id: &str, ) -> Result<Value, Error>
Source§impl ComponentTrait for StaticBackendDispatcher
impl ComponentTrait for StaticBackendDispatcher
async fn get_all_nodes( &self, auth_token: &str, nid_only: Option<&str>, ) -> Result<NodeMetadataArray, Error>
async fn get_node_metadata_available( &self, auth_token: &str, ) -> Result<Vec<Component>, Error>
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>
async fn post_nodes( &self, auth_token: &str, component: ComponentArrayPostArray, ) -> Result<(), Error>
async fn delete_node( &self, auth_token: &str, id: &str, ) -> Result<HsmActionResponse, Error>
Source§async fn nid_to_xname(
&self,
auth_token: &str,
user_input_nid: &str,
is_regex: bool,
) -> Result<Vec<String>, Error>
async fn nid_to_xname( &self, auth_token: &str, user_input_nid: &str, is_regex: bool, ) -> Result<Vec<String>, Error>
Get list of xnames from NIDs
The list of NIDs can be:
- comma separated list of NIDs (eg: nid000001,nid000002,nid000003)
- regex (eg: nid00000.*)
- hostlist (eg: nid0000[01-15])
Source§impl ConsoleTrait for StaticBackendDispatcher
impl ConsoleTrait for StaticBackendDispatcher
async fn attach_to_node_console( &self, token: &str, site_name: &str, xname: &str, initial_size: TermSize, k8s: &K8sDetails, ) -> Result<ConsoleAttachment, Error>
async fn attach_to_session_console( &self, token: &str, site_name: &str, session_name: &str, initial_size: TermSize, k8s: &K8sDetails, ) -> Result<ConsoleAttachment, Error>
Source§impl Debug for StaticBackendDispatcher
impl Debug for StaticBackendDispatcher
Source§impl DeleteConfigurationsAndDataRelatedTrait for StaticBackendDispatcher
impl DeleteConfigurationsAndDataRelatedTrait for StaticBackendDispatcher
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>
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>
Source§impl GetImagesAndDetailsTrait for StaticBackendDispatcher
impl GetImagesAndDetailsTrait for StaticBackendDispatcher
Source§impl GroupTrait for StaticBackendDispatcher
impl GroupTrait for StaticBackendDispatcher
async fn get_group_available( &self, auth_token: &str, ) -> Result<Vec<Group>, Error>
async fn get_group_name_available( &self, jwt_token: &str, ) -> Result<Vec<String>, Error>
async fn add_group( &self, auth_token: &str, group_name: Group, ) -> Result<Group, Error>
async fn get_member_vec_from_group_name_vec( &self, auth_token: &str, group_name_vec: &[String], ) -> Result<Vec<String>, Error>
async fn get_group_map_and_filter_by_group_vec( &self, auth_token: &str, group_name_vec: &[&str], ) -> Result<HashMap<String, Vec<String>>, Error>
async fn get_group_map_and_filter_by_member_vec( &self, auth_token: &str, member_vec: &[&str], ) -> Result<HashMap<String, Vec<String>>, Error>
async fn get_group( &self, auth_token: &str, group_name: &str, ) -> Result<Group, Error>
async fn get_groups( &self, auth_token: &str, group_name_vec: Option<&[String]>, ) -> Result<Vec<Group>, Error>
async fn delete_group( &self, auth_token: &str, group_name: &str, ) -> Result<HsmActionResponse, Error>
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>
async fn post_member( &self, auth_token: &str, group_name: &str, xname: &str, ) -> Result<HsmActionResponse, Error>
async fn add_members_to_group( &self, auth_token: &str, group_name: &str, xnames: &[&str], ) -> Result<Vec<String>, Error>
async fn delete_member_from_group( &self, auth_token: &str, group_name: &str, xname: &str, ) -> Result<(), Error>
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>
async fn update_group_members( &self, auth_token: &str, group_name: &str, members_to_remove: &[&str], members_to_add: &[&str], ) -> Result<(), Error>
Source§impl HardwareInventory for StaticBackendDispatcher
impl HardwareInventory for StaticBackendDispatcher
Source§async fn get_inventory_hardware(
&self,
auth_token: &str,
xname: &str,
) -> Result<NodeSummary, Error>
async fn get_inventory_hardware( &self, auth_token: &str, xname: &str, ) -> Result<NodeSummary, Error>
Fetch a single node’s hardware inventory as a typed summary. Read more
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>
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>
Run an
/Inventory/Hardware/Query/{xname} request and return the
hierarchical [HWInventory] response (cabinets → chassis →
compute modules → nodes, etc., depending on the format and
children/parents flags).Source§async fn post_inventory_hardware(
&self,
auth_token: &str,
hardware: HWInventoryByLocationList,
) -> Result<HsmActionResponse, Error>
async fn post_inventory_hardware( &self, auth_token: &str, hardware: HWInventoryByLocationList, ) -> Result<HsmActionResponse, Error>
Submit a hardware-inventory write to HSM (e.g. discovery agents
publishing new components). Returns the typed
[
HsmActionResponse] ack from CSM (code + message,
per swagger Response_1.0.0).Source§impl ImsTrait for StaticBackendDispatcher
impl ImsTrait for StaticBackendDispatcher
async fn get_images( &self, token: &str, image_id_opt: Option<&str>, ) -> Result<Vec<Image>, Error>
async fn get_all_images(&self, token: &str) -> Result<Vec<Image>, Error>
fn filter_images(&self, image_vec: &mut Vec<Image>) -> Result<(), Error>
async fn update_image( &self, token: &str, image_id: &str, image: &PatchImage, ) -> Result<(), Error>
async fn delete_image(&self, token: &str, image_id: &str) -> Result<(), Error>
Source§impl MigrateBackupTrait for StaticBackendDispatcher
impl MigrateBackupTrait for StaticBackendDispatcher
Source§impl MigrateRestoreTrait for StaticBackendDispatcher
impl MigrateRestoreTrait for StaticBackendDispatcher
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>
Source§impl PCSTrait for StaticBackendDispatcher
impl PCSTrait for StaticBackendDispatcher
async fn power_status( &self, auth_token: &str, nodes: &[String], power_status_filter: Option<&str>, management_state_filter: Option<&str>, ) -> Result<PowerStatusAll, Error>
Source§async fn pcs_transitions_post(
&self,
auth_token: &str,
operation: &str,
nodes: &[String],
) -> Result<TransitionStartOutput, Error>
async fn pcs_transitions_post( &self, auth_token: &str, operation: &str, nodes: &[String], ) -> Result<TransitionStartOutput, Error>
Start a power transition on the given nodes and return immediately
with the PCS transition id (no polling). The CLI is responsible
for tracking completion via [
Self::pcs_transitions_get]. Read moreSource§impl RedfishEndpointTrait for StaticBackendDispatcher
impl RedfishEndpointTrait for StaticBackendDispatcher
async fn get_all_redfish_endpoints( &self, auth_token: &str, ) -> Result<RedfishEndpointArray, Error>
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>
async fn add_redfish_endpoint( &self, auth_token: &str, redfish_endpoint: &RedfishEndpointArray, ) -> Result<(), Error>
async fn update_redfish_endpoint( &self, auth_token: &str, redfish_endpoint: &RedfishEndpoint, ) -> Result<(), Error>
async fn delete_redfish_endpoint( &self, auth_token: &str, id: &str, ) -> Result<Value, Error>
Source§impl SatTrait for StaticBackendDispatcher
impl SatTrait for StaticBackendDispatcher
Source§async fn apply_sat_file(
&self,
params: ApplySatFileParams<'_>,
) -> Result<(Vec<CfsConfigurationResponse>, Vec<Image>, Vec<BosSessionTemplate>, Vec<BosSession>), Error>
async fn apply_sat_file( &self, params: ApplySatFileParams<'_>, ) -> Result<(Vec<CfsConfigurationResponse>, Vec<Image>, Vec<BosSessionTemplate>, Vec<BosSession>), Error>
Apply a pre-rendered SAT file. Read more
Source§async fn validate_sat_file(
&self,
params: ValidateSatFileParams<'_>,
) -> Result<(), Error>
async fn validate_sat_file( &self, params: ValidateSatFileParams<'_>, ) -> Result<(), Error>
Validate a SAT file against the backend’s live state without
mutating anything. Read more
Source§async fn apply_configuration(
&self,
params: ApplyConfigurationParams<'_>,
) -> Result<CfsConfigurationResponse, Error>
async fn apply_configuration( &self, params: ApplyConfigurationParams<'_>, ) -> Result<CfsConfigurationResponse, Error>
Apply a single SAT
configurations[] entry. Read moreSource§async fn apply_image(
&self,
params: ApplyImageParams<'_>,
) -> Result<Image, Error>
async fn apply_image( &self, params: ApplyImageParams<'_>, ) -> Result<Image, Error>
Apply a single SAT
images[] entry in one synchronous call. Read moreSource§async fn apply_sat_image_create_session(
&self,
params: ApplyImageCreateSessionParams<'_>,
) -> Result<CfsSessionGetResponse, Error>
async fn apply_sat_image_create_session( &self, params: ApplyImageCreateSessionParams<'_>, ) -> Result<CfsSessionGetResponse, Error>
Translate one SAT
images[] entry into a CFS session payload and
create the session. The returned [CfsSessionGetResponse] is the
freshly-created session (initial status, no result_id yet);
callers drive it to completion themselves (via the session-status
or session-logs endpoints) and then call
[SatTrait::apply_sat_image_stamp_from_session] to stamp the
produced IMS image with manta.image_session.* provenance. Read moreSource§async fn apply_sat_image_stamp_from_session(
&self,
params: ApplyImageStampParams<'_>,
) -> Result<Image, Error>
async fn apply_sat_image_stamp_from_session( &self, params: ApplyImageStampParams<'_>, ) -> Result<Image, Error>
Fetch the (terminal-complete) CFS session named by
params,
derive manta.image_session.{base,groups,configuration} from it,
and PATCH them onto the IMS image the session produced. Read moreAuto Trait Implementations§
impl Freeze for StaticBackendDispatcher
impl !RefUnwindSafe for StaticBackendDispatcher
impl Send for StaticBackendDispatcher
impl Sync for StaticBackendDispatcher
impl Unpin for StaticBackendDispatcher
impl !UnwindSafe for StaticBackendDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreCreates a shared type from an unshared type.