StaticBackendDispatcher

Enum StaticBackendDispatcher 

Source
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

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"; any other value returns an error.

Trait Implementations§

Source§

impl ApplyHwClusterPin for StaticBackendDispatcher

Source§

async fn apply_hw_cluster_pin( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], target_hsm_group_name: &str, parent_hsm_group_name: &str, pattern: &str, nodryrun: bool, create_target_hsm_group: bool, delete_empty_parent_hsm_group: bool, ) -> Result<(), Error>

Source§

impl ApplySessionTrait for StaticBackendDispatcher

Source§

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

Source§

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

Source§

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

Source§

impl BootParametersTrait for StaticBackendDispatcher

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl CfsTrait for StaticBackendDispatcher

Source§

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

Source§

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>

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>

Source§

async fn post_session( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], session: &CfsSessionPostRequest, ) -> Result<CfsSessionGetResponse, Error>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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

Source§

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>

Source§

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>

Source§

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

Source§

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>

Source§

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>

Source§

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

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, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], bos_session: BosSession, ) -> Result<BosSession, Error>

Source§

impl ClusterTemplateTrait for StaticBackendDispatcher

Source§

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>

Source§

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>

Source§

async fn get_all_templates( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], ) -> Result<Vec<BosSessionTemplate>, Error>

Source§

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>

Source§

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

Source§

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

Source§

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

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>

Source§

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

Source§

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>

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

Source§

type T = Box<dyn AsyncWrite + Unpin + Send>

Source§

type U = Box<dyn AsyncRead + Unpin + Send>

Source§

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>

Source§

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

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, 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>

Source§

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

Source§

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

Source§

impl GroupTrait for StaticBackendDispatcher

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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>

Source§

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

Source§

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

Source§

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

Source§

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>

Source§

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

Source§

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

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<Value, Error>

Source§

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

Source§

impl ImsTrait for StaticBackendDispatcher

Source§

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

Source§

async fn get_all_images( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], ) -> Result<Vec<Image>, Error>

Source§

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

Source§

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

Source§

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

Source§

async fn migrate_backup( &self, shasta_token: &str, shasta_base_url: &str, shasta_root_cert: &[u8], bos: Option<&str>, destination: Option<&str>, ) -> Result<(), Error>

Source§

impl MigrateRestoreTrait for StaticBackendDispatcher

Source§

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

Source§

async fn power_on_sync( &self, auth_token: &str, nodes: &[String], ) -> Result<TransitionResponse, Error>

Source§

async fn power_off_sync( &self, auth_token: &str, nodes: &[String], force: bool, ) -> Result<TransitionResponse, Error>

Source§

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

Source§

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

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>

Source§

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

Source§

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

Source§

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

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 a pre-rendered SAT file. Read more

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,