manta_server/backend_dispatcher/
mod.rs1use std::collections::HashMap;
31use std::pin::Pin;
32
33use chrono::NaiveDateTime;
34use futures::AsyncBufRead;
35use serde_json::Value;
36
37use manta_backend_dispatcher::error::Error;
38use manta_backend_dispatcher::interfaces::apply_hw_cluster_pin::ApplyHwClusterPin;
39use manta_backend_dispatcher::interfaces::apply_sat_file::{
40 ApplyConfigurationParams, ApplyImageCreateSessionParams, ApplyImageParams,
41 ApplyImageStampParams, ApplySatFileParams, ApplySessionTemplateParams,
42 SatTrait, ValidateSatFileParams,
43};
44use manta_backend_dispatcher::interfaces::apply_session::ApplySessionTrait;
45use manta_backend_dispatcher::interfaces::authentication::AuthenticationTrait;
46use manta_backend_dispatcher::interfaces::bos::{
47 ClusterSessionTrait, ClusterTemplateTrait,
48};
49use manta_backend_dispatcher::interfaces::bss::BootParametersTrait;
50use manta_backend_dispatcher::interfaces::cfs::CfsTrait;
51use manta_backend_dispatcher::interfaces::console::ConsoleTrait;
52use manta_backend_dispatcher::interfaces::delete_configurations_and_data_related::DeleteConfigurationsAndDataRelatedTrait;
53use manta_backend_dispatcher::interfaces::hsm::component::ComponentTrait;
54use manta_backend_dispatcher::interfaces::hsm::group::GroupTrait;
55use manta_backend_dispatcher::interfaces::hsm::hardware_inventory::HardwareInventory;
56use manta_backend_dispatcher::interfaces::hsm::redfish_endpoint::RedfishEndpointTrait;
57use manta_backend_dispatcher::interfaces::ims::{
58 GetImagesAndDetailsTrait, ImsTrait,
59};
60use manta_backend_dispatcher::interfaces::migrate_backup::MigrateBackupTrait;
61use manta_backend_dispatcher::interfaces::migrate_restore::MigrateRestoreTrait;
62use manta_backend_dispatcher::interfaces::pcs::PCSTrait;
63use manta_backend_dispatcher::types::{
64 self, Component, ComponentArrayPostArray, Group, HWInventory,
65 HWInventoryByLocationList, HsmActionResponse, K8sDetails, NodeMetadataArray,
66 NodeSummary,
67};
68use manta_backend_dispatcher::types::bos::session::BosSession;
69use manta_backend_dispatcher::types::bos::session_template::BosSessionTemplate;
70use manta_backend_dispatcher::types::bss::BootParameters;
71use manta_backend_dispatcher::types::cfs::cfs_configuration_details::LayerDetails;
72use manta_backend_dispatcher::types::cfs::cfs_configuration_request::CfsConfigurationRequest;
73use manta_backend_dispatcher::types::cfs::cfs_configuration_response::{
74 CfsConfigurationResponse, Layer,
75};
76use manta_backend_dispatcher::types::cfs::component::Component as CfsComponent;
77use manta_backend_dispatcher::types::cfs::session::{
78 CfsSessionGetResponse, CfsSessionPostRequest,
79};
80use manta_backend_dispatcher::types::hsm::inventory::{
81 RedfishEndpoint, RedfishEndpointArray,
82};
83use manta_backend_dispatcher::types::ims::{Image, PatchImage};
84use manta_backend_dispatcher::types::pcs::transitions::types::{
85 TransitionResponse, TransitionStartOutput,
86};
87
88use crate::dispatcher::StaticBackendDispatcher;
89use StaticBackendDispatcher::*;
90
91macro_rules! dispatch {
113 ($self:ident, $method:ident $(, $arg:expr)*) => {
115 match $self {
116 CSM(b) => b.$method($($arg),*).await,
117 OCHAMI(b) => b.$method($($arg),*).await,
118 }
119 };
120 (sync $self:ident, $method:ident $(, $arg:expr)*) => {
122 match $self {
123 CSM(b) => b.$method($($arg),*),
124 OCHAMI(b) => b.$method($($arg),*),
125 }
126 };
127}
128
129mod apply_hw_cluster_pin;
130mod apply_session;
131mod authentication;
132mod boot_parameters;
133mod cfs;
134mod cluster_session;
135mod cluster_template;
136mod component;
137mod component_ethernet_interface;
138mod console;
139mod delete_configurations;
140mod get_images;
141mod group;
142mod hardware_inventory;
143mod ims;
144mod migrate_backup;
145mod migrate_restore;
146mod pcs;
147mod redfish_endpoint;
148mod sat;