summaryrefslogtreecommitdiff
path: root/Redfish.md
AgeCommit message (Collapse)AuthorFilesLines
2024-05-03Implement client certificate schemasEd Tanous1-0/+29
The Redfish standard seems to have caught up with some of the OEM schemas and features we already have, namely MutualTLS and Basic Auth disablement. This commit implements most of the GET parameters for which we already have backends. ClientCertificate is pointed to the same resources as TrustStore. Tested: generate_auth_certificates.py succeeds, and shows a certificate in ClientCertificate collection Get AccountService, and ClientAuthentication/Certificates returns expected values. Redfish service validator passes. Change-Id: If18e34e9dfa8f38293fceff288596811afd16d4a Signed-off-by: Ed Tanous <ed@tanous.net>
2024-04-25AccountService: Add HTTPBasicAuth supportRavi Teja1-0/+1
This commit adds HTTPBasicAuth Get/Patch support Tested By: Redfish service validator passes. ``` curl -k --user "root:0penBmc" -H "Content-Type: application/json" -X PATCH -d '{"HTTPBasicAuth":"Enabled"}' https://192.168.7.2/redfish/v1/AccountService ``` Succeeds with various values. Enabled: Basic auth succeeds. Disabled: Basic auth no longer works. AccountService reports "Disabled" For HTTPBasicAuth status. Change-Id: Ic417bf3cd4135f05ab34c8613c7fbce953157b03 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com> Signed-off-by: Ed Tanous <ed@tanous.net>
2024-03-15Remove link from Chassis to PCIeDeviceSunny Srivastava1-1/+0
The commit removes current support that assumes 1:1 system:Chassis for Chassis/PCIeDevices. Current implementation populates the same collection of PCIeDevices with chassis and with system. Since the path is /redfish/v1/Systems/system/PCIeDevices and we already have a link from /redfish/v1/Systems/system/, removing the link here in Chassis. The link from Chassis to /redfish/v1/Systems/system/PCIeDevices is unexpected. For systems with multiple chassis the current assumption does not hold true. It breaks there, as it assumes all PCIeDevices are in all Chassis. This is just a link and since another link from system resource already exists. The case of walking the whole tree isn't broke. And so, this should not break clients. Validator has been executed with no new errors. Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: Id3af01ec99708c36b5fff2a63f04ffd722f6c3a2 Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
2024-03-04AllowedHostTransitions: look for on dbusAndrew Geissler1-0/+8
Commit [1] introduced a new optional dbus property that OpenBMC developers can populate to define which redfish/v1/Systems/system/ResetActionInfo AllowableValues are. Look for that new property on dbus. If not found, hard code the previous values otherwise utilize the property to fill in the return value. Tested: - Put new property on dbus and confirmed Redfish API returned expected values: ``` curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/ResetActionInfo { "@odata.id": "/redfish/v1/Systems/system/ResetActionInfo", "@odata.type": "#ActionInfo.v1_1_2.ActionInfo", "Id": "ResetActionInfo", "Name": "Reset Action Info", "Parameters": [ { "AllowableValues": [ "ForceOff", "PowerCycle", "Nmi", "On", "ForceOn", "ForceRestart", "GracefulRestart", "GracefulShutdown" ], "DataType": "String", "Name": "ResetType", "Required": true } ] } ``` - Did not run redfish validator as response was same as previous [1]: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/68933 Change-Id: Iecece14e7ff55db98d96df71b106ecc9e3f0ac33 Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2024-02-23manager_diagnostic_data: add metric getJagpal Singh Gill1-0/+8
Add support to fetch MemoryStatistics, FreeStorageSpaceKiB and ProcessorStatistics for Manager Diagnostic Data. https://redfish.dmtf.org/schemas/v1/ManagerDiagnosticData.v1_2_1.json This change is in relation to following design and D-Bus interface - https://gerrit.openbmc.org/c/openbmc/docs/+/64917 https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/64914 Test: Redfish query output - { "@odata.id": "/redfish/v1/Managers/bmc/ManagerDiagnosticData", "@odata.type": "#ManagerDiagnosticData.v1_2_0.ManagerDiagnosticData", "FreeStorageSpaceKiB": 3772, "Id": "ManagerDiagnosticData", "MemoryStatistics": { "AvailableBytes": 354224066, "BuffersAndCacheBytes": 78984633, "SharedBytes": 11876066, "TotalBytes": 425516000 }, "Name": "Manager Diagnostic Data", "ProcessorStatistics": { "KernelPercent": 13.0234, "UserPercent": 5.7374 }, "ServiceRootUptimeSeconds": 2255.117 } Redfish service validator passing - Elapsed time: 0:03:12 metadataNamespaces: 3726 pass: 5133 passAction: 9 passGet: 205 passRedfishUri: 197 skipNoSchema: 3 skipOptional: 3492 warnDeprecated: 4 warningPresent: 7 Validation has succeeded. Change-Id: I43758a993eb7f342cb9ac5f5574498b37261c2cc Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
2024-01-23Implements ThermalMetrics schemazhanghch051-0/+5
The ThermalMetrics schema is a resource in Redfish version 2022.2[1]. It contains an array of temperature readings. It is a child of ThermalSubsystem schema[2] and it represents the thermal metrics of a chassis. Reading the current value of each temperature sensor and the corresponding link enumeration will be implemented in the next patch. This commit implements the Get and Head methods of the Redfish ThermalMetrics schema and implemented the basic information of Get. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2022.2.pdf [2] https://redfish.dmtf.org/schemas/v1/ThermalMetrics.v1_0_1.json Test: 1. Validator passed. 2. doGet method: """ curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/ThermalMetrics { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/ThermalMetrics", "@odata.type": "#ThermalMetrics.v1_0_1.ThermalMetrics", "Id": "ThermalMetrics", "Name": "Thermal Metrics", } """ 3. A bad chassis ID: """ curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassisBAD/ThermalSubsystem/ThermalMetrics { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'chassisBAD' was not found.", "MessageArgs": [ "Chassis", "chassisBAD" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type Chassis named 'chassisBAD' was not found." } } """ Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: Ib4182e7dc6e204371636a33a391e8e2a58dad113
2024-01-09Fix spelling mistakesEd Tanous1-1/+1
These were found with: codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$") At some point in the future, we might want to get this enabled in CI. Change-Id: Iccb57b2adfd06a2e177e99db2923fe4e8e329118 Signed-off-by: Ed Tanous <ed@tanous.net>
2023-07-20Report status state field for cable objectsAkshit Shah1-0/+2
Tested: Added and removed cables to see state field being reflected based on the presence. Change-Id: I0136b1407634ebc9033a7c3ea2da555018fd622b Signed-off-by: Akshit Shah <shahakshit@google.com>
2023-07-20Add IPv6 StatelessAddressAutoConfigurationRavi Teja1-0/+1
This commit has following changes 1.Adds "StatelessAddressAutoConfig" support as per latest EthernetInterface schema. 2.Remove support for deprecated Stateful and Stateless enums of DHCPv6 "OperatingMode" Tested by: ``` GET PATCH -d '{"StatelessAddressAutoConfig": {"IPv6AutoConfigEnabled": true}}' PATCH -d '{"StatelessAddressAutoConfig": { "IPv6AutoConfigEnabled": false}}' PATCH -d '{"DHCPv6" : {"OperatingMode":"Enabled"}}' PATCH -d '{"DHCPv6" : {"OperatingMode":"Disabled"}}' ``` Redfish Validator passed Change-Id: I29d471750ef513074bc5e49c31a16fa15d3d760c Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2023-07-18Remove PCIeInterface DeviceTypeEd Tanous1-1/+0
This code was added in 543f9a75a0819ca9e3541b2c48fe8b4d5cf6c4f7, which in the description claimed to only be a refactor, but moved the DeviceType record. Because DeviceType is an enum in Redfish, and a string in PDI, some amount of conversion is required, so this code can't be corrected easily. Remove the property for the moment. Tested: Redfish Validator passes. Change-Id: I60a68e45a69370112f454b1c520fde5b70ca8591 Signed-off-by: Ed Tanous <edtanous@google.com>
2023-07-13Add Location information for FanGeorge Liu1-0/+1
This commit is to add Location/PartLocation/ServiceLabel information according to the Redfish Fan schema. If the `xyz.openbmc_project.Inventory.Decorator.LocationCode` interface does not exist, the ServiceLabel information property is not displayed. ref: https://redfish.dmtf.org/schemas/v1/Fan.v1_3_0.json Tested: Validator passes ''' 1. doGet method to get Fan ServiceLabel information curl -k https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0 { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0", "@odata.type": "#Fan.v1_3_0.Fan", "Id": "fan0", "Manufacturer": "Delta", "Model": "7B5F", "Name": "Fan", "PartNumber": "02YK323", "SerialNumber": "YL12JP1C1234", "Slot": { "Location": { "PartLocation": { "ServiceLabel": "U78DB.ND0.WZS002U-A0" } } }, "SparePartNumber": "02YK323", "Status": { "Health": "OK", "State": "Enabled" } } ''' Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I1c3357d6dde654c71c8384139b8e3f03cf671e4e Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-07-13Add asset information for FanGeorge Liu1-0/+5
This commit is to add asset information according to the Redfish Fan schema. If the `xyz.openbmc_project.Inventory.Decorator.Asset` interface does not exist, the asset information property is not displayed. ref: https://redfish.dmtf.org/schemas/v1/Fan.v1_3_0.json Tested: Validator passes ''' 1. doGet method to get Fan asset information curl -k https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0 { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0", "@odata.type": "#Fan.v1_3_0.Fan", "Id": "fan0", "Manufacturer": "Delta", "Model": "7B5F", "Name": "Fan", "PartNumber": "02YK323", "SerialNumber": "YL12JP1C1234", "SparePartNumber": "02YK323", "Status": { "Health": "OK", "State": "Enabled" } } ''' Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I1840f2b372fea57ba6e5c499ba21c968f0005695 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-07-13Add Status information for FanAlbert Zhang1-0/+6
This commit is to add Fan State/Health status according to the Redfish Fan schema. If the `xyz.openbmc_project.Inventory.Item` interface does not exist, the state status property is set to default "Present". If the `xyz.openbmc_project.State.Decorator.OperationalStatus` interface does not exist, the health status property is set to default "OK". ref: https://redfish.dmtf.org/schemas/v1/Fan.v1_3_0.json Code that updates the OperationalStatus for all the inventory https://github.com/openbmc/openpower-vpd-parser/blob/3fb026386546cfd288ab4f86156c9aa0ffa145d6/ibm_vpd_app.cpp#L620 Tested: Validator passes ''' 1.doGet method to get Fan curl -k https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0 { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0", "@odata.type": "#Fan.v1_3_0.Fan", "Id": "fan0", "Name": "Fan", "Status": { "Health": "OK", "State": "Enabled" } } 2.Enter the wrong fanId with the doGet method to get fan { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Fan named 'fanx' was not found.", "MessageArgs": [ "Fan", "fanx" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type Fan named 'fanx' was not found." } } ''' Signed-off-by: Albert Zhang <zhanghaodi@inspur.com> Change-Id: I52c465f745587233e43a2947c392d1435b2d980b Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-07-13Implements FanCollection schemaGeorge Liu1-0/+8
The FanCollection schema is a resource in Redifsh version 2022.2 [1] that represents the management properties for the monitoring and management of cooling fans implemented by Redfish [2]. This commit retrieves the fan collection by obtaining the endpoints of the `cooled_by` association. The `cooled_by` association represents the relationship between a chassis and the fans responsible for providing cooling to the chassis. ref: [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2022.2.pdf [2] http://redfish.dmtf.org/schemas/v1/Fan.v1_3_0.json Redfish validator is currently failing. In order for the validator to pass, it is necessary to merge this commit with https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57559 Tested: 1. doGet method to get FanCollection ``` curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans", "@odata.type": "#FanCollection.FanCollection", "Description": "The collection of Fan resource instances chassis", "Members": [ { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan5" }, { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan4" }, { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan3" }, { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan2" }, { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan1" }, { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0" } ], "Members@odata.count": 6, "Name": "Fan Collection" } 2. Input the wrong chassisId with the doGet method curl -k https://${bmc}/redfish/v1/Chassis/chassis11/ThermalSubsystem/Fans { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'chassis11' was not found.", "MessageArgs": [ "Chassis", "chassis11" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type Chassis named 'chassis11' was not found." } } ``` Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: If5e9ff5655f444694c7ca1aea95d45e2c9222625 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-07-11Add MaxLanes and MaxPCIeType properties to the PCIeInterfaceKonstantin Aladyshev1-0/+2
According to the Redfish Data Model specification PCIeInterface (v1.3+) of the PCIeDevice model contains the following properties: MaxLanes (v1.3+) The number of PCIe lanes supported by this device. - This property shall contain the maximum number of PCIe lanes supported by this device. MaxPCIeType (v1.3+) The highest version of the PCIe specification supported by this device. - This property shall contain the maximum PCIe specification that this device supports. Since PCIeDevice interface from the phosphor-dbus-interfaces has these values in the 'MaxLanes' and 'GenerationSupported' properties, populate the fields to Redfish. Tested: Redfish validator passed Before: redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", ... "PCIeInterface": { "LanesInUse": 4, "PCIeType": "Gen3" }, ... } After: redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", ... "PCIeInterface": { "LanesInUse": 4, "MaxLanes": 4, "MaxPCIeType": "Gen3", "PCIeType": "Gen3" }, ... } Change-Id: Iec786e376cea8fd2aa516b5b2a3da4286e59627a Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
2023-06-30Add PCIe Slot information to PCIeDevice schemaLakshmi Yadlapati1-0/+4
To align with Redfish's transition from using the PCIeSlot schema to including the Slot within the PCIeDevice schema, this commit adds PCIe Slot information to the PCIeDevice schema. The corresponding PCIe Slot is retrieved using the 'contained_by' association, which establishes a link from the PCIeDevice object to the PCIeSlot object. If there is no PCIeSlot associated with the PCIeDevice, the Slot properties will not be returned. Directed associations, ‘containing’ and ‘contained_by’, are used to establish a link between PCIeDevice and PCIeSlot. The 'containing' association establishes a link from a PCIeSlot to the PCIeDevice it contains, while the 'contained_by' association establishes a link from a PCIeDevice to the PCIeSlot that contains it. Additionally, this commit refactors the PCIeDevice schema to improve its structure, readability, and adherence to best practices. Redfish commit: https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_11_0.json Tested: Validator Passed ''' curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card7 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", "Id": "pcie_card7", "Name": "PCIe Device", "PCIeFunctions": { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card7/PCIeFunctions" }, "PCIeInterface": { "LanesInUse": -1 }, "Slot": { "Lanes": 0, "SlotType": "FullLength" }, "Status": { "Health": "OK", "State": "Absent" } } PCIeDevice with no association: curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card0 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", "Id": "pcie_card0", "Name": "PCIe Device", "PCIeFunctions": { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0/PCIeFunctions" }, "PCIeInterface": { "LanesInUse": -1 }, "Status": { "Health": "OK", "State": "Absent" } } ''' Change-Id: I15ac33be0035721f44c60fded795092896bce9bd Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com> Signed-off-by: Ed Tanous <edtanous@google.com>
2023-06-28Add efficiency percent for PowerSupplyGeorge Liu1-0/+2
This commit is to add EfficiencyRatings/EfficiencyPercent information according to the Redfish PowerSupply schema. In the PDI model, it is assumed that all power supplies have the same Efficiency Rating. This implementation uses the xyz.openbmc_project.Control.PowerSupplyAttributes interface for all power supplies, similar to power.hpp. ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json Tested: Validator passes curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "EfficiencyRatings": [ { "EfficiencyPercent": 90 } ], "FirmwareVersion": "383239323732", "Id": "powersupply0", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.WZS00F6-E0" } }, "Manufacturer": "", "Model": "51E9", "Name": "powersupply0", "PartNumber": "03KP466", "SerialNumber": "YL10KY26E073", "SparePartNumber": "03FP378", "Status": { "Health": "OK", "State": "Enabled" } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ic782676f9efb8434f1076e726ff0656d1c27d310 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-06-16Add ServiceLabel information for PowerSupplyGeorge Liu1-0/+1
This commit is to add Location/PartLocation/ServiceLabel information according to the Redfish PowerSupply schema. If the `xyz.openbmc_project.Inventory.Decorator.LocationCode` interface does not exist, the ServiceLabel information property is not displayed. ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json Tested: Validator passes curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "FirmwareVersion": "383239323732", "Id": "powersupply0", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.WZS00F6-E0" } }, "Manufacturer": "", "Model": "51E9", "Name": "powersupply0", "PartNumber": "03KP466", "SerialNumber": "YL10KY26E073", "SparePartNumber": "03FP378", "Status": { "Health": "OK" } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Icd0c21719bb01f481a8cd4c56bdb1a9ee047b047
2023-06-15Add FirmwareVersion For PowerSupplyGeorge Liu1-0/+1
This commit is to add firmware version information according to the Redfish PowerSupply schema. If the `xyz.openbmc_project.Software.Version` interface does not exist, the firmware version information property is not displayed. ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json Tested: Validator passes curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "FirmwareVersion": "383239323732", "Id": "powersupply0", "Manufacturer": "", "Model": "51E9", "Name": "powersupply0", "PartNumber": "03KP466", "SerialNumber": "YL10KY26E073", "SparePartNumber": "03FP378", "Status": { "Health": "OK" } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I3ced467faf49d08c46a8b9bb2aa722f35353c811
2023-06-14Add asset information for PowerSupplyGeorge Liu1-0/+5
This commit is to add asset information according to the Redfish PowerSupply schema. If the `xyz.openbmc_project.Inventory.Decorator.Asset` interface does not exist, the asset information property is not displayed. ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json Tested: Validator passes curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "Id": "powersupply0", "Manufacturer": "", "Model": "51E9", "Name": "powersupply0", "PartNumber": "03KP466", "SerialNumber": "YL10KY26E073", "SparePartNumber": "03FP378", "Status": { "Health": "OK" } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I83f1a9375f83e3470089cb2b5207db9665cc69df
2023-06-13Add Status information for Power SupplyGeorge Liu1-0/+2
This commit is to add PowerSupply State/Health status according to the Redfish PowerSupply schema. If the `xyz.openbmc_project.Inventory.Item` interface does not exist, the state status property is set to default "Present". If the `xyz.openbmc_project.State.Decorator.OperationalStatus` interface does not exist, the health status property is set to default "OK". ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json Code that updates the OperationalStatus for all the inventory https://github.com/openbmc/openpower-vpd-parser/blob/ \ 3fb026386546cfd288ab4f86156c9aa0ffa145d6/ibm_vpd_app.cpp#L620 Tested: Validator passes curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "Id": "powersupply0", "Name": "powersupply0", "Status": { "Health": "OK" "State": "Enabled" } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I121b665a4e605024644cc7c9392f88a71703481e Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-06-09Expose VLAN interfaces as EthernetInterfaceJiaqing Zhao1-0/+5
In OpenBMC, VLAN is a virtual interface that has its own configuration like IP address. Redfish schema 2021.2+ also suggests using individual EthernetInterface to show VLAN information. This patch exposes VLAN interfaces as EthernetInterface for configuring them. Now bmcweb also shows BMC VLAN interfaces under /redfish/v1/Managers /bmc/EthernetInterfaces. Fixes bmcweb issue #79 (Unable configure IP on VLAN interface via redfish). Tested: * Both physical and VLAN interfaces are now in the interface collection * Only VLAN interfaces have the VLAN property and RelatedInterfaces property pointing to its parent interface * IP address of both physical and VLAN interfaces can be modified by PATCH request successfully * Redfish validator passed Change-Id: I608892275cfbef4af8e7a03a10d67a9c2fa3ff53 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
2023-06-08Remove usage of deprecated VLanNetworkInterfaceJiaqing Zhao1-8/+0
In Redfish Schema (DSP2046) 2022.3 introduces EthernetInterface 1.9.0 that allows creating VLAN interface by POST EthernetInterface [1] instead of using the deprecated VLanNetworkInterface. This patch removes all current usage of VLanNetworkInterface. This patchest (topic:redfish-ethernet-1.9) introduces breaking API changes to current VLAN management features. All deprecated VLAN APIs are removed, VLAN interfaces will be managed in the same way as the EthernetInterface Resource, except they can be created or deleted. Since webui-vue has not implemented anything related to VLAN yet, it is not impacted. Solves the issue mentioned in 188cb6294105 ("ethernet: Bump EthernetInterface schema 1.4.1 -> 1.6.0") [1] https://redfishforum.com/thread/619 Tested: Redfish validator passed on a board with VLAN interface. No VLAN interface is exposed in Redfish. Change-Id: I9b243a5bb0f07642aa60bc13a622e862f62ee871 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-06-07PATCH userGroups Information ("AccountTypes")Abhishek Patel1-0/+1
This commit enhances the redfish API to set and unset userGroups information for each user account. Users with ConfigureUsers level privilege can patch (Set and Unset) AccountTypes of each user role. In addition, a user with "ConfigureSelf" level privilege can only set or Update their password. "Redfish" is always enabled in each user role. However, "ConfigureUsers" can disable other user redfish services. But if "ConfigureUsers" try to disable its redfish service, that generates an error. In this commit, users can enable and disable "redfish", "ssh", "hostconsole" and "ipmi" services from each user where ssh is a special case. The 'web' group does not control access to the web interface, and doesn't appear to do anything. The 'redfish' in the UserGroups is mapped to both Redfish and WebUI AccountTypes. To enable redfish User Group both of these account types should be specified, and none to disable it. Tested: Testing was done using curl command with ConfigureUsers and ConfigureSelf. $ curl -k -X PATCH https://$bmc:18080/redfish/v1/AccountService/Accounts/webuser -d '{"AccountTypes": ["Redfish", "WebUI", "ManagerConsole", "HostConsole"]}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request completed successfully.", "MessageArgs": [], "MessageId": "Base.1.13.0.Success", "MessageSeverity": "OK", "Resolution": "None" } ] } Also ran following cases: $ curl -k -X PATCH https://${bmc}/redfish/v1/AccountService/Accounts/user99 -d '{"AccountTypes": ["HostConsole"]}' $ curl -k -X PATCH https://${bmc}/redfish/v1/AccountService/Accounts/user99 -d '{"AccountTypes": ["IPMI"]}' $ curl -k -X PATCH https://${bmc}/redfish/v1/AccountService/Accounts/user99 -d '{"AccountTypes": ["Redfish", "WebUI"]}' $ curl -k -X PATCH https://${bmc}/redfish/v1/AccountService/Accounts/user99 -d '{"AccountTypes": ["ManagerConsole"]}' $ curl -k -X PATCH https://${bmc}/redfish/v1/AccountService/Accounts/user99 -d '{"AccountTypes": ["Redfish", "IPMI", "HostConsole", "ManagerConsole", "WebUI"]}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "There are insufficient privileges for the account or credentials associated with the current session to perform the requested operation.", "MessageArgs": [], "MessageId": "Base.1.13.0.InsufficientPrivilege", "MessageSeverity": "Critical", "Resolution": "Either abandon the operation or change the associated access rights and resubmit the request if the operation failed." } ], "code": "Base.1.13.0.InsufficientPrivilege", "message": "There are insufficient privileges for the account or credentials associated with the current session to perform the requested operation." } $ curl -k -H 'X-Auth-Token: IpnCBj1Lozh53Jhzxu7T' -X PATCH https://${bmc}/redfish/v1/AccountService/Accounts/user999 -d '{"Password":"0penBmc123"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request completed successfully.", "MessageArgs": [], "MessageId": "Base.1.13.0.Success", "MessageSeverity": "OK", "Resolution": "None" } ] Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com> Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Change-Id: I1a0344ca45556b820bb77c3dcb459f27eb032501 Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
2023-05-25Processor: Add processor throttle statusChris Cain1-0/+2
- Update Processor Schema to 18.0 - Add processor throttle status and cause https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/63063 Throttled: An indication of whether the processor is throttled. ThrottledCauses: An array of reasons that the processor is throttled. Ran validator and no new errors were found. Change-Id: Ia4a58ae0f26ffc6177f418420ba45063471323da Signed-off-by: Chris Cain <cjcain@us.ibm.com>
2023-05-23Switched bmcweb to use new telemetry service APIKrzysztof Grobelny1-0/+27
Added support for multiple MetricProperties. Added support for new parameters: CollectionTimeScope, CollectionDuration. ReadingParameters was not yet changed in telemetry backend, instead temporary property ReadingParametersFutureVersion was introduced. Once bmcweb is adapted to use ReadingParametersFutureVersion this property will be renamed in backend to ReadingParameters. Then bmcweb will change to use ReadingParameters. Then ReadingParametersFutureVersion will be removed from backend and everything will be exactly like described in phosphor-dbus-interfaces without introducing breaking changes. Related change in phosphor-dbus-interfaces [1], [2]. This change needs to be bumped together with [3]. Tested: - It is possible to create MetricReportDefinitions with multiple MetricProperties. - Stub values for new parameters are correctly passed to telemetry service. - All existing telemetry service functionalities remain unchanged. [1]: https://github.com/openbmc/phosphor-dbus-interfaces/commit/4f9c09144b60edc015291d2c120fc5b33aa0bec2 [2]: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60750 [3]: https://gerrit.openbmc.org/c/openbmc/telemetry/+/58229 Change-Id: I2cd17069e3ea015c8f5571c29278f1d50536272a Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
2023-05-20redfish: Add EncryptionStatus to DriveJohn Edward Broadbent1-0/+1
This change takes the locked, and EncryptionStatus properties from Drives interfaces, and creates the redfish property EncryptionStatus. Tested: $ wget -qO- \ http://localhost:80/redfish/v1/Chassis/AgoraV2/Drives/mmcblk0 { "@odata.context": "/redfish/v1/$metadata#Drive.Drive", "@odata.id": "/redfish/v1/Chassis/Drives/mmcblk0", "@odata.type": "#Drive.v1_7_0.Drive", "CapacityBytes": 15634268160, "EncryptionStatus": "Unencrypted", "Id": "mmcblk0", "Links": { "Chassis": "Enabled" }, "Name": "mmcblk0", "Status": { "State": "Enabled" } } Running the redfish Validator did not show any errors from this change. Change-Id: Ic7b58614466535b3fd6b8c097050d3e9c8de8203 Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
2023-05-18Implements PowerSupply schemaGeorge Liu1-0/+6
This commit implements the Redfish PowerSupply schema and populates the PowerSupplyCollection members. The PowerSupply is a grandchild of the PowerSubsystem. PowerSupply is part of the new PowerSubsystme/ThermalSubsystem schemas, released in Redfish Version 2020.4. This commit only displays the PowerSupplies in the chassis with common fields like odata.id, odata.type, Id, and Name. Future commits will add PowerSupply properties like FirmwareVersion, LocationIndicatorActive, Status, and Asset information like SerialNumber, PartNumber, Model. This commit looks at the powered_by association from Inventory.Item.Chassis to Inventory.Item.PowerSupply to find a PowerSupply [1]. [1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/58609 Tested: Validator passes 1. curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "Id": "powersupply0", "Name": "powersupply0" } 2. Bad power supply name curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/ERROR { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type PowerSupply named 'ERROR' was not found.", "MessageArgs": [ "PowerSupply", "ERROR" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type PowerSupply named 'ERROR' was not found." } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I7b7c0e40c090a3f253f1a778edbe36be9b4317b0 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-05-16Fix documentation for PCIeDevice propertiesLakshmi Yadlapati1-5/+7
This commit addresses the incorrect placement and missing documentation of PCIeDevice properties. The properties have been moved to the correct location and all missing details have been added. 913e7732 added the asset properties in the wrong spot. 62cd45af added the pcietype property. f5c9f8bd added the deviceType. No testing has been performed for this change. Tested: None Change-Id: I3574a67c4d1cdb22d6f3dc748b80b6266ed2164c Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-05-12Add State information for PCIeDeviceLakshmi Yadlapati1-0/+1
This commit is to add state information according to the Redfish PCIeDevice schema. Default state is "Enabled". ref: https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_9_0.json Tested: Validator passed ''' curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", "Id": "pcie_card8", "Manufacturer": "", "Model": "6B87", "Name": "PCIe Device", "PCIeFunctions": { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8/PCIeFunctions" }, "PCIeInterface": { "LanesInUse": -1 }, "PartNumber": "03FL194", "SerialNumber": "Y131UF09S00J", "Slot": { "Location": { "PartLocation": { "ServiceLabel": "U78DB.ND0.WZS0018-P0-C8" } } }, "SparePartNumber": "03FL195", "Status": { "Health": "OK", "State": "Enabled" } } ''' Change-Id: Ibee01345c81c2e824fc2387c4f27e421b3f4c507 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-04-28Add Asset information for PCIeDeviceSunnySrivastava19841-0/+5
This commit publishes inventory properties like SparePartNumber, Model, PartNumber, SerialNumber, Manufacturer for PCIe devices. Tested: Validator passed ``` "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", "Id": "pcie_card10", "Manufacturer": "", "Model": "6B87", "Name": "PCIe Device", "PCIeFunctions": { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10/PCIeFunctions" }, "PCIeInterface": { "LanesInUse": 16, "PCIeType": "Gen4" }, "PartNumber": "03FL204", "SerialNumber": "YA31UF07200Z", "SparePartNumber": "03FL205" ``` Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: I850fe5eb2b3b3b9d47f4256ce0c4408bb1dd2bd1 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-04-11Implements PowerSupplies schemaGeorge Liu1-0/+6
This commit implements the Redfish PowerSupplyCollection at /redfish/v1/Chassis/<chassis Id>/PowerSubsystem/PowerSupplies. It shall contain an array of links to resources of type PowerSupply that represent the power supplies that provide power to this chassis. For the association between power supply and chassis, refer to[1]. Also, the members property is implemented in the next commit with the PowerSupply implementation, this is so the validator will pass. [1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57428 Tested: Validator passes 1. curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies" "@odata.type": "#PowerSupplyCollection.PowerSupplyCollection", "Description": "The collection of PowerSupply resource instances chassis", "Members": [ ], "Members@odata.count": 0, "Name": "Power Supply Collection" } 2. Bad chassisId curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassisError/PowerSubsystem/ PowerSupplies { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'chassisError' was not found.", "MessageArgs": [ "Chassis", "chassisError" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type Chassis named 'chassisError' was not found." } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I48e087d6fb52013e3a96b44391cc4d86049ac176
2023-04-04Add HotPluggable support in RedfishLogananth Sundararaj1-0/+1
HotPluggable is an indication of whether this component can be inserted or removed while the equipment is in operation. HotPluggable is a property can read from the Entity manager under the xyz.openbmc_project.Inventory.Decorator.Replaceable interface. Tested: Tested and verified in YosemiteV2 platform and Redfish validator has passed. Change-Id: I7b2203b1843fa3cbdbef7803b598d113346c0682 Signed-off-by: Logananth Sundararaj <logananth_s@hcl.com>
2023-03-18Implement AggregationSourceCarson Labrado1-0/+7
Adds an AggregationSource resource for each satellite config present on dbus. Adds the AggregationSource schema which we had previously ignored. Tested: Querying an AggregationSource returned the expected information. curl localhost/redfish/v1/AggregationService/AggregationSources/5B247A { "@odata.id": "/redfish/v1/AggregationService/AggregationSources/5B247A", "@odata.type": "#AggregationSource.v1_3_1.AggregationSource", "HostName": "http://122.111.11.1:80", "Id": "5B247A", "Name": "Aggregation source", "Password": null, } Service Validator passed. The Service Validator also passed after removing the satellite config from the system such that /redfish/v1/AggregationService/AggregationSources returns an empty Members array. Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I88b5fbc15f27cddd330ec22a25427fd8b18cf766
2023-03-14Implement AggregationSourceCollectionCarson Labrado1-0/+8
This is an intermediate step in setting up aggregation sources. A future patch will add aggregation sources based on the existence of satellite configs. For now the collection will always return as 0 members. Adds the AggregationSourceCollection schema which we previously ignored. Tested: Service Validator passes Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I65c9231289bf0a9b6392696d55bc3feb0023c694
2023-03-04Redfish.md: Add missing cable propertiesGunnar Mills1-0/+15
CableType and LengthMeters were missing in Redfish.md. Added here: 9c929bea78857633f2b71b356abf4aa4b1ac56d2 Tested: None, document. Change-Id: I7f705fcbf93bdd975d284700a63bc1fa8abe26d9 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2023-03-02Implement ManagerDiagnosticData/ServiceRootUptimeSecondsEd Tanous1-0/+6
This property was added in Redfish 2022.2 to denote how long this service has been up and available. This implementation opts to go to systemd to get the bmcweb service uptime rather than track it through internal process state, given that systemd already has an API that tracks the bmcweb uptime, and bmcweb attempts to keep as little state as possible. Given that we already have helper functions that give durations in milliseconds precision, this patchset opts to keep the millisecond granularity, rather than dropping to microsecond precision of the systemd API. There are no use cases that would require microsecond precision, so this patchset opts for lower complexity. Tested: Redfish service validator passes. GET /redfish/v1/Managers/bmc/ManagerDiagnosticData Returns a ServiceRootUptime property. Value matches systemctl status bmcweb. systemctl restart bmcweb, causes counter to reset. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie1b82c5150f3374faf0ce376402eba410e59891d
2023-03-02Add ManagerProvidingService implementationEd Tanous1-0/+1
This property was added in Redfish 2022.3 to allow clients to determine which manager is hosting the ServiceRoot, such that they can find uptime statistics, and other metrics from that resource, without needing to attach them directly to serviceroot. Tested: Redfish service validator passes. GET /redfish/v1/Managers/bmc returns the expected response. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If2b78528d1499fbdae46120e1a1792ecf7ceb1d3
2023-02-28Implement AggregationServiceEd Tanous1-0/+8
AggregationService is used to inform a client that some of the results might be aggregated, and to allow setting up aggregation sources. Today, this resource only contains the basic fields, as well as "Enabled", which informs the client of the fact that the service is aggregation enabled. AggregationService was one of the schemas we ignored, so this adds it to the supported list. Tested: Redfish service validator passes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ifb16a86ff81e387f01016a83f9e69240c8928614
2023-02-16Revert "Implement Manager/ServiceRootUptime"Ed Tanous1-1/+0
This reverts commit ee61a619da7f180a3148317d569d2dabd1cd9832. This feature was tested against an old version of schemas, and upstream DMTF seems to have changed the definition in the meantime. This wasn't caught because of the same test failure as yesterday. Mea Culpa Change-Id: I0be095f5dea0f036927202f367542275abc0ebe3 Signed-off-by: Ed Tanous <edtanous@google.com>
2023-02-16Add State information for FabricAdapterLakshmi Yadlapati1-0/+1
This commit is to add state information according to the Redfish FabricAdapter schema. If the `xyz.openbmc_project.Inventory.Item` interface does not exist, the state information property is not displayed. ref: http://redfish.dmtf.org/schemas/v1/FabricAdapter.v1_4_0.json Tested: Validator passes # ``` curl -k https://$bmc:/redfish/v1/Systems/system/FabricAdapters/disk_backplane0 { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0", "@odata.type": "#FabricAdapter.v1_4_0.FabricAdapter", "Id": "disk_backplane0", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.WZS0042-P1" } }, "Model": "6B89", "Name": "Fabric Adapter", "PartNumber": "02WG682", "SerialNumber": "YA31UF09P002", "SparePartNumber": "02WG681", "Status": { "State": "Enabled" } } ``` Change-Id: I1e541910d8d3d69b21594ee05e972517d8b8c12d Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-02-16Add Asset information for FabricAdapterLakshmi Yadlapati1-0/+4
This commit is to add asset information according to the Redfish FabricAdapter schema. If the `xyz.openbmc_project.Inventory.Decorator.Asset` interface does not exist, the asset information property is not displayed. ref: http://redfish.dmtf.org/schemas/v1/FabricAdapter.v1_4_0.json Tested: Validator passes # ``` curl -k https://$bmc:/redfish/v1/Systems/system/FabricAdapters/disk_backplane0 { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0", "@odata.type": "#FabricAdapter.v1_4_0.FabricAdapter", "Id": "disk_backplane0", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.WZS0042-P1" } }, "Model": "6B89", "Name": "Fabric Adapter", "PartNumber": "02WG682", "SerialNumber": "YA31UF09P002", "SparePartNumber": "02WG681" } ``` Change-Id: Id9265b8bd323aa1503c32122899eaa458bcdbb51 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-02-16Add Location information for FabricAdapterLakshmi Yadlapati1-0/+2
This commit is to add location information according to the Redfish FabricAdapter schema. If the `xyz.openbmc_project.Inventory.Decorator.LocationCode` interface does not exist, the location information property is not displayed. ref: http://redfish.dmtf.org/schemas/v1/FabricAdapter.v1_4_0.json Tested: Validator passes ``` curl -k https://$bmc/redfish/v1/Systems/system/FabricAdapters/disk_backplane0 { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0", "@odata.type": "#FabricAdapter.v1_4_0.FabricAdapter", "Id": "disk_backplane0", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.WZS0042-P1" } }, "Name": "Fabric Adapter" } ``` Change-Id: I0dad37dce06e4727057d9821b5c40c71db004ee6 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-02-15Implement Manager/ServiceRootUptimeEd Tanous1-0/+1
This property was added in Redfish 2022.2 to denote how long this service has been up and available. This implementation opts to go to systemd to get the bmcweb service uptime rather than track it through internal process state, given that systemd already has an API that tracks the bmcweb uptime, and bmcweb attempts to keep as little state as possible. Given that we already have helper functions that give durations in milliseconds precision, this patchset opts to keep the millisecond granularity, rather than dropping to microsecond precision of the systemd API. There are no use cases that would require microsecond precision, so this patchset opts for lower complexity. Tested: Redfish service validator passes. GET /redfish/v1/Managers/bmc Returns a ServiceRootUptime property. Value matches systemctl status bmcweb. systemctl restart bmcweb, causes counter to reset. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iae7e805f3f7f5f26745476eaeaecb63bda16a957
2023-02-09Implementation of FabricAdapter schema in bmcwebSunny Srivastava1-0/+11
This commit implements FabricAdapter and FabricAdapter collection schema. This code assumes all FabricAdapters are under /redfish/v1/Systems/system like we do for Memory and Processors. The schema can be used to publish inventory properties for FRUs which can be modelled as Fabric adapters. As a current use case, this schema is required to link ports on fabric adapters back to the system. A FabricAdapter represents the physical fabric adapter capable of connecting to an interconnect fabric. Examples include but are not limited to Ethernet, NVMe over Fabrics, Gen-Z, and SAS fabric adapters. Tested: Manually tested on the system, Run Redfish validator. Found no error. { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters", "@odata.type": "#FabricAdapterCollection.FabricAdapterCollection", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane1" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card0" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card3" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card4" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card8" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card10" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card11" } ], "Members@odata.count": 8, "Name": "Fabric Adapter Collection" } { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/pcie_card11", "@odata.type": "#FabricAdapter.v1_0_0.FabricAdapter", "Id": "pcie_card11", "Name": "Fabric Adapter" } Signed-off-by: sunny srivastava <sunnsr25@in.ibm.com> Change-Id: I4d3bc31a6f0036c262c0e30481d0da4aaf59b5ab Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
2023-01-19Add Get for PCIe property LanesInUseMyung Bae1-0/+5
Added Redfish property 'LanesInUse' to PCIeDevices under redfish/v1/Systems. LanesInUse maps to dbus LanesInUse property for the Inventory.Item.PCIeDevice interface. Note: GUI might map this property to 'LinkWidth' Tested: 1) Redfish validator passed 2) Curl testing curl -k <token> \ https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8", "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice", ... "PCIeInterface": { "LanesInUse": 16, "PCIeType": "Gen4" }, ... } Signed-off-by: Myung Bae <myungbae@us.ibm.com> Change-Id: I896abe44f55414f25d01c5a93a31bb585264657e
2022-12-07markdownlint: fix all warningsPatrick Williams1-160/+152
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I1402cbd84c916792ca2fc0ad0f34db661cbdfa72
2022-12-07format: reformat with latest openbmc-build-scriptsPatrick Williams1-38/+188
Reformat the repository using the latest from openbmc-build-scripts. Add the `static/redfish` directory to be ignored by prettier since these files come from elsewhere and having the ability to do a direct diff is handy. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I74464d6f97047b4888a591e0d8a4f5ca970ac69e
2022-11-15Add Redfish EnvironmentMetrics schema in bmcwebAlbert Zhang1-0/+3
This commit implements Chassis' EnvironmentMetrics schema, a resource in Redfish version 2022.2 that represents the environment metrics implemented by Redfish. This resource includes Energy consumption, Fan speeds (percent), Power consumption (Watts), etc. And these data are mainly obtained from under sensors. Only the basic information of EnvironmentMetrics is implemented in the current commit. ref: https://www.dmtf.org/sites/default/files/standards/documents/ DSP0268_2022.2.pdf (6.31 EnvironmentMetrics 1.3.0) http://redfish.dmtf.org/schemas/v1/EnvironmentMetrics.v1_3_0.json Tested: Validator passes 1. doGet method to get EnvironmentMetrics curl -k -H "X-Auth-Token: $token" https://$bmc/redfish/v1/Chassis/ chassis/EnvironmentMetrics { "@odata.id": "/redfish/v1/Chassis/chassis/EnvironmentMetrics", "@odata.type": "#EnvironmentMetrics.v1_3_0.EnvironmentMetrics", "Id": "EnvironmentMetrics", "Name": "Chassis Environment Metrics" } 2. Input the wrong chassisId with the doGet method curl -k -H "X-Auth-Token: $token" https://$bmc/redfish/v1/Chassis/ chassisError/EnvironmentMetrics { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'chassisError' was not found.", "MessageArgs": [ "Chassis", "chassisError" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type Chassis named 'chassisError' was not found." } } Signed-off-by: Albert Zhang <zhanghaodi@inspur.com> Change-Id: I6a75dfbc94f39d90a1368770076b874608394691 Signed-off-by: George Liu <liuxiwei@inspur.com>
2022-08-01Add Redfish ThermalSubsystem schema in bmcwebXiaochao Ma1-0/+5
The ThermalSubsystem is a new resource in Redfish version 2020.4. It is a root for fans and temperatures. Fans are a new schema. Temperature sensors will be part of the new ThermalMetrics schema. ThermalSubsystem can co-exist with the current Thermal resource. You can also control compilation through flags. ThermalSubsystem is an improvement on the existing Thermal schema because 1. It includes the latest properties like LocationIndicatorActive 2. Fans and Temperatures were arrays in the old Thermal schema and this was cumbersome and could hit limits of JSON arrays 3. Large amount of static data mixed with sensor readings, which hurt performance 4. Inconsistent definitions of properties vs like Processor and Memory schemas In a future commits Fans and ThermalMetrics will be added soon. Reference: https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2020.4.pdf https://redfish.dmtf.org/schemas/v1/ThermalSubsystem.v1_0_0.json Test: 1. Validator passed. 2. doGet method: ~$ curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem", "@odata.type": "#ThermalSubsystem.v1_0_0.ThermalSubsystem", "Id": "chassis", "Name": "Thermal Subsystem for Chassis", "Status": { "Health": "OK", "State": "Enabled" } } 3. A bad chassis ID: ~$ curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassisSSBAD/ThermalSubsystem { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named chassisSSBAD was not found.", "MessageArgs": [ "Chassis", "chassisSSBAD" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type Chassis named chassisSSBAD was not found." } } Signed-off-by: Xiaochao Ma <maxiaochao@inspur.com> Change-Id: Ib19879f584304e5303f1a83d88bdd18c78a61633 Signed-off-by: Zhenwei Chen <zhenweichen0207@gmail.com>