Skip to content
  1. Dec 07, 2022
  2. Dec 06, 2022
    • Ed Tanous's avatar
      Implement If-Match header in Http layer · 2d6cb56b
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      If-Match is a header in the HTTP specification[1] designed for handling
      atomic operations within a given HTTP tree.  It allows a mechanism for
      an implementation to explicitly declare "only take this action if the
      resource has not been changed".  While most things within the Redfish
      tree don't require this level of interlocking, it continues to round out
      our redfish support for the specific use cases that might require it.
      
      Redfish specification 6.5 states:
      If a service supports the return of the ETag header on a resource, the
      service may respond with HTTP 428 status code if the If-Match or
      If-None-Match header is missing from the PUT or PATCH request for the
      same resource, as specified in RFC6585
      
      This commit implements that behavior for all handlers to follow the
      following flow.
      If If-Match is present
      Repeat the same request as a GET
      Compare the ETag produced by the GET, to the one provided by If-Match
      If they don't match, return 428
      if they do match, re-run the query.
      
      [1] https://www.rfc-editor.org/rfc/rfc2616#section-14.24
      
      
      
      As a consequence, this requires declaring copy and move constructors
      onto the Request object, so the request object can have its lifetime
      extended through a request, which is very uncommon.
      
      Tested:
      Tests run on /redfish/v1/AccountService/Accounts/root
      PATCH with correct If-Match returns 200 success
      PATCH with an incorrect If-Match returns 419 precondition required
      GET returns the resource as expected
      
      Redfish service validator passes
      Redfish protocol validator passes! ! ! ! !
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I530ab255259c32fe4402eb8e5104bd091925c77b
      2d6cb56b
  3. Dec 05, 2022
    • Edward Lee's avatar
      Code move to prevent circular dependency · c0bdf223
      Edward Lee authored and Ed Tanous's avatar Ed Tanous committed
      While implementing https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57932
      
      ,
       there has been an issue where there is a circular dependency between
      routing.hpp and privileges.hpp. This code move predates this change
      to resolve it before implementing the heart of redfish authz.
      
      Circular dependency will occur when we try to use the http verb
      index variables in privilege.hpp. If this occurs routing.hpp
      and privilege.hpp will co-depend on each other
      and this code move prevents this from occuring.
      
      Tested:
      bitbake bmcweb
      Code compiles (code move only)
      Redfish Validator passed on next commit
      
      Signed-off-by: default avatarEdward Lee <edwarddl@google.com>
      Change-Id: I46551d9fe222e702d239ed3ea6d3d7e505d488c8
      c0bdf223
    • Ed Tanous's avatar
      Make router take up less space for verbs · 2c9efc3c
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      As is, the router designates routes for every possible boost verb, of
      which there are 31.  In bmcweb, we only make use of 6 of those verbs, so
      that ends up being quite a bit of wasted space and cache non-locality.
      
      This commit invents a new enum class for declaring a subset of boost
      verbs that we support, and a mapping between bmcweb verbs and boost
      verbs.
      
      Then it walks through and updates the router to support converting one
      to another.
      
      Tested:
      Unit Tested
      Redfish Service Validator performed on future commit
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Signed-off-by: default avatarEdward Lee <edwarddl@google.com>
      Change-Id: I3c89e896c632a5d4134dbd08a30b313c12a60de6
      2c9efc3c
    • Patrick Williams's avatar
      python: fix flake8 warnings · ddfc6752
      Patrick Williams authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I6bcc6c72e1855c7de7c8b1e88cbab01e92b4070d
      ddfc6752
    • Johnathan Mantey's avatar
      Prevent unconditionally writing over the LinkStatus · 0ef0e289
      Johnathan Mantey authored and Ed Tanous's avatar Ed Tanous committed
      
      
      The NIC LinkStatus was being assigned a LinkUp or NoLink value
      depending on whether the NIC is enabled.
      
      Subsequent code unconditionally overwrites the LinkStatus.
      
      The LinkStatus needs to take into account the NIC enabled state as
      well as the link up/down state.
      
      Tested:
      Confirmed NIC enabled/link active resulted in LinkUp.
      Confrimed NIC enabled/no-carrier resulted in LinkDown.
      Connfimred NIC disable resulted in NoLink.
      
      Change-Id: Iece3686cac9714e427b0e100f486a4ced334f7af
      Signed-off-by: default avatarJohnathan Mantey <johnathanx.mantey@intel.com>
      0ef0e289
  4. Dec 01, 2022
  5. Nov 29, 2022
    • George Liu's avatar
      Add the GetSubTree and GetSubTreePaths method to dbus_utility · 2138483c
      George Liu authored
      
      
      There are currently many files that use the GetSubTree and
      GetSubTreePaths methods. Since they are a general method, they are
      defined in the dbus_utility.hpp file and will be further refactored
      in subsequent patches.
      
      Also, Updated the doPath method of NetworkProtocol synchronously.
      
      Tested: Built bmcweb successfully and Validator passes
      1. doGet NetworkProtocol
      curl -k -H "X-Auth-Token: $token"
      https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
      {
        "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol",
        "IPMI": {
          "Port": 623,
          "ProtocolEnabled": true
        },
        ...
      }
      
      2. change the ProtocolEnabled property to false
      curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json"
      -X PATCH -d '{"IPMI": {"ProtocolEnabled" :false}}'
      https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
      
      3. doGet NetworkProtocol again
      curl -k -H "X-Auth-Token: $token"
      https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
      {
        "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol",
        "IPMI": {
          "Port": null,
          "ProtocolEnabled": false
        },
        ...
      }
      
      Signed-off-by: default avatarGeorge Liu <liuxiwei@inspur.com>
      Change-Id: I9ed3de74417d2662a7f433ea4a589f68f514a369
      2138483c
  6. Nov 28, 2022
    • Potin Lai's avatar
      managers: fix interface patch and delete of pid object · 8be2b5b6
      Potin Lai authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Only set createNewObject to true when corresponding interface not found
      in the object.
      
      Tested on Bletchley:
      
      - Add new StepwiseController called SWTest
      Body in JSON format
      ```
      {
          "Oem": {
              "OpenBmc": {
                  "Fan": {
                      "StepwiseControllers": {
                          "SWTest": {
                              "Direction": "Floor",
                              "Inputs": [
                                  "MB_U402_THERM_LOCAL"
                              ],
                              "NegativeHysteresis": 1.0,
                              "PositiveHysteresis": 2.0,
                              "Steps": [
                                  {
                                      "Output": 0.0,
                                      "Target": 48.0
                                  },
                                  {
                                      "Output": 15.0,
                                      "Target": 49.0
                                  }
                              ],
                              "Zones": [
                                  {
                                      "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0"
                                  }
                              ]
                          }
                      }
                  }
              }
          }
      }
      ```
      Checking object from dbus
      ```
      root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
      > /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
      > xyz.openbmc_project.Configuration.Stepwise
      NAME                                       TYPE      SIGNATURE RESULT/VALUE            FLAGS
      .Delete                                    method    -         -                       -
      .Class                                     property  s         "Floor"                 emits-change writable
      .Inputs                                    property  as        1 "MB U402 THERM LOCAL" emits-change writable
      .Name                                      property  s         "SWTest"                emits-change writable
      .NegativeHysteresis                        property  d         1                       emits-change writable
      .Output                                    property  ad        2 0 15                  emits-change writable
      .PositiveHysteresis                        property  d         2                       emits-change writable
      .Reading                                   property  ad        2 48 49                 emits-change writable
      .Type                                      property  s         "Stepwise"              emits-change writable
      .Zones                                     property  as        1 "Zone0"               emits-change writable
      ```
      
      - Patch SWTest properties
      Body in JSON format
      ```
      {
          "Oem": {
              "OpenBmc": {
                  "Fan": {
                      "StepwiseControllers": {
                          "SWTest": {
                              "NegativeHysteresis": 3.0,
                              "PositiveHysteresis": 4.0
                          }
                      }
                  }
              }
          }
      }
      ```
      Checking object from dbus
      ```
      root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
      > /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
      > xyz.openbmc_project.Configuration.Stepwise
      NAME                                       TYPE      SIGNATURE RESULT/VALUE            FLAGS
      .Delete                                    method    -         -                       -
      .Class                                     property  s         "Floor"                 emits-change writable
      .Inputs                                    property  as        1 "MB U402 THERM LOCAL" emits-change writable
      .Name                                      property  s         "SWTest"                emits-change writable
      .NegativeHysteresis                        property  d         3                       emits-change writable
      .Output                                    property  ad        2 0 15                  emits-change writable
      .PositiveHysteresis                        property  d         4                       emits-change writable
      .Reading                                   property  ad        2 48 49                 emits-change writable
      .Type                                      property  s         "Stepwise"              emits-change writable
      .Zones                                     property  as        1 "Zone0"               emits-change writable
      ```
      
      - Delete SWTest object
      Body in JSON format
      ```
      {
          "Oem": {
              "OpenBmc": {
                  "Fan": {
                      "StepwiseControllers": {
                          "SWTest": null
                      }
                  }
              }
          }
      }
      ```
      Object deleted from dbus
      ```
      root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
      > /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
      > xyz.openbmc_project.Configuration.Stepwise
      Failed to introspect object /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest of service xyz.openbmc_project.EntityManager: Unknown object '/xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest'.
      ```
      
      Signed-off-by: default avatarPotin Lai <potin.lai@quantatw.com>
      Change-Id: I482e942ee3c76dca17af522765d8b3aa9dc8678b
      8be2b5b6
    • Shantappa Teekappanavar's avatar
      Populate cable properties if length is NaN · 043360d0
      Shantappa Teekappanavar authored and Ed Tanous's avatar Ed Tanous committed
      Cable Length property value is NaN by default. The current
      implementation ignores processing other remaining Cable properties
      if the length is NaN. Per Ed's comment here we need to
      ignore if length is NaN and continue to process remaining properties:
      https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50265/4..7/redfish-core\
      /lib/cable.hpp#b51
      
      Testing:
      1. Validator test not done, assumed it is OK since it is a minor change
         in the code logic.
      
      2. curl testing:
      $ curl -k https://user:password@host:18080/redfish/v1/Cables/dp0_cable1
      
      
      {
        "@odata.id": "/redfish/v1/Cables/dp0_cable1",
        "@odata.type": "#Cable.v1_0_0.Cable",
        "CableType": "",
        "Id": "dp0_cable1",
        "Name": "Cable"
      }
      
      Signed-off-by: default avatarShantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
      Change-Id: If73828484d91bbf2eee45a31973c825bab008ba4
      043360d0
    • Patrick Williams's avatar
      sdbusplus: use shorter type aliases · 5b378546
      Patrick Williams authored and Ed Tanous's avatar Ed Tanous committed
      
      
      The sdbusplus headers provide shortened aliases for many types.
      Switch to using them to provide better code clarity and shorter
      lines.  Possible replacements are for:
        * bus_t
        * exception_t
        * manager_t
        * match_t
        * message_t
        * object_t
        * slot_t
      
      Change-Id: I4af62f309f4cd3bb51759fa18de2448235e557fe
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      5b378546
    • Tony Lee's avatar
      pcie:Fix get PCIeFunction · 973c1355
      Tony Lee authored and Ed Tanous's avatar Ed Tanous committed
      
      
      GET /redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>
      return resourceNotFound messages.
      
      Test:
      GET /redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>
      return the expected information of PCIeDevices.
      
      Signed-off-by: default avatarTony Lee <tony.lee@quantatw.com>
      Change-Id: I1587a74e77225939dec8030bba7fb04865e8051e
      973c1355
  7. Nov 23, 2022
  8. Nov 18, 2022
    • Gunnar Mills's avatar
      Allow a lower DeliveryRetryIntervalSeconds · 33a32b34
      Gunnar Mills authored
      The current DeliveryRetryIntervalSeconds range is 30 - 180 seconds. As
      far as I can tell, this is arbitrary. Lower the minimum to 5 seconds so
      the client (the IBM management console) can set it to this low. The
      current default will still be 30 seconds. The client wanted it this
      low because the data might not be correct by the time the event is
      retried. 5 seconds is arbitrary, decided on this only based on the
      client's request. A lower minimum of like 1 or even 0 is reasonable to
      me but going with 5 seconds because that is the request and what has
      been tested.
      
      Tested:
      
      Before:
      
      ```
      curl -k -H "Content-Type: application/json" -X PATCH https://$bmc/redfish/v1/EventService/ -d '{"DeliveryRetryIntervalSeconds": 5}'
      {
        "error": {
          "@Message.ExtendedInfo": [
            {
              "@odata.type": "#Message.v1_1_1.Message",
              "Message": "The value 5 for the query parameter
      DeliveryRetryIntervalSeconds is out of range [30-180].",
              "MessageArgs": [
                "5",
                "DeliveryRetryIntervalSeconds",
                "[30-180]"
              ],
              "MessageId": "Base.1.8.1.QueryParameterOutOfRange",
      ...
      ```
      After:
      
      ```
      curl -v -k -H "Content-Type: application/json" -X PATCH https://$bmc/redfish/v1/EventService/
      
       -d '{"DeliveryRetryIntervalSeconds": 5}'
      ...
      
      < HTTP/1.1 200 OK
      
      ```
      
      We have this patch downstream and have seen retring at 5 secs.
      
      Change-Id: I462569969565bdc97c15cb190ed65201d50abdf0
      Signed-off-by: default avatarGunnar Mills <gmills@us.ibm.com>
      33a32b34
  9. Nov 17, 2022
  10. Nov 16, 2022
    • George Liu's avatar
      Add Link header handling to PowerSubsystem · 2ea468a0
      George Liu authored
      
      
      This commit is to update PowerSubsystem to respond to HEAD requests
      in the way the redfish spec requires.
      
      Tested:
      HEAD /redfish/v1/Chassis/<str>/PowerSubsystem returns a correct
      looking Link header.
      Following that Link header resolves the schema file.
      
      Get /redfish/v1/Chassis/BadChassis/PowerSubsystem returns 404.
      
      Signed-off-by: default avatarGeorge Liu <liuxiwei@inspur.com>
      Change-Id: I2f2a0e80b74471ddc037e899cfaf3ba307741475
      2ea468a0
  11. Nov 15, 2022
    • Albert Zhang's avatar
      Add Redfish EnvironmentMetrics schema in bmcweb · 4ca3ec3c
      Albert Zhang authored
      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: default avatarAlbert Zhang <zhanghaodi@inspur.com>
      Change-Id: I6a75dfbc94f39d90a1368770076b874608394691
      Signed-off-by: default avatarGeorge Liu <liuxiwei@inspur.com>
      4ca3ec3c
  12. Nov 14, 2022
    • Nikhil Namjoshi's avatar
      Processor: Implement links and HEAD · 71a24ca4
      Nikhil Namjoshi authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Adds Links and Head handler for Processor and
      ProcessorCollection
      
      Tested:
      All of the below return a link header
      HEAD /redfish/v1/Systems/system/Processors
      HEAD /redfish/v1/Systems/system/Processors/cpu0
      GET /redfish/v1/Systems/system/Processors
      GET /redfish/v1/Systems/system/Processors/cpu0
      
      Change-Id: Iad19d577afb7cd9d5e652bed2d5884b6ea8260da
      Signed-off-by: default avatarNikhil Namjoshi <nikhilnamjoshi@google.com>
      71a24ca4
  13. Nov 11, 2022
    • Nan Zhou's avatar
      thermal subsystem: iwyu · ce05f6c4
      Nan Zhou authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Tested: unit tests; just added a few used headers
      
      Signed-off-by: default avatarNan Zhou <nanzhoumails@gmail.com>
      Change-Id: I3299f0445aedadd1411f4d3a407e9543197e22e1
      ce05f6c4
    • Carson Labrado's avatar
      Aggregation: Fix header clobbering · 69fca03e
      Carson Labrado authored and Ed Tanous's avatar Ed Tanous committed
      
      
      We attempt to sanitize the response body of the asyncResp object as
      the first step of copying over the satellite response into the
      object.  This is clobbering the "OData-Version" from the response
      header.
      
      We can completely remove this step since the body will already be
      empty.
      
      Tested:
      OData-Version is still present in the header when querying a satellite
      resource
      curl -s -D- localhost/redfish/v1/Chassis/5B247A_test | grep OData
      OData-Version: 4.0
      
      Signed-off-by: default avatarCarson Labrado <clabrado@google.com>
      Change-Id: I82f54ae9b990504a3236b7a1273c794b1ee6f090
      69fca03e
  14. Nov 09, 2022
  15. Nov 08, 2022
    • Nan Zhou's avatar
      power subsystem: fix header · ca9e6be6
      Nan Zhou authored
      
      
      Added the logging header.
      
      Tested: code compiles.
      
      Signed-off-by: default avatarNan Zhou <nanzhoumails@gmail.com>
      Change-Id: Ie707780e195766b37a3d307818615c6be36d424e
      ca9e6be6
    • Nan Zhou's avatar
      Add a whitespace in test · 4b78c8b2
      Nan Zhou authored
      
      
      This is a dummy commit to test owner plugin. It can be merged in as well
      given that it adds a little bit readability.
      
      Signed-off-by: default avatarNan Zhou <nanzhoumails@gmail.com>
      Change-Id: Ia4cc1866ebeb19e6d0f1d1ceece0ecc73fb4b468
      4b78c8b2
    • George Liu's avatar
      Add ThermalMetrics schema · f1240b47
      George Liu authored
      
      
      Based on DSP8010_2022.2 and adds the ThermalMetrics schema.
      ThermalMetrics is child of the ThermalSubsystem schema. It is part of
      the new Power/Thermal Schemas.
      ThermalMetrics contains temperature readings and the corresponding
      link to that sensor in the sensor collection.
      Temperatures such as Ambient, Exhaust, Intake, and Internal can be
      found in the schema.
      
      Tested: built bmcweb successfully and validator passes.
      
      Signed-off-by: default avatarGeorge Liu <liuxiwei@inspur.com>
      Change-Id: I16ad2f922acc963a0434f3d9ab5583d2242b0013
      f1240b47
  16. Nov 07, 2022
  17. Nov 02, 2022
    • Ed Tanous's avatar
      Subproject include as system include · 6c7d53a5
      Ed Tanous authored
      
      
      This commit fixes a minor regression induced when we moved to using
      submodule projects in meson.  When including boost and boost-url
      headers, some compilers take issue with them, so they need to be
      included as -isystem, instead of -I.  This also helps with running
      clang-tidy within meson.
      
      Tested:
      meson buildlocal
      ninja -C buildlocal
      
      Compiles on a fresh clone.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: Ic92ed1a1cc2c661b715c63a974e0db35c793f5f4
      6c7d53a5
    • Ed Tanous's avatar
      Implement If-None-Match support for caching client · 291d709d
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      This commit implements support for the If-None-Match header on http
      requests.  This can be combined with the
      89f18008 commit for producing ETag to
      allow a client to have a highly efficient cache, while still pulling
      data from the BMC.
      
      This behavior is documented several places, in W3C produced docs[1], as
      well as section 7.1 of the Redfish specification:
      '''
      A service only returns the resource if the current ETag of that resource
      does not match the ETag sent in this header.
      If the ETag in this header matches the resource's current ETag, the GET
      operation returns the HTTP 304 status code.
      '''
      
      Inside bmcweb, this behavior is accomplished in a relatively naive way,
      by creating the complete request, then doing a direct ETag comparison
      between the generated data and the request header.  In the event the two
      match, 304 not-modified is returned, in-line with both the Redfish
      specification and the HTTP RFC.
      
      [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match
      
      Tested (on previous rebase):
      First, request ServiceRoot
      curl --insecure -vvvv --user root:0penBmc https://192.168.7.2/redfish/v1
      
      This returns a header similar to:
      < ETag: "ECE52663"
      
      Taking that ETag, and putting it into an If-None-Match header:
      ```
      curl --insecure -vvvv -H "If-None-Match: \"ECE52663\"" \
      --user root:0penBmc https://192.168.7.2/redfish/v1
      
      
      ```
      
      Returns:
      < HTTP/1.1 304 Not Modified
      ...
      < Content-Length: 0
      
      Showing that the payload was not repeated, and the response size was
      much.... much smaller on the wire.  Performance was not measured as part
      of this testing, but even if it has no performance impact (which is
      unlikely), this change is still worthwhile to implement more of the
      Redfish specification.
      
      Redfish-service-validator passes.
      Redfish-protocol-validator passes 1 more atom in comparison to previous.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I1e7d41738884593bf333e4b9b53d318838808008
      291d709d
    • Willy Tu's avatar
      Update CollectionMembers to use UrlFromPieces · ae9031f0
      Willy Tu authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Refactor getCollectionMembers to make sure all Url created with dbus
      paths are generated via UrlFromPieces helper function. This allow us to
      manage all URL generated from dbus in one place and allow us to make
      future changes to affect all resources.
      
      We can make changes to all resources easier if they are all managed by
      one function.
      
      Tested:
      Redfish Validator Passed. All Collections working as expected and match
      previous implmentation.
      
      Change-Id: I5d3b2b32f047ce4f20a2287a36a3e099efd6eace
      Signed-off-by: default avatarWilly Tu <wltu@google.com>
      ae9031f0
  18. Nov 01, 2022
    • Ed Tanous's avatar
      Fix meson warning · 6107da1e
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      '''
      WARNING: Project targets '>=0.57.0' but uses feature introduced in
      0.59.0': fs.stem_file.  meson.build:386:
      '''
      
      Warning is present on master, because we use features from 0.59, and
      0.60.  Update to a minimu meson version of 0.63, to match both yocto and
        openbmc CI.
      
      Tested:
      meson build
      no longer throws the above warning.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: Ifac119aa8c8e45859e7374e1c468ea0c91664c2d
      6107da1e
    • Ed Tanous's avatar
      Upgrade required version of boost to 1.80 · dae97b20
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      This is to match yocto. subproject is already pointed at 1.80, but for
      a while CI still had 1.79. But OpenBMC CI has long since been moved [1]
      to 1.80, so upgrade the dependency requirements in turn.
      
      [1] https://github.com/openbmc/openbmc-build-scripts/blob/05fb2a0ab2ff772679272047b0bf0608adaf41fa/scripts/build-unit-test-docker#L80
      
      
      
      Tested: Code compiles. No functional changes.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: Ife6d163660b734893f0793da0e642cd61730acec
      dae97b20
    • Ed Tanous's avatar
      Fix meson warnings · f165deef
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      As written, when we pull in the boost and boost-url subprojects, we hit
      problems in the meson files.
      
      ```
      ../meson.build:291: WARNING: include_directories sandbox violation!
      ```
      This commit resolves this issue, by adding explicit meson.build files
      for both boost and boost-url.
      
      Tested:
      meson buildlocal
      
      No longer returns the above error, and shows
        Subprojects
          boost                                 : YES
          boost-url                             : YES
      
      Whereas previously those two dependencies showed up as NO.
      
      Code compiles.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: Ib25340723c8cb7d6139e3e51db023e9d90e30aab
      f165deef
  19. Oct 31, 2022
    • Tony Lee's avatar
      pcie: Fixed return nothing when get PCIeDeviceId · a9f68bb5
      Tony Lee authored and Ed Tanous's avatar Ed Tanous committed
      
      
      GET /redfish/v1/Systems/system/PCIeDevices/<str> nothing will be
      returned if their 'generationInUse' is Unknown.
      The original intention is that if it is Unknown, there is no need to
      display '"PCIeType"'. But the others still have to show.
      
      After fix:
      PCIeType is not Unknown:
      GET http://${bmc}/redfish/v1/Systems/system/PCIeDevices/<str>
      {
        "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/<str>.",
        "@odata.type": "#PCIeDevice.v1_4_0.PCIeDevice",
        "DeviceType": "SingleFunction",
        "Id": "<str>",
        "Manufacturer": "Intel Corporation",
        "Name": "PCIe Device",
        "PCIeFunctions": {
      "@odata.id":
      "/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions"
        },
        "PCIeInterface": {
          "PCIeType": "Gen1"
        }
      }
      
      PCIeType is Unknown:
      GET http://${bmc}/redfish/v1/Systems/system/PCIeDevices/<str>
      {
        "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/<str>",
        "@odata.type": "#PCIeDevice.v1_4_0.PCIeDevice",
        "DeviceType": "SingleFunction",
        "Id": "<str>",
        "Manufacturer": "Intel Corporation",
        "Name": "PCIe Device",
        "PCIeFunctions": {
          "@odata.id":
          "/redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions"
        }
      }
      
      Signed-off-by: default avatarTony Lee <tony.lee@quantatw.com>
      Change-Id: I85a97e0370a5789e4526964272381a557ce942a0
      a9f68bb5
    • Claire Weinan's avatar
      LogService: Increase dump timestamp precision · bbd80db8
      Claire Weinan authored and Ed Tanous's avatar Ed Tanous committed
      This is a follow-on to "LogService: Increase Fault Log timestamp
      precision" [1]. Since microsecond precision timestamp support for
      other dump types (in addition to FaultLog) have recently been added in
      phosphor-debug-collector (see "Populate timestamps with microsecond
      precision" [2]), we now update bmcweb to expose these timestamps with
      microsecond precision.
      
      Dump entry "Created" timestamps are based on the "Elapsed" property of
      the D-Bus interface xyz.openbmc_project.Time.EpochTime [3], which is
      defined as time elapsed since the epoch in microseconds.
      
      Client impact: Dump entry "Created" timestamps are shown with
      microsecond precision instead of second precision, for entries of all
      dump types (not just FaultLog).
      
      Tested:
      Forced creation of a system dump entry from BMC console:
      ```
      busctl call xyz.openbmc_project.Dump.Manager  /xyz/openbmc_project/dump/system xyz.openbmc_project.Dump.NewDump Notify ut 1 2
      ```
      
      Retrieved the entry individually and as part of its collection:
      ```
      curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1
      curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries
      ```
      
      Before change: `"Created": "2022-10-25T22:56:13+00:00",`
      After change:  `"Created": "2022-10-25T22:56:13.271157+00:00",`
      
      Redfish Service Validator passed on the following URI trees:
      /redfish/v1/Managers/bmc/LogServices/Dump/Entries
      /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries
      /redfish/v1/Systems/system/LogServices/Dump/Entries
      
      [1] https://github.com/openbmc/bmcweb/commit/c6fecdabd58b4c380caf1b83801ad4eb54922fff
      [2] https://github.com/openbmc/phosphor-debug-collector/commit/c0ab9d43d5e19123cca1a1592ee07fc064b84199
      [3] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Time/EpochTime.interface.yaml
      
      
      
      Signed-off-by: default avatarClaire Weinan <cweinan@google.com>
      Change-Id: Ia1682d09cf196c63da7d236df31695be5a5ad34b
      bbd80db8
  20. Oct 28, 2022
    • Ed Tanous's avatar
      Fix privileges on default handlers · 0ea4b4e2
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Regardless of what privileges are allowed on a resource, we should
      almost always be pulling from the PrivilegeRegistry for the information.
      This corrects the handlers in redfish_v1.hpp.  Namely that
      JsonSchemaCollection now pulls from the generated privilege registry
      files, and the 404 handler now requires a valid login to hit the route.
      This allows 401 to be returned on routes that would 404.  Arguably users
      should not be able to see what routes bmcweb implements if they are not
      authenticated.  Marking the 404 route as login is largely ceremonial and
      for documentation, because there is a separate check for a user being
      authenticated.
      
      Tested:
      Redfish service validator passes.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I4c03b0ae05d9fb7712d6ec3b6f2feaf034ca0750
      0ea4b4e2
  21. Oct 25, 2022
    • Nan Zhou's avatar
      redfish.hpp: fix header path · 4e7efda1
      Nan Zhou authored and Ed Tanous's avatar Ed Tanous committed
      
      
      This must be historical reason that we use relative path in these
      includes.
      
      Given that redfish-core/lib is already in include path, these relative
      paths are not necessary.
      
      Tested: code compiles.
      
      Signed-off-by: default avatarNan Zhou <nanzhoumails@gmail.com>
      Change-Id: Ia6b6be8a7aded98c96cdca150467bc7d825230af
      4e7efda1
    • Willy Tu's avatar
      utility: Append Url Pieces to existing Url · c6bcedc6
      Willy Tu authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Add helper function to append pieces to existing url to allow more
      flexible control over the url. This allows us to avoid have each
      resource append the pieces outside of the utility functions and help
      maintain all url modifications in a central place for easy management.
      
      Tested: Does not affect Redfish Tree. Unit Test passed.
      Change-Id: I751f3c120cbadb465915b12aa253edd53ef32123
      Signed-off-by: default avatarWilly Tu <wltu@google.com>
      c6bcedc6
    • Carson Labrado's avatar
      HTTP Client: Improve handling operation timeouts · 513d1ffc
      Carson Labrado authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Now that we are using timer.async_wait() with the async http
      operations we need to account for the scenario where the timer fails
      before the operation fails.  When that occurs we need to abort the
      operation once its callback gets called.
      
      Currently we proceed as if the timer doesn't exist.  This causes a
      fault if one of the operations times out.  This patch adds a check
      to the start of each async operation so that we do not continue with
      the normal message sending flow when an operation times out.
      
      Tested:
      In order to create a connection timeout I created a dummy interface
      and set the IP of my satellite BMC to route to the interface:
      ip link add dummy0 type dummy
      ip link set dev dummy0 up
      ip route add 120.60.30.15 dev dummy0
      
      All packets sent to 120.60.30.15 will get dropped and thus connection
      attempts will timeout.  This does not cause bmcweb to crash.
      
      To make the satellite reachable again I used
      this command to delete the routing:
      ip route del 120.60.31.15 dev dummy0
      
      After doing so messages were once again able to be forwarded correctly
      to the satellite.
      
      Signed-off-by: default avatarCarson Labrado <clabrado@google.com>
      Change-Id: Ie8d022c2195838e383eefcd0e12ae8cfab76e3e1
      513d1ffc
    • Jiaqing Zhao's avatar
      certificate: Allow deleting LDAP client certificate · 99612247
      Jiaqing Zhao authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Users should be able to delete LDAP client certificate, and phosphor-
      certificate-manager already supports this. This patch adds the Redfish
      API endpoint for it.
      
      Tested:
      DELETE /redfish/v1/AccountService/LDAP/Certificates/1 removes the LDAP
      client certificate installed on system.
      
      Change-Id: If1c082c78c404b5877e74ba50de3a970cd823a90
      Signed-off-by: default avatarJiaqing Zhao <jiaqing.zhao@intel.com>
      99612247
Loading