Skip to content

Tags: AMDESE/bmcweb

Tags

sp7_v2.18.0.091C

Toggle sp7_v2.18.0.091C's commit message
bmcweb: Select power-cap host via HostNumber URL

The earlier per-CPU power-capping change routed the target host by the
PowerControl MemberId in the request body and derived the exposed member
count from HostMode CurrentMode. Rework this to select the host with a
?HostNumber= URL parameter instead, matching the Systems power-on / reset
flow (e.g. /redfish/v1/Systems/system/?HostNumber=1) so the Power resource
is consistent with the rest of the multi-host API.
Host selection is now direct and does not depend on reading HostMode:
  no HostNumber / 0 -> host0 (2P: single host controls all sockets)
  HostNumber 1      -> host1 (2x1P: CPU 0 / P0)
  HostNumber 2      -> host2 (2x1P: CPU 1 / P1)

e.g. GET and PATCH now operate on a single PowerControl member for the
selected host, so the body is identical for both CPUs and only the URL differs:
  PATCH /redfish/v1/Chassis/Chassis/Power?HostNumber=1
  { "PowerControl": [ { "PowerLimit": { "LimitInWatts": 460 } } ] }

Tested: on morocco

Signed-off-by: Ashok Kumar <ashok2ku@amd.com>