manta_server/backend_dispatcher/
redfish_endpoint.rs1use manta_backend_dispatcher::{
4 error::Error,
5 interfaces::hsm::redfish_endpoint::RedfishEndpointTrait,
6 types::hsm::inventory::{RedfishEndpoint, RedfishEndpointArray},
7};
8
9use StaticBackendDispatcher::*;
10
11use serde_json::Value;
12
13use crate::manta_backend_dispatcher::StaticBackendDispatcher;
14
15impl RedfishEndpointTrait for StaticBackendDispatcher {
16 async fn get_all_redfish_endpoints(
17 &self,
18 auth_token: &str,
19 ) -> Result<RedfishEndpointArray, Error> {
20 dispatch!(self, get_all_redfish_endpoints, auth_token)
21 }
22
23 async fn get_redfish_endpoints(
24 &self,
25 auth_token: &str,
26 id: Option<&str>,
27 fqdn: Option<&str>,
28 r#type: Option<&str>,
29 uuid: Option<&str>,
30 macaddr: Option<&str>,
31 ip_address: Option<&str>,
32 last_status: Option<&str>,
33 ) -> Result<RedfishEndpointArray, Error> {
34 dispatch!(
35 self,
36 get_redfish_endpoints,
37 auth_token,
38 id,
39 fqdn,
40 r#type,
41 uuid,
42 macaddr,
43 ip_address,
44 last_status
45 )
46 }
47
48 async fn add_redfish_endpoint(
49 &self,
50 auth_token: &str,
51 redfish_endpoint: &RedfishEndpointArray,
52 ) -> Result<(), Error> {
53 dispatch!(self, add_redfish_endpoint, auth_token, redfish_endpoint)
54 }
55
56 async fn update_redfish_endpoint(
57 &self,
58 auth_token: &str,
59 redfish_endpoint: &RedfishEndpoint,
60 ) -> Result<(), Error> {
61 dispatch!(self, update_redfish_endpoint, auth_token, redfish_endpoint)
62 }
63
64 async fn delete_redfish_endpoint(
65 &self,
66 auth_token: &str,
67 id: &str,
68 ) -> Result<Value, Error> {
69 dispatch!(self, delete_redfish_endpoint, auth_token, id)
70 }
71}