Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added the ability to take networkDeviceFunctions, pcieDevices and networkPorts from Controller #301

Closed
wants to merge 1 commit into from

Conversation

Muyk33rus
Copy link
Contributor

need connect PcieDevice to a network adapter in the current implementation, this task could not be implemented so I had to rewrite the controller class

Now from the Controller we can get Network ports Network functions and PCI devices

ex:
{
"@odata.context": "/redfish/v1/$metadata#NetworkAdapter.NetworkAdapter",
"@odata.etag": ""1706246633"",
"@odata.id": "/redfish/v1/Chassis/Self/NetworkAdapters/DevType7_NIC1",
"@odata.type": "#NetworkAdapter.v1_3_0.NetworkAdapter",
"Controllers": [
{
"FirmwarePackageVersion": "nil",
"Links": {
"NetworkDeviceFunctions": [
{
"@odata.id": "/redfish/v1/Chassis/Self/NetworkAdapters/DevType7_NIC1/NetworkDeviceFunctions/NetworkDeviceFunction1"
}
],
"NetworkDeviceFunctions@odata.count": 1,
"NetworkPorts": [
{
"@odata.id": "/redfish/v1/Chassis/Self/NetworkAdapters/DevType7_NIC1/NetworkPorts/DevType7_DMMY_Instance1_PORT1"
}
],
"NetworkPorts@odata.count": 1,
"PCIeDevices": [
{
"@odata.id": "/redfish/v1/Chassis/Self/PCIeDevices/00_01_00"
}
],
"PCIeDevices@odata.count": 1
}
}
],
"Id": "DevType7_NIC1",
"Name": "DevType7_NIC1",
"NetworkDeviceFunctions": {
"@odata.id": "/redfish/v1/Chassis/Self/NetworkAdapters/DevType7_NIC1/NetworkDeviceFunctions"
},
"NetworkPorts": {
"@odata.id": "/redfish/v1/Chassis/Self/NetworkAdapters/DevType7_NIC1/NetworkPorts"
},
"Status": {
"Health": "OK",
"State": "Disabled"
}
}

Copy link
Owner

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this. Looks like a place that things weren't fully fleshed out.

A few small concerns, but beyond that this looks good.

// NetworkAdapter.
type Controllers struct {
type Controller struct {
common.Entity
Copy link
Owner

Choose a reason for hiding this comment

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

I'm a little concerned about changing the existing struct name in case someone is explicitly defining a variable type with it. But I think that is a low risk.

The bigger issue is Controller is not a top level API object, so it does not include the common.Entity properties. If you are seeing a system adding this, they may not be following the actual spec for the object.

https://redfish.dmtf.org/schemas/v1/NetworkAdapter.v1_10_0.json

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for adding the unit tests. This still needs to be addressed though. Is that something you are able to do?

redfish/networkadapter_test.go Show resolved Hide resolved
@stmcginnis
Copy link
Owner

I double checked and the object name actually is Controllers, not Controller. So that reinforces my concern that we don't want to change that.

Some of these other things have been picked up with a recent refresh I did to move to the 2023.3 schema release. If anything is missing, please feel free to open a new PR to add them. Thanks for working on this!

@stmcginnis stmcginnis closed this Apr 18, 2024
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