manta_server/backend_dispatcher/
mod.rs1use std::collections::HashMap;
13use std::pin::Pin;
14
15use chrono::NaiveDateTime;
16use futures::AsyncBufRead;
17use serde_json::Value;
18
19use manta_backend_dispatcher::error::Error;
20use manta_backend_dispatcher::interfaces::apply_hw_cluster_pin::ApplyHwClusterPin;
21use manta_backend_dispatcher::interfaces::apply_sat_file::{
22 ApplyConfigurationParams, ApplyImageCreateSessionParams, ApplyImageParams,
23 ApplyImageStampParams, ApplySatFileParams, ApplySessionTemplateParams,
24 SatTrait, ValidateSatFileParams,
25};
26use manta_backend_dispatcher::interfaces::apply_session::ApplySessionTrait;
27use manta_backend_dispatcher::interfaces::authentication::AuthenticationTrait;
28use manta_backend_dispatcher::interfaces::bos::{
29 ClusterSessionTrait, ClusterTemplateTrait,
30};
31use manta_backend_dispatcher::interfaces::bss::BootParametersTrait;
32use manta_backend_dispatcher::interfaces::cfs::CfsTrait;
33use manta_backend_dispatcher::interfaces::console::ConsoleTrait;
34use manta_backend_dispatcher::interfaces::delete_configurations_and_data_related::DeleteConfigurationsAndDataRelatedTrait;
35use manta_backend_dispatcher::interfaces::hsm::component::ComponentTrait;
36use manta_backend_dispatcher::interfaces::hsm::group::GroupTrait;
37use manta_backend_dispatcher::interfaces::hsm::hardware_inventory::HardwareInventory;
38use manta_backend_dispatcher::interfaces::hsm::redfish_endpoint::RedfishEndpointTrait;
39use manta_backend_dispatcher::interfaces::ims::{
40 GetImagesAndDetailsTrait, ImsTrait,
41};
42use manta_backend_dispatcher::interfaces::migrate_backup::MigrateBackupTrait;
43use manta_backend_dispatcher::interfaces::migrate_restore::MigrateRestoreTrait;
44use manta_backend_dispatcher::interfaces::pcs::PCSTrait;
45use manta_backend_dispatcher::types::{
46 self, Component, ComponentArrayPostArray, Group, HWInventory,
47 HWInventoryByLocationList, HsmActionResponse, K8sDetails, NodeMetadataArray,
48 NodeSummary,
49};
50use manta_backend_dispatcher::types::bos::session::BosSession;
51use manta_backend_dispatcher::types::bos::session_template::BosSessionTemplate;
52use manta_backend_dispatcher::types::bss::BootParameters;
53use manta_backend_dispatcher::types::cfs::cfs_configuration_details::LayerDetails;
54use manta_backend_dispatcher::types::cfs::cfs_configuration_request::CfsConfigurationRequest;
55use manta_backend_dispatcher::types::cfs::cfs_configuration_response::{
56 CfsConfigurationResponse, Layer,
57};
58use manta_backend_dispatcher::types::cfs::component::Component as CfsComponent;
59use manta_backend_dispatcher::types::cfs::session::{
60 CfsSessionGetResponse, CfsSessionPostRequest,
61};
62use manta_backend_dispatcher::types::hsm::inventory::{
63 RedfishEndpoint, RedfishEndpointArray,
64};
65use manta_backend_dispatcher::types::ims::{Image, PatchImage};
66use manta_backend_dispatcher::types::pcs::transitions::types::{
67 TransitionResponse, TransitionStartOutput,
68};
69
70use crate::dispatcher::StaticBackendDispatcher;
71use StaticBackendDispatcher::*;
72
73macro_rules! dispatch {
87 ($self:ident, $method:ident $(, $arg:expr)*) => {
89 match $self {
90 CSM(b) => b.$method($($arg),*).await,
91 OCHAMI(b) => b.$method($($arg),*).await,
92 }
93 };
94 (sync $self:ident, $method:ident $(, $arg:expr)*) => {
96 match $self {
97 CSM(b) => b.$method($($arg),*),
98 OCHAMI(b) => b.$method($($arg),*),
99 }
100 };
101}
102
103mod apply_hw_cluster_pin;
104mod apply_session;
105mod authentication;
106mod boot_parameters;
107mod cfs;
108mod cluster_session;
109mod cluster_template;
110mod component;
111mod component_ethernet_interface;
112mod console;
113mod delete_configurations;
114mod get_images;
115mod group;
116mod hardware_inventory;
117mod ims;
118mod migrate_backup;
119mod migrate_restore;
120mod pcs;
121mod redfish_endpoint;
122mod sat;