Skip to content

feat: add support for delta powershelves#80

Open
spydaNVIDIA wants to merge 3 commits into
mainfrom
feat/pyda-delta
Open

feat: add support for delta powershelves#80
spydaNVIDIA wants to merge 3 commits into
mainfrom
feat/pyda-delta

Conversation

@spydaNVIDIA
Copy link
Copy Markdown

No description provided.

@spydaNVIDIA spydaNVIDIA requested a review from chet June 2, 2026 01:43
Comment thread src/model/chassis.rs
let (_, sensors): (_, Sensors) = client.get(&url).await?;
for sensor in sensors.members {
// only voltage sensors
if !sensor.odata_id.contains("voltage") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we care about case-insensitivity here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took this from the Liteon implementation, but I think youre right. Might as well add that defesnive check.

Comment thread src/model/chassis.rs
Ok(Power {
odata: None,
id: "Power".to_string(),
name: "Power".to_string(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we do anything useful with id or name or not really?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really--I took this from the Liteon implementation.

Comment thread src/model/chassis.rs
power_control: vec![],
power_supplies: Some(power_supplies),
voltages: Some(voltages),
redundancy: None,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should redundancy be the same as power_supplies, or do we just leave it unset? i really dont know the answer fwiw -- like if power_supplies > 1 then do we need to set anything in there?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, to be honest, I dont know the answer either. But I am borrowing from the Liteon power implementation.

Also, I took a closer look at the Redundancy attribute and I dont think its too applicable:

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "PascalCase")]
pub struct Redundancy {
    pub max_num_supported: i64,
    pub member_id: String,
    pub min_num_needed: i64,
    pub mode: String,
    pub name: String,
    pub redundancy_set: Vec<ODataId>,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "PascalCase")]
pub struct Power {
    #[serde(flatten)]
    pub odata: Option<ODataLinks>,
    pub id: String,
    pub name: String,
    pub power_control: Vec<PowerControl>,
    pub power_supplies: Option<Vec<PowerSupply>>,
    pub voltages: Option<Vec<Voltages>>,
    pub redundancy: Option<Vec<Redundancy>>,
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get it in as is and improve this in a follow up

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually idk, I think we set redundancy as None everywhere.

Comment thread src/model/power.rs
pub odata: Option<ODataLinks>,
pub id: Option<String>,
pub name: Option<String>,
pub power_supplies: Option<ODataId>,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...ahh yes, this is the RedundancyGroup -- riiight, Power (what i was commenting on) is the old one, and this is the new spec?

@chet
Copy link
Copy Markdown

chet commented Jun 2, 2026

@spydaNVIDIA any tests at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants