pub enum StaticBackendDispatcher {
CSM(Csm),
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(Csm)
HPE Cray System Management (CSM) backend, used by Alps-style
deployments. Wraps a csm-rs HTTP client.
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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], cfs_conf_sess_name: Option<&str>, playbook_yaml_file_name_opt: Option<&str>, hsm_group: 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_session_logs_stream( &self, shasta_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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], session: &CfsSessionPostRequest, ) -> Result<CfsSessionGetResponse, Error>
async fn get_sessions( &self, auth_token: &str, base_url: &str, root_cert: &[u8], 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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], hsm_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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], 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, shasta_root_cert: &[u8], 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, base_url: &str, root_cert: &[u8], cfs_configuration_name_opt: Option<&String>, ) -> Result<Vec<CfsConfigurationResponse>, Error>
async fn get_and_filter_configuration( &self, auth_token: &str, base_url: &str, root_cert: &[u8], configuration_name: Option<&str>, configuration_name_pattern: Option<&str>, hsm_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, shasta_root_cert: &[u8], gitea_base_url: &str, gitea_token: &str, layer: Layer, site_name: &str, ) -> Result<LayerDetails, Error>
async fn update_runtime_configuration( &self, auth_token: &str, base_url: &str, root_cert: &[u8], xnames: &[String], desired_configuration: &str, enabled: bool, ) -> Result<(), Error>
async fn put_configuration( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], configuration: &CfsConfigurationRequest, configuration_name: &str, overwrite: bool, ) -> Result<CfsConfigurationResponse, Error>
async fn get_derivatives( &self, auth_token: &str, base_url: &str, root_cert: &[u8], configuration_name: &str, ) -> Result<(Option<Vec<CfsSessionGetResponse>>, Option<Vec<BosSessionTemplate>>, Option<Vec<Image>>), Error>
async fn get_cfs_components( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], configuration_name: Option<&str>, components_ids: Option<&str>, status: Option<&str>, ) -> Result<Vec<Component>, Error>
fn get_cfs_health(&self) -> impl Future<Output = Result<(), 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
Source§impl ClusterTemplateTrait for StaticBackendDispatcher
impl ClusterTemplateTrait for StaticBackendDispatcher
async fn get_template( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], bos_session_template_id_opt: Option<&str>, ) -> Result<Vec<BosSessionTemplate>, Error>
async fn get_and_filter_templates( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], hsm_group_name_vec: &[String], hsm_member_vec: &[String], bos_sessiontemplate_name_opt: Option<&str>, limit_number_opt: Option<&u8>, ) -> Result<Vec<BosSessionTemplate>, Error>
async fn get_all_templates( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], ) -> Result<Vec<BosSessionTemplate>, Error>
async fn put_template( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], bos_template: &BosSessionTemplate, bos_template_name: &str, ) -> Result<BosSessionTemplate, Error>
async fn delete_template( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], bos_template_id: &str, ) -> Result<(), 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<Value, 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
type T = Box<dyn AsyncWrite + Unpin + Send>
type U = Box<dyn AsyncRead + Unpin + Send>
async fn attach_to_node_console( &self, shasta_token: &str, site_name: &str, xname: &str, width: u16, height: u16, k8s: &K8sDetails, ) -> Result<(Box<dyn AsyncWrite + Unpin + Send>, Box<dyn AsyncRead + Unpin + Send>), Error>
async fn attach_to_session_console( &self, shasta_token: &str, site_name: &str, session_name: &str, width: u16, height: u16, k8s: &K8sDetails, ) -> Result<(Box<dyn AsyncWrite + Unpin + Send>, Box<dyn AsyncRead + Unpin + Send>), 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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], hsm_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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], 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, hsm_group: Group, ) -> Result<Group, Error>
async fn get_member_vec_from_group_name_vec( &self, auth_token: &str, hsm_group_name_vec: &[String], ) -> Result<Vec<String>, Error>
async fn get_group_map_and_filter_by_group_vec( &self, auth_token: &str, hsm_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_all_groups(&self, auth_token: &str) -> Result<Vec<Group>, Error>
async fn get_group( &self, auth_token: &str, hsm_name: &str, ) -> Result<Group, Error>
async fn get_groups( &self, auth_token: &str, hsm_name_vec: Option<&[String]>, ) -> Result<Vec<Group>, Error>
async fn delete_group( &self, auth_token: &str, hsm_group_label: &str, ) -> Result<Value, Error>
async fn get_hsm_map_and_filter_by_hsm_name_vec( &self, auth_token: &str, hsm_name_vec: &[&str], ) -> Result<HashMap<String, Vec<String>>, Error>
async fn post_member( &self, auth_token: &str, group_label: &str, xname: &str, ) -> Result<Value, Error>
async fn add_members_to_group( &self, auth_token: &str, group_label: &str, xnames: &[&str], ) -> Result<Vec<String>, Error>
async fn delete_member_from_group( &self, auth_token: &str, group_label: &str, xname: &str, ) -> Result<(), Error>
async fn migrate_group_members( &self, auth_token: &str, target_hsm_group_name: &str, parent_hsm_group_name: &str, new_target_hsm_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
async fn get_inventory_hardware( &self, auth_token: &str, xname: &str, ) -> Result<Value, 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<Value, Error>
async fn post_inventory_hardware( &self, auth_token: &str, hardware: HWInventoryByLocationList, ) -> Result<Value, Error>
Source§impl ImsTrait for StaticBackendDispatcher
impl ImsTrait for StaticBackendDispatcher
async fn get_images( &self, shasta_token: &str, image_id_opt: Option<&str>, ) -> Result<Vec<Image>, Error>
async fn get_all_images( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], ) -> Result<Vec<Image>, Error>
fn filter_images(&self, image_vec: &mut Vec<Image>) -> Result<(), Error>
async fn update_image( &self, shasta_token: &str, image_id: &str, image: &PatchImage, ) -> Result<(), Error>
async fn delete_image( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], 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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], bos_file: Option<&str>, cfs_file: Option<&str>, hsm_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_on_sync( &self, auth_token: &str, nodes: &[String], ) -> Result<TransitionResponse, Error>
async fn power_off_sync( &self, auth_token: &str, nodes: &[String], force: bool, ) -> Result<TransitionResponse, Error>
async fn power_reset_sync( &self, auth_token: &str, nodes: &[String], force: bool, ) -> Result<TransitionResponse, Error>
fn power_status( &self, _auth_token: &str, _nodes: &[String], _power_status_filter: Option<&str>, _management_state_filter: Option<&str>, ) -> impl Future<Output = Result<PowerStatusAll, Error>> + Send
Source§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>
Auto 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.