Skip to content

Commit fdc810b

Browse files
committed
models: Update to v2024.2
Update all of the infrastructure and examples to use the v2024.2 models.
1 parent 1a4b841 commit fdc810b

File tree

14 files changed

+56
-25
lines changed

14 files changed

+56
-25
lines changed

examples/simple/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ use seuss::{
1414
core::{error, privilege, convert::IntoRedfishMessage},
1515
middleware::ResourceLocator,
1616
models::{
17-
computer_system::v1_20_1::{
17+
computer_system::v1_22_2::{
1818
Actions, ComputerSystem as ComputerSystemModel, Reset, ResetRequestBody,
1919
},
2020
computer_system_collection::ComputerSystemCollection as ComputerSystemCollectionModel,
2121
odata_v4,
2222
resource::{self, ResetType},
23-
service_root::v1_16_0::{Links, ServiceRoot as ServiceRootModel},
23+
service_root::v1_17_0::{Links, ServiceRoot as ServiceRootModel},
2424
},
25-
registries::base::v1_16_0::Base,
25+
registries::base::v1_18_1::Base,
2626
service::{AccountService, RedfishService, SessionService},
2727
};
2828
use std::{

redfish-axum/src/lib.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ pub mod aggregation_source;
1212
pub mod aggregation_source_collection;
1313
pub mod allow_deny;
1414
pub mod allow_deny_collection;
15+
pub mod application;
16+
pub mod application_collection;
1517
pub mod assembly;
1618
pub mod battery;
1719
pub mod battery_collection;
@@ -40,6 +42,10 @@ pub mod connection;
4042
pub mod connection_collection;
4143
pub mod connection_method;
4244
pub mod connection_method_collection;
45+
pub mod container;
46+
pub mod container_collection;
47+
pub mod container_image;
48+
pub mod container_image_collection;
4349
pub mod control;
4450
pub mod control_collection;
4551
pub mod coolant_connector;
@@ -117,6 +123,8 @@ pub mod memory_collection;
117123
pub mod memory_domain;
118124
pub mod memory_domain_collection;
119125
pub mod memory_metrics;
126+
pub mod memory_region;
127+
pub mod memory_region_collection;
120128
pub mod message_registry_file;
121129
pub mod message_registry_file_collection;
122130
pub mod metadata;
@@ -139,6 +147,9 @@ pub mod network_port_collection;
139147
pub mod odata;
140148
pub mod operating_config;
141149
pub mod operating_config_collection;
150+
pub mod operating_system;
151+
pub mod outbound_connection;
152+
pub mod outbound_connection_collection;
142153
pub mod outlet;
143154
pub mod outlet_collection;
144155
pub mod outlet_group;
@@ -233,4 +244,4 @@ pub mod zone;
233244
pub mod zone_collection;
234245

235246
/// The version of the Redfish Schema Specification provided by this crate.
236-
pub const REDFISH_VERSION: &str = "2023.1";
247+
pub const REDFISH_VERSION: &str = "2024.2";

redfish-core/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use axum::{
33
response::{AppendHeaders, IntoResponse, Response},
44
Json,
55
};
6-
use redfish_models::{models::redfish, registries::base::v1_16_0::Base};
6+
use redfish_models::{models::redfish, registries::base::v1_18_1::Base};
77

88
use crate::privilege::Role;
99
use crate::{convert::IntoRedfishMessage, error};

redfish-core/src/convert.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use redfish_models::{models::{message::v1_1_2::Message, event::v1_8_0::EventRecord}, Registry};
1+
use redfish_models::{
2+
models::{event::v1_10_1::EventRecord, message::v1_2_1::Message},
3+
Registry,
4+
};
25

36
pub trait IntoRedfishMessage {
47
fn into_redfish_message(self) -> Message;

redfish-core/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use redfish_models::models::message::v1_1_2::Message;
1+
use redfish_models::models::message::v1_2_1::Message;
22
use redfish_models::models::redfish::{Error, RedfishError};
33

44
pub fn one_message(error: Message) -> Error {

redfish-models/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub mod models;
44
pub mod registries;
55

66
/// The version of the Redfish Schema Specification provided by this crate.
7-
pub const REDFISH_VERSION: &str = "2023.1";
7+
pub const REDFISH_VERSION: &str = "2024.2";
88

99
/// The OData Version supported by this version of the redfish data model.
1010
pub const ODATA_VERSION: &str = "4.0";

redfish-models/src/models.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub mod aggregation_source;
1313
pub mod aggregation_source_collection;
1414
pub mod allow_deny;
1515
pub mod allow_deny_collection;
16+
pub mod application;
17+
pub mod application_collection;
1618
pub mod assembly;
1719
pub mod attribute_registry;
1820
pub mod battery;
@@ -49,6 +51,10 @@ pub mod connection_method;
4951
pub mod connection_method_collection;
5052
pub mod consistency_group;
5153
pub mod consistency_group_collection;
54+
pub mod container;
55+
pub mod container_collection;
56+
pub mod container_image;
57+
pub mod container_image_collection;
5258
pub mod control;
5359
pub mod control_collection;
5460
pub mod coolant_connector;
@@ -94,6 +100,7 @@ pub mod file_share;
94100
pub mod file_share_collection;
95101
pub mod file_system;
96102
pub mod file_system_collection;
103+
pub mod file_system_metrics;
97104
pub mod filter;
98105
pub mod filter_collection;
99106
pub mod graphics_controller;
@@ -148,6 +155,8 @@ pub mod memory_collection;
148155
pub mod memory_domain;
149156
pub mod memory_domain_collection;
150157
pub mod memory_metrics;
158+
pub mod memory_region;
159+
pub mod memory_region_collection;
151160
pub mod message;
152161
pub mod message_registry;
153162
pub mod message_registry_collection;
@@ -175,6 +184,9 @@ pub mod nvme_firmware_image;
175184
pub mod odata_v4;
176185
pub mod operating_config;
177186
pub mod operating_config_collection;
187+
pub mod operating_system;
188+
pub mod outbound_connection;
189+
pub mod outbound_connection_collection;
178190
pub mod outlet;
179191
pub mod outlet_collection;
180192
pub mod outlet_group;
@@ -213,6 +225,7 @@ pub mod registered_client;
213225
pub mod registered_client_collection;
214226
pub mod reservoir;
215227
pub mod reservoir_collection;
228+
pub mod resolution_step;
216229
pub mod resource;
217230
pub mod resource_block;
218231
pub mod resource_block_collection;
@@ -253,9 +266,11 @@ pub mod storage_group;
253266
pub mod storage_group_collection;
254267
pub mod storage_pool;
255268
pub mod storage_pool_collection;
269+
pub mod storage_pool_metrics;
256270
pub mod storage_replica_info;
257271
pub mod storage_service;
258272
pub mod storage_service_collection;
273+
pub mod storage_service_metrics;
259274
pub mod storage_system_collection;
260275
pub mod switch;
261276
pub mod switch_collection;
@@ -283,5 +298,6 @@ pub mod vlan_network_interface;
283298
pub mod vlan_network_interface_collection;
284299
pub mod volume;
285300
pub mod volume_collection;
301+
pub mod volume_metrics;
286302
pub mod zone;
287303
pub mod zone_collection;

redfish-models/src/registries.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ pub mod resource_event;
1616
pub mod sensor_event;
1717
pub mod storage_device;
1818
pub mod task_event;
19+
pub mod telemetry;
1920
pub mod update;

seuss/src/auth/session.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use axum::{http::request::Parts, response::Response};
2-
use redfish_models::models::{odata_v4, redfish, session::v1_6_0};
2+
use redfish_models::models::{odata_v4, redfish, session::v1_7_2};
33
use redfish_core::auth::{
44
unauthorized, unauthorized_with_error, AuthenticateRequest, AuthenticatedUser,
55
};
@@ -14,10 +14,10 @@ pub trait SessionManagement {
1414
fn sessions(&self) -> Result<Vec<odata_v4::IdRef>, redfish::Error>;
1515
fn create_session(
1616
&mut self,
17-
session: v1_6_0::Session,
17+
session: v1_7_2::Session,
1818
base_path: String,
19-
) -> Result<v1_6_0::Session, redfish::Error>;
20-
fn get_session(&self, id: Self::Id) -> Result<v1_6_0::Session, redfish::Error>;
19+
) -> Result<v1_7_2::Session, redfish::Error>;
20+
fn get_session(&self, id: Self::Id) -> Result<v1_7_2::Session, redfish::Error>;
2121
fn delete_session(&mut self, id: Self::Id) -> Result<(), redfish::Error>;
2222
}
2323

seuss/src/auth/session_manager.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use chrono::{DateTime, Local};
22
use redfish_models::{
3-
models::{odata_v4, redfish, resource, session::v1_6_0},
4-
registries::base::v1_16_0::Base,
3+
models::{odata_v4, redfish, resource, session::v1_7_2},
4+
registries::base::v1_18_1::Base,
55
};
66
use redfish_core::{auth::AuthenticatedUser, convert::IntoRedfishMessage, error};
77
use std::{
@@ -15,7 +15,7 @@ use crate::auth::{SessionAuthentication, SessionManagement};
1515

1616
#[derive(Clone)]
1717
struct ManagedSession {
18-
session: v1_6_0::Session,
18+
session: v1_7_2::Session,
1919
last_request: DateTime<Local>,
2020
user: AuthenticatedUser,
2121
}
@@ -111,9 +111,9 @@ where
111111

112112
fn create_session(
113113
&mut self,
114-
session: v1_6_0::Session,
114+
session: v1_7_2::Session,
115115
base_path: String,
116-
) -> Result<v1_6_0::Session, redfish::Error> {
116+
) -> Result<v1_7_2::Session, redfish::Error> {
117117
let user_name = session.user_name.clone().ok_or_else(|| {
118118
error::one_message(Base::PropertyMissing("UserName".to_string()).into_redfish_message())
119119
})?;
@@ -134,7 +134,7 @@ where
134134
}
135135
let token = self.token(&user_name);
136136

137-
let created_session = v1_6_0::Session {
137+
let created_session = v1_7_2::Session {
138138
user_name: Some(user_name),
139139
odata_id: odata_v4::Id(base_path + "/" + &id),
140140
id: resource::Id(id.clone()),
@@ -168,7 +168,7 @@ where
168168
.ok_or_else(|| error::one_message(Base::NoValidSession.into_redfish_message()))
169169
}
170170

171-
fn get_session(&self, id: Self::Id) -> Result<v1_6_0::Session, redfish::Error> {
171+
fn get_session(&self, id: Self::Id) -> Result<v1_7_2::Session, redfish::Error> {
172172
let sessions = self.sessions.lock().unwrap();
173173
sessions
174174
.iter()

seuss/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use axum::{
33
response::{IntoResponse, Response},
44
Json,
55
};
6-
use redfish_models::registries::base::v1_16_0::Base;
6+
use redfish_models::registries::base::v1_18_1::Base;
77
use redfish_core::{convert::IntoRedfishMessage, error};
88
use tracing::{event, Level};
99

seuss/src/middleware/odata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use axum::{
1414
routing::Route,
1515
Json,
1616
};
17-
use redfish_models::{registries::base::v1_16_0::Base, ODATA_VERSION};
17+
use redfish_models::{registries::base::v1_18_1::Base, ODATA_VERSION};
1818
use redfish_core::{convert::IntoRedfishMessage, error};
1919
use tower::{Layer, Service};
2020

seuss/src/service/account_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::str::FromStr;
33
use axum::{extract::OriginalUri, response::Response, Extension, Router};
44
use redfish_axum::{role::Role, role_collection::RoleCollection};
55
use redfish_models::models::{
6-
account_service::v1_13_0::AccountService as AccountServiceModel, odata_v4,
7-
privileges::PrivilegeType, resource, role::v1_3_1::Role as RoleModel,
6+
account_service::v1_15_1::AccountService as AccountServiceModel, odata_v4,
7+
privileges::PrivilegeType, resource, role::v1_3_2::Role as RoleModel,
88
role_collection::RoleCollection as RoleCollectionModel,
99
};
1010
use redfish_core::{auth::AuthenticateRequest, privilege};

seuss/src/service/session_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use axum::{
88
};
99
use redfish_axum::{session::Session, session_collection::SessionCollection};
1010
use redfish_models::models::{
11-
odata_v4, resource, session::v1_6_0::Session as SessionModel,
11+
odata_v4, resource, session::v1_7_2::Session as SessionModel,
1212
session_collection::SessionCollection as SessionCollectionModel,
13-
session_service::v1_1_8::SessionService as SessionServiceModel,
13+
session_service::v1_1_9::SessionService as SessionServiceModel,
1414
};
1515
use redfish_core::auth::AuthenticateRequest;
1616

0 commit comments

Comments
 (0)